Code Submission Evaluation System Login

HIIT Open 2018

Start:2018-05-26 11:00:00
End:2018-05-26 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2018 - Results
History
2018-05-26 15:59:54
2018-05-26 15:58:54
2018-05-26 11:59:39
2018-05-26 11:49:14
2018-05-26 11:22:34
2018-05-26 11:19:42
Task:HIIT Generation
Sender:Robotiimi
Submission time:2018-05-26 11:49:14
Language:C++
Status:READY
Result:WRONG ANSWER

Test results

testverdicttime (s)
#1WRONG ANSWER0.02 / 1.00details
#2WRONG ANSWER0.04 / 1.00details
#3WRONG ANSWER0.01 / 1.00details
#4ACCEPTED0.01 / 1.00details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:20:12: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
     if (i&1==0) {
           ~^~~
input/code.cpp:21:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0; j<r1.size(); j++) {
                       ~^~~~~~~~~~
input/code.cpp:30:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0; j<r2.size(); j++) {
                       ~^~~~~~~~~~

Code

#include <bits/stdc++.h>
#include <string>

using namespace std;


int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);

int n;
cin >> n;
string r1 = "HIIT";
string r2 = "HIIT";
char a;
char b;

for (int i=0; i<n; i++) {
    cin >> a;
    if (i&1==0) {
        for (int j=0; j<r1.size(); j++) {            
            b = r1[j];
            if (b==a) {
                r2 += "HIIT"; 
            } else {
                r2 += b;
            }
        }
    } else {
        for (int j=0; j<r2.size(); j++) {            
            b = r2[j];
            if (b==a) {
                r1 += "HIIT";
            } else {
                r1 += b;
            }
        }
    
    }
}
if (r1.size() < r2.size()) {
    cout << r2 << "\n";
} else {
    cout << r1 << "\n";
}
}

Test details

Test 1

Verdict: WRONG ANSWER

input
17
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
view   save

correct output
HHHHHHHHHHHHHHHHHHIITHIITTHHII...
view   save

user output
HIITHHIITHIITTHHIITHIITTHHIITH...
view   save

Test 2

Verdict: WRONG ANSWER

input
333332
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
...
view   save

correct output
HIITIITIITIITIITIITIITIITIITII...
view   save

user output
HIITHIITIITHIITIITHIITIITHIITI...
view   save

Test 3

Verdict: WRONG ANSWER

input
24
H
T
H
T
H
T
H
T
H
T
H
T
H
T
H
T
H
T
H
...
view   save

correct output
HIIHIITIIHIIHIITIIHIITIIHIIHII...
view   save

user output
HIITHIITIITHIIHIITHIITIITHIIHI...
view   save

Test 4

Verdict: ACCEPTED

input
0
view   save

correct output
HIIT
view   save

user output
HIIT
view   save