Task: | Sanat |
Sender: | |
Submission time: | 2015-12-20 16:24:10 +0200 |
Language: | C++ |
Status: | READY |
Result: | 52 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 52 |
test | verdict | time | score | |
---|---|---|---|---|
#1 | ACCEPTED | 0.20 s | 52 | details |
Compiler report
input/code.cpp: In function 'bool en(std::string)': input/code.cpp:9:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=1; i<s.size(); ++i) if (s[i]==s[i-1]) return 0; ^ input/code.cpp:11:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<s.size(); ++i){ ^ input/code.cpp:12:13: warning: array subscript has type 'char' [-Wchar-subscripts] ++z[s[i]]; ^
Code
#include <iostream> using namespace std; int n; int z[255]; bool en(string s){ for (int i=0; i<255; ++i) z[i]=0; for (int i=1; i<s.size(); ++i) if (s[i]==s[i-1]) return 0; for (int i=0; i<s.size(); ++i){ ++z[s[i]]; } if (z['b'] || z['c'] || z['d'] || z['g'] || z['q'] || z['w'] || z['x'] || z['z']) return 1; return 0; } int main(){ cin >> n; for (int i=0; i<n; ++i){ string s; cin >> s; if (en(s)) cout << "QAQ\n"; else cout << "10-4\n"; } }