CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Sanat
Sender:
Submission time:2015-12-20 15:03:01 +0200
Language:C++
Status:READY
Result:36
Feedback
groupverdictscore
#1ACCEPTED36
Test results
testverdicttimescore
#1ACCEPTED0.68 s36details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:18:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "aa") fi += 0.8;
                     ^
input/code.cpp:19:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "ia") fi += 1.2;
                     ^
input/code.cpp:20:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "da") fi += 0.7;
                     ^
input/code.cpp:21:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "ta") fi += 0.2;
                     ^
input/code.cpp:22:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]...

Code

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#define ll long long
#define N (2<<16)
using namespace std;
int main () {
int n;
cin>>n;
for (int i = 0; i < n; i++) {
string s;
cin>>s;
double fi = 0, en = 0;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "aa") fi += 0.8;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "ia") fi += 1.2;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "da") fi += 0.7;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "ta") fi += 0.2;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "ss") fi += 0.3;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "da") fi += 0.7;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "er") fi += 0.9;
//for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "er") fi += 0.9;
for (int x = 0; x < s.length() - 1; x++) if (s.substr(x, 1) == "c") en += 0.9;
for (int x = 0; x < s.length() - 1; x++) if (s.substr(x, 1) == "z") en += 1.3;
for (int x = 0; x < s.length() - 1; x++) if (s.substr(x, 1) == "x") en += 1.3;
for (int x = 0; x < s.length() - 1; x++) if (s.substr(x, 1) == "w") en += 1.5;
for (int x = 0; x < s.length() - 2; x++) if (s.substr(x, 2) == "nd") en += 1.2;
for (int x = 0; x < s.length() - 3; x++) if (s.substr(x, 3) == "ing") en += 1.5;
if (fi >= en) {
cout<<"10-4"<<endl;
} else {
cout<<"QAQ"<<endl;
}
}
}

Test details

Test 1

Verdict: ACCEPTED

input
95000
pursua
zoomata
mantelilastu
jamming
...

correct output
10-4
10-4
10-4
QAQ
QAQ
...

user output
10-4
QAQ
10-4
10-4
10-4
...