Task: | HIIT remains |
Sender: | Ace of Spades |
Submission time: | 2016-05-28 11:31:19 +0300 |
Language: | Python2 |
Status: | READY |
Result: | ACCEPTED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.06 s | details |
#2 | ACCEPTED | 0.07 s | details |
#3 | ACCEPTED | 0.28 s | details |
#4 | ACCEPTED | 0.11 s | details |
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: ACCEPTED
input |
---|
100 IIITIIIHITHTHIIITIII HIHIIIIIIHIIITHIIIII ITTIIIITIIIIIIITIIIT IITHITITIHHIITTTIIII ... |
correct output |
---|
12 84 0 37 96 ... |
user output |
---|
12 84 0 37 96 ... |
Test 2
Verdict: ACCEPTED
input |
---|
100 TIIHHITTITITIHTHIIIITHIHHIIHTI... |
correct output |
---|
606723862 621369559 655243897 550750615 717769300 ... |
user output |
---|
606723862 621369559 655243897 550750615 717769300 ... |
Test 3
Verdict: ACCEPTED
input |
---|
10 TTHTHHTIIIIIITHIIHIITITTITTIIH... |
correct output |
---|
64668032062669502 66159978956790306 65755072918424640 64408596558953628 65238005187079543 ... |
user output |
---|
64668032062669502 66159978956790306 65755072918424640 64408596558953628 65238005187079543 ... |
Test 4
Verdict: ACCEPTED
input |
---|
3 HHHHHHHHHHHHHHHHHHHHHHHHHHHHHH... |
correct output |
---|
781234375000000000 4999750003 0 |
user output |
---|
781234375000000000 4999750003 0 |