Task: | Sanat |
Sender: | |
Submission time: | 2015-12-20 16:27:50 +0200 |
Language: | C++ |
Status: | READY |
Result: | 68 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 68 |
test | verdict | time | score | |
---|---|---|---|---|
#1 | ACCEPTED | 0.11 s | 68 | details |
Compiler report
input/code.cpp: In function 'int suomea(std::string)': input/code.cpp:8:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i = 0; i < s.size(); ++i) { ^ input/code.cpp:9:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(i + 2 < s.size()) { ^ input/code.cpp:14:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(i+1 < s.size()) { ^ input/code.cpp:28:19: warning: array subscript has type 'char' [-Wchar-subscripts] ++cnt[s[i]]; ^
Code
#include <iostream> #include <set> using namespace std; set<char> vokaalit; int suomea(string s) { float vo; int cnt[1000] = {0}; for(int i = 0; i < s.size(); ++i) { if(i + 2 < s.size()) { if(vokaalit.count(s[i]) + vokaalit.count(s[i+1]) + vokaalit.count(s[i+2]) == 0) { // return 0; } } if(i+1 < s.size()) { if(s[i] == 'n' && s[i+1] == 'n') { return 1; } if(s[i] == 'm' && s[i+1] == 'm') { return 1; } if(s[i] == 't' && s[i+1] == 't') { return 1; } } vo += vokaalit.count(s[i]); ++cnt[s[i]]; } int lol = 0; if(0) { if(cnt['x'] || cnt['z'] || cnt['q'] || cnt['w']) lol += 5; if(cnt['d'] || cnt['f'] || cnt['g'] || cnt['b'] || cnt['c']) lol += 2; //if(s.back() == 'i') return 1; if(s.back() == 'y') lol += 3; if(s.back() == 'i') lol -= 4; if(s.back() == 'a') lol -= 4 ; if(vokaalit.count(s.back()) == 0) lol += 5; if(vo/s.size() > 0.44) { lol -= 4; } if(lol >= 3) return 0; return 1; } if(1) { if(cnt['x'] || cnt['z'] || cnt['q'] || cnt['w'] || cnt['c']) return 0; //if(s.back() == 'i') return 1; if(s.back() == 'y') return 0; if(s.back() == 'i') return 1; if(s.back() == 'a') return 1; if(vokaalit.count(s.back()) == 0) return 0; else return 1; if(vo/s.size() > 0.44) { return 1; } return 0; } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); vokaalit.insert('a'); vokaalit.insert('e'); vokaalit.insert('i'); vokaalit.insert('o'); vokaalit.insert('u'); vokaalit.insert('y'); int n; cin>>n; for(int i = 0; i < n; ++i) { string s; cin>>s; if(suomea(s)) { cout<<"10-4\n"; } else { cout<<"QAQ\n"; } } }