CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Sanat
Sender:
Submission time:2015-12-20 16:09:28 +0200
Language:C++
Status:READY
Result:32
Feedback
groupverdictscore
#1ACCEPTED32
Test results
testverdicttimescore
#1ACCEPTED0.41 s32details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:30:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int64_t i=0;i<s.size()-1;i++) {
                      ^

Code

#include<iostream>

using namespace std;

enum res {
  ENGLISH,
  FINNISH,
  UNKNOWN
};

res classify(string s) {
  if(s == "ae" || s == "ue" || s == "oe" || s == "io" || s == "rd" || s == "ye" || s == "ya" || s == "yo" || s == "yu" || s == "ey" || s == "ay" || s == "iy" || s == "oy" || s == "uy") return ENGLISH;
  if(s[0] == 'z' || s[1] == 'z') return ENGLISH;
  if(s[0] == 'f' || s[1] == 'f') return ENGLISH;
  if(s[0] == 'b' || s[1] == 'b') return ENGLISH;
  if(s == "rg" || s == "gr" || s == "cr" || s == "br" || s == "tr" || s == "pr") return ENGLISH;
  if(s == "aa" || s == "ee" || s == "ii" || s == "oo" || s == "uu" || s == "yy") return FINNISH;
  return UNKNOWN;
}

int main(void) {
  int64_t n;
  cin >> n;

  for(int64_t T=0;T<n;T++) {
    string s;
    cin >> s;

    int64_t fail=0;
    for(int64_t i=0;i<s.size()-1;i++) {
      string d;
      d+=s[i];
      d+=s[i+1];
      int c=classify(d);
      if(c == ENGLISH) {
        cout << "QAQ\n";
        fail=1;
        break;
      } else if(c == FINNISH) {
        cout << "10-4\n";
        fail=2;
        break;
      }
    }
    if(!fail) cout << "10-4\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
QAQ
10-4
10-4
10-4
...