Submission #63803191


Source Code Expand

S = list(input())
count = 0
i = 0 
while i < len(S):
    if i % 2 == 0:  # 奇数番目(配列では偶数)
        if S[i] == 'o':
            S.insert(i, 'i')
            count += 1
    else:  # 偶数番目
        if S[i] == 'i':
            S.insert(i, 'o')
            count += 1
    i += 1

if len(S) % 2 == 1:
    S.append('o')
    count += 1

print(count)
exit()

Submission Info

Submission Time
Task B - Ticket Gate Log
User Task3
Language Python (CPython 3.11.4)
Score 250
Code Size 394 Byte
Status AC
Exec Time 10 ms
Memory 8904 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 9 ms 8804 KiB
00_sample_02.txt AC 9 ms 8784 KiB
00_sample_03.txt AC 9 ms 8792 KiB
01_random_01.txt AC 9 ms 8788 KiB
01_random_02.txt AC 9 ms 8804 KiB
01_random_03.txt AC 9 ms 8740 KiB
01_random_04.txt AC 9 ms 8736 KiB
01_random_05.txt AC 9 ms 8816 KiB
01_random_06.txt AC 9 ms 8812 KiB
01_random_07.txt AC 9 ms 8820 KiB
01_random_08.txt AC 9 ms 8904 KiB
01_random_09.txt AC 9 ms 8736 KiB
01_random_10.txt AC 10 ms 8728 KiB
02_handmade_01.txt AC 9 ms 8812 KiB
02_handmade_02.txt AC 9 ms 8848 KiB
02_handmade_03.txt AC 9 ms 8716 KiB
02_handmade_04.txt AC 9 ms 8816 KiB