Task: | Sanalista |
Sender: | T |
Submission time: | 2020-09-28 00:27:41 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:42:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < word.length(); i++) { ~~^~~~~~~~~~~~~~~
Code
/** * Datatähti 2021 alku * Sanalista/Word list * @author TRS */ //Include #include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <list> #include <queue> #include <cmath> #include <climits> #include <vector> #include <string> #include <regex> //Definitions using namespace std; using ll = long long; typedef pair<int, int> pii; typedef pair<long long, long long> pll; typedef pair<string, string> pss; typedef vector<int> vi; #define pb push_back #define mp make_pair #define mt make_tuple //Constants #define infinity 0x3f3f3f3f #define linfinity 0x3f3f3f3f3f3f3f3f #define MOD 1000000007 int n; int answer = 0; string word; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n; for (int w = 0; w < n; w++) { cin>>word; bool valid = true; int letters[26]; for (int i = 0; i < word.length(); i++) { char character = word.at(i); letters[character - 'a']++; if (letters[character - 'a'] % 2 == 1) { valid = false; } else { valid = true; } } if (valid) { answer++; } } cout<<answer<<"\n"; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
1000 korvata sopimusaika nuhatartunta korttiautomaatti ... |
correct output |
---|
15 |
user output |
---|
473 |
Test 2
Verdict: WRONG ANSWER
input |
---|
1000 pub hansikaslokero erikoisvalmisteinen unijukka ... |
correct output |
---|
42 |
user output |
---|
495 |
Test 3
Verdict: WRONG ANSWER
input |
---|
1000 haapalastu toipumisaika mustalaiskieli taidelainaamo ... |
correct output |
---|
70 |
user output |
---|
507 |