CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Sanat
Sender:
Submission time:2015-12-20 16:49:31 +0200
Language:C++
Status:READY
Result:60
Feedback
groupverdictscore
#1ACCEPTED60
Test results
testverdicttimescore
#1ACCEPTED0.07 s60details

Code

#include <bits/stdc++.h>
typedef long long ll;

using namespace std;

char vier[7]={'c','f','g','q','w','x','z'};
char vok[6]={'a','e','i','o','u','y'};
string s;

int suomi() {
  for (unsigned int i=1;i<s.size();i++) {
    if (s[i-1]==s[i]) {
      for (int j=0;j<6;j++) {
	if (s[i]==vok[j]) return 1;
      }
    }
  }
  for (unsigned int i=0;i<s.size();i++) {
      for (int j=0;j<7;j++) {
	if (s[i]==vier[j]) return 0;
      }
  }
  if (s[s.size()-1]=='y') return 0;
  if (s[s.size()-2]=='e' && s[s.size()-1]=='r') return 0;
  return 1;
  
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin>>n;
  for (int i=0;i<n;i++) {
    cin>>s;
    if (suomi()) cout<<"10-4\n";
    else cout<<"QAQ\n";
  }
}

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
10-4
10-4
QAQ
10-4
...