def switch(current):
if current == 'H':
return 'O'
elif current == 'O':
return 'N'
elif current == 'N':
return 'I'
elif current == 'I':
return 'H'
s = input()
current = 'H'
count = 0
for val in s:
if val == current:
if val == 'I':
count += 1
current = switch(current)
print(count)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
2908 KB |
Output is correct |
2 |
Correct |
10 ms |
2764 KB |
Output is correct |
3 |
Correct |
10 ms |
2908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
2908 KB |
Output is correct |
2 |
Correct |
10 ms |
2812 KB |
Output is correct |
3 |
Correct |
10 ms |
2908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
2908 KB |
Output is correct |
2 |
Correct |
10 ms |
2908 KB |
Output is correct |
3 |
Correct |
10 ms |
2908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
2908 KB |
Output is correct |
2 |
Correct |
10 ms |
2908 KB |
Output is correct |
3 |
Correct |
10 ms |
2820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
2820 KB |
Output is correct |
2 |
Correct |
11 ms |
2908 KB |
Output is correct |
3 |
Correct |
10 ms |
2908 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
3160 KB |
Output is correct |
2 |
Correct |
19 ms |
3164 KB |
Output is correct |
3 |
Correct |
18 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
3164 KB |
Output is correct |
2 |
Correct |
20 ms |
3164 KB |
Output is correct |
3 |
Correct |
19 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
3164 KB |
Output is correct |
2 |
Correct |
20 ms |
3164 KB |
Output is correct |
3 |
Correct |
19 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
3168 KB |
Output is correct |
2 |
Correct |
19 ms |
3164 KB |
Output is correct |
3 |
Correct |
20 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
3164 KB |
Output is correct |
2 |
Correct |
19 ms |
3164 KB |
Output is correct |
3 |
Correct |
18 ms |
3164 KB |
Output is correct |