Code Submission Evaluation System Login

CSES - HIIT Open 2017

HIIT Open 2017

Contest start:2017-05-27 11:00:00
Contest end:2017-05-27 16:00:00

Task list | Submit code | Submissions | Messages | Scoreboard


History
2017-05-27 11:19:02
Task:HIIT game
Sender:oispa opiskelupaikka tefyllä ;...;
Submission time:2017-05-27 11:19:02
Status:READY
Result:ACCEPTED

Show test data

Compiler report

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

Code

#include <bits/stdc++.h>

using namespace std;

int main(){
    string s; cin >> s;
    int c = 0;
    vector<char> lol;
    for(int i = 0; i < s.length(); ++i){
        if(lol.size() >= 4){
            if(lol[lol.size()-1] == 'T' && lol[lol.size()-2] == 'I' &&lol[lol.size()-3] == 'I' &&lol[lol.size()-4] == 'H'){
                c++;
                lol.pop_back();
                lol.pop_back();
                lol.pop_back();
                lol.pop_back();
                
            }
        }
         lol.push_back(s[i]);
          if(lol.size() >= 4){
            if(lol[lol.size()-1] == 'T' && lol[lol.size()-2] == 'I' &&lol[lol.size()-3] == 'I' &&lol[lol.size()-4] == 'H'){
                c++;
                lol.pop_back();
                lol.pop_back();
                lol.pop_back();
                lol.pop_back();
                
            }
          }
       
    }
     if(c%2 == 0)
            cout << "Maija" << endl;
        else
            cout << "Uolevi" << endl;
    return 0;
}