CSES - HIIT Open 2018 - Results
Submission details
Task:HIIT Generation
Sender:TreamDeam
Submission time:2018-05-26 15:58:43 +0300
Language:Python3
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2--details
#3ACCEPTED0.06 sdetails
#4ACCEPTED0.04 sdetails

Code

n = int(input())
s = "HIIT"
cur = "HIIT"
for i in range(n):
  m = input()
  if m == "I":
    cur = cur.replace("II", "HIITHIIT")
  else:
    cur = cur.replace(m, s)
print(cur)

Test details

Test 1

Verdict: ACCEPTED

input
17
I
I
I
I
...

correct output
HHHHHHHHHHHHHHHHHHIITHIITTHHII...

user output
HHHHHHHHHHHHHHHHHHIITHIITTHHII...

Test 2

Verdict:

input
333332
H
H
H
H
...

correct output
HIITIITIITIITIITIITIITIITIITII...

user output
(empty)

Test 3

Verdict: ACCEPTED

input
24
H
T
H
T
...

correct output
HIIHIITIIHIIHIITIIHIITIIHIIHII...

user output
HIIHIITIIHIIHIITIIHIITIIHIIHII...

Test 4

Verdict: ACCEPTED

input
0

correct output
HIIT

user output
HIIT