CSES - HIIT Open 2016 - Results
Submission details
Task:Ethernet cable
Sender:Ace of Spades
Submission time:2016-05-28 15:28:12 +0300
Language:Python2
Status:READY
Result:
Test results
testverdicttime
#10.05 sdetails

Code

def Ts(S):
L = [1,0,0,0,0]
for i in S:
if i == "H":
L[1] += L[0]
elif i == "I":
L[3] += L[2]
L[2] += L[1]
elif i == "T":
L[4] += L[3]
return L[4]
def main():
t = int(raw_input())
res = []
for i in range(t):
res.append(str( Ts(raw_input()) ))
print "\n".join(res)
main()

Test details

Test 1

Verdict:

input
50
7 8
0 6 east
2 3 east
+-+-+-+-+-+-+-+
...

correct output
13
44
67
52
72
...

user output
0
0
0
0
0
...