CSES - Putka Open 2015 – finaali - Results
Submission details
Task:Sanat
Sender:
Submission time:2015-12-20 14:44:21 +0200
Language:C++
Status:READY
Result:16
Feedback
groupverdictscore
#1ACCEPTED16
Test results
testverdicttimescore
#1ACCEPTED0.10 s16details

Compiler report

input/code.cpp: In function 'int suomea(std::string)':
input/code.cpp:7:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); ++i) {
                      ^
input/code.cpp:10:10: warning: 'vo' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(vo/s.size() > 0.3) {
          ^

Code

#include <iostream>
#include <set>
using namespace std;
set<char> vokaalit;
int suomea(string s) {
    float vo; 
    for(int i = 0; i < s.size(); ++i) {
        vo += vokaalit.count(s[i]);
    }
    if(vo/s.size() > 0.3) {
        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";
        }
    }
}

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
...