Task: | Sanat |
Sender: | |
Submission time: | 2015-12-21 09:47:17 +0200 |
Language: | C++ |
Status: | READY |
Result: | 48 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 48 |
test | verdict | time | score | |
---|---|---|---|---|
#1 | ACCEPTED | 0.22 s | 48 | details |
Compiler report
input/code.cpp: In function 'bool ien(std::string)': input/code.cpp:27:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<ene.size(); ++i){ ^ input/code.cpp:29:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j=0; j<ene[i].size(); ++j){ ^ input/code.cpp:34:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<fie.size(); ++i){ ^ input/code.cpp:36:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int j=0; j<fie[i].size(); ++j){ ^ input/code.cpp:42:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<s.size(); ++i){ ^ input/code.cpp:43:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for...
Code
#include <iostream> #include <vector> using namespace std; int n; int z[255]; bool vw(char c){ return c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='y'; } vector<string> en; vector<string> fi; vector<string> ene; vector<string> fie; vector<string> fivw; vector<string> fip; bool ien(string s){ if (!vw(s[0]) && !vw(s[1])) return 1; for (int i=0; i<ene.size(); ++i){ bool is=1; for (int j=0; j<ene[i].size(); ++j){ if (ene[i][j]!=s[s.size()-ene[i].size()+j]){ is=0; break;} } if (is) return 1; } for (int i=0; i<fie.size(); ++i){ bool is=1; for (int j=0; j<fie[i].size(); ++j){ if (fie[i][j]!=s[s.size()-fie[i].size()+j]){ is=0; break;} } if (is) return 0; } for (int i=0; i<s.size(); ++i){ for (int j=0; j<en.size(); ++j){ if (i+en[j].size()>s.size()) continue; bool is=1; for (int k=0; k<en[j].size(); ++k){ if (en[j][k]!=s[i+k]){ is=0; break; } } if (is) return 1; } for (int j=0; j<fi.size(); ++j){ if (i+fi[j].size()>s.size()) continue; bool is=1; for (int k=0; k<fi[j].size(); ++k){ if (fi[j][k]!=s[i+k]){ is=0; break; } } if (is) return 0; } } for (int i=0; i<fivw.size(); ++i){ if (fivw[i].size()==s.size()){ bool ok=1; for (int j=0; j<s.size(); ++j){ int a=(fivw[i][j]!='1'); int b=vw(s[j]); if (a!=b){ ok=0; break; } } if (ok) return 0; } } return 1; } int main(){ en.push_back("th"); en.push_back("ph"); en.push_back("sh"); en.push_back("ae"); en.push_back("b"); en.push_back("c"); en.push_back("g"); en.push_back("q"); en.push_back("w"); en.push_back("x"); en.push_back("z"); fi.push_back("aa"); fi.push_back("au"); fi.push_back("eu"); fi.push_back("ei"); fi.push_back("ai"); fi.push_back("ii"); fi.push_back("kk"); fi.push_back("lk"); fi.push_back("ll"); fi.push_back("mm"); fi.push_back("uo"); fi.push_back("ou"); fi.push_back("pp"); fi.push_back("lp"); fi.push_back("ln"); ene.push_back("ng"); ene.push_back("b"); ene.push_back("c"); ene.push_back("d"); ene.push_back("f"); ene.push_back("g"); ene.push_back("h"); ene.push_back("l"); ene.push_back("m"); ene.push_back("p"); ene.push_back("q"); ene.push_back("r"); ene.push_back("s"); ene.push_back("w"); ene.push_back("x"); ene.push_back("z"); ene.push_back("ity"); ene.push_back("lly"); fie.push_back("nen"); fie.push_back("sti"); fivw.push_back("1010"); fivw.push_back("0010"); fivw.push_back("10110"); fivw.push_back("10010"); fivw.push_back("101110"); fivw.push_back("100110"); cin >> n; for (int i=0; i<n; ++i){ string s; cin >> s; if (ien(s)) cout << "QAQ\n"; else cout << "10-4\n"; } }