Task: | Sanalista |
Sender: | Luukasa |
Submission time: | 2020-09-28 00:27:14 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
Code
#include <iostream> #include <algorithm> #include <vector> #include <string> using namespace std; int main() { int n; cin >> n; vector<string> sanat; string temp; for(int i = 0; i < n; i++) { cin >> temp; sort(temp.begin(), temp.end()); sanat.push_back(temp); } //for(string c : sanat) // cout << c << '\n'; // maybe sort each word and then check for letter amounts int ans = n; for(int i = 0; i < n; i++) { char prev = ' '; for(char c : sanat[i]) { if(prev == ' ') { prev = c; continue; } if(c==prev) { prev = ' '; continue; } else { ans--; break; } } } cout << ans << '\n'; return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1000 korvata sopimusaika nuhatartunta korttiautomaatti ... |
correct output |
---|
15 |
user output |
---|
15 |
Test 2
Verdict: WRONG ANSWER
input |
---|
1000 pub hansikaslokero erikoisvalmisteinen unijukka ... |
correct output |
---|
42 |
user output |
---|
45 |
Test 3
Verdict: WRONG ANSWER
input |
---|
1000 haapalastu toipumisaika mustalaiskieli taidelainaamo ... |
correct output |
---|
70 |
user output |
---|
72 |