CSES - HIIT Open 2017 - Results
Submission details
Task:HIIT game
Sender:Kanadan virallinen maajoukkue
Submission time:2017-05-27 12:46:17 +0300
Language:C++
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.05 sdetails
#3ACCEPTED0.04 sdetails
#4ACCEPTED0.03 sdetails
#5ACCEPTED0.10 sdetails
#6ACCEPTED0.07 sdetails
#7ACCEPTED0.12 sdetails
#8ACCEPTED0.09 sdetails
#9ACCEPTED0.10 sdetails
#10ACCEPTED0.05 sdetails
#11ACCEPTED0.03 sdetails
#12ACCEPTED0.05 sdetails
#13ACCEPTED0.04 sdetails
#14ACCEPTED0.04 sdetails
#15ACCEPTED0.04 sdetails
#16ACCEPTED0.05 sdetails
#17ACCEPTED0.04 sdetails
#18ACCEPTED0.05 sdetails
#19ACCEPTED0.05 sdetails
#20ACCEPTED0.04 sdetails
#21ACCEPTED0.05 sdetails
#22ACCEPTED0.04 sdetails
#23ACCEPTED0.04 sdetails
#24ACCEPTED0.05 sdetails
#25ACCEPTED0.04 sdetails
#26ACCEPTED0.03 sdetails
#27ACCEPTED0.04 sdetails
#28ACCEPTED0.04 sdetails
#29ACCEPTED0.06 sdetails

Compiler report

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

Code

#include<iostream>
#include<queue>
#include<stack>

using namespace std;


int main(){
    stack<char> HITLER;
    string STALIN;
    int MUSSOLINI=0;    
    cin>>STALIN;
    
    for(int i=0; i<STALIN.size(); i++){
        HITLER.push(STALIN[i]);
        if(HITLER.size()>=4){
            char c1,c2,c3,c4;
            c1 = HITLER.top();
            HITLER.pop();
            c2 = HITLER.top();
            HITLER.pop();
            c3 = HITLER.top();
            HITLER.pop();
            c4 = HITLER.top();
            HITLER.pop();
            if(c4 == 'H' && c3 == 'I' && c2 == 'I' && c1 == 'T'){
                MUSSOLINI++;
            }else{
                HITLER.push(c4);
                HITLER.push(c3);
                HITLER.push(c2);
                HITLER.push(c1);
            }
        }
    }
    
    if(MUSSOLINI % 2 == 1){
        cout<<"Uolevi"<<endl;
    }else{
        cout<<"Maija"<<endl;
    }
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
HIIT

correct output
Uolevi

user output
Uolevi

Test 2

Verdict: ACCEPTED

input
TIIH

correct output
Maija

user output
Maija

Test 3

Verdict: ACCEPTED

input
HIITHIIT

correct output
Maija

user output
Maija

Test 4

Verdict: ACCEPTED

input
HIHIHIHI

correct output
Maija

user output
Maija

Test 5

Verdict: ACCEPTED

input
HIITHIITHIITHIITHIITHIITHIITHI...

correct output
Uolevi

user output
Uolevi

Test 6

Verdict: ACCEPTED

input
HIITHIITHIITHIITHIITHIITHIITHI...

correct output
Maija

user output
Maija

Test 7

Verdict: ACCEPTED

input
HITIHITIHITIHITIHITIHITIHITIHI...

correct output
Maija

user output
Maija

Test 8

Verdict: ACCEPTED

input
HIHIHIHIHIHIHIHIHIHIHIHIHIHIHI...

correct output
Uolevi

user output
Uolevi

Test 9

Verdict: ACCEPTED

input
HIHIHIHIHIHIHIHIHIHIHIHIHIHIHI...

correct output
Maija

user output
Maija

Test 10

Verdict: ACCEPTED

input
THIITIHIIHHTIITIIITITTTHIHITHH...

correct output
Maija

user output
Maija

Test 11

Verdict: ACCEPTED

input
HIHHHIITHTHIITIIHIIHIITITTIHII...

correct output
Uolevi

user output
Uolevi

Test 12

Verdict: ACCEPTED

input
HTHIITHHHHIHITIIIHIITHHIIHIITT...

correct output
Uolevi

user output
Uolevi

Test 13

Verdict: ACCEPTED

input
IHIITIHHHIIHIITHHHIITHIITIHIIT...

correct output
Maija

user output
Maija

Test 14

Verdict: ACCEPTED

input
HHHIHHHIITHIITHHIHIITHIIIITHII...

correct output
Uolevi

user output
Uolevi

Test 15

Verdict: ACCEPTED

input
ITTHHIIHIITTIHIIHTIHIITHHITITT...

correct output
Uolevi

user output
Uolevi

Test 16

Verdict: ACCEPTED

input
HIIIHHITITTTHHIIHTIHIITITTITHI...

correct output
Uolevi

user output
Uolevi

Test 17

Verdict: ACCEPTED

input
HIITHHIITHHITHIITITIITHIITHHII...

correct output
Uolevi

user output
Uolevi

Test 18

Verdict: ACCEPTED

input
HIIHIITTTHHIITIIHHITITTHHIIITH...

correct output
Uolevi

user output
Uolevi

Test 19

Verdict: ACCEPTED

input
IHHIITHIITHTHHIITHIHHIIHTIHHHI...

correct output
Maija

user output
Maija

Test 20

Verdict: ACCEPTED

input
HIITHIIHIITTHIITHHHIIHTHIHIHII...

correct output
Uolevi

user output
Uolevi

Test 21

Verdict: ACCEPTED

input
THHTHIITHHHIITIITHHIITIHIITIHI...

correct output
Uolevi

user output
Uolevi

Test 22

Verdict: ACCEPTED

input
IHIITIHIHIIHTHHIIIITTTTHHIITHI...

correct output
Maija

user output
Maija

Test 23

Verdict: ACCEPTED

input
HIIIHIITTHIIHIIITTHHTHHHHHIIHI...

correct output
Uolevi

user output
Uolevi

Test 24

Verdict: ACCEPTED

input
HIHHIHIHIITHIIITITIHIHIITITIHI...

correct output
Maija

user output
Maija

Test 25

Verdict: ACCEPTED

input
HIITHIHIHIIHIITTHIHHIITIITIHII...

correct output
Uolevi

user output
Uolevi

Test 26

Verdict: ACCEPTED

input
HHHITITHTHHIHTITIHHIITHIITIITH...

correct output
Maija

user output
Maija

Test 27

Verdict: ACCEPTED

input
IHIITHTHIITHIHIHHTHIITIHIHITIT...

correct output
Maija

user output
Maija

Test 28

Verdict: ACCEPTED

input
HIITIITHIHHIITIHHIHIITITHIITHH...

correct output
Uolevi

user output
Uolevi

Test 29

Verdict: ACCEPTED

input
HHHHIITIITHTITHIHIHITITHHIITII...

correct output
Uolevi

user output
Uolevi