Submission #16775208


Source Code Expand

Copy
s=input() + "0"*10

i = ans = 0
while i < len(s):
    k = 0
    while s[i] == '2' and s[i+1] == '5':
        k += 1
        i += 2
    ans += k * (k + 1) / 2
    i += 1
print(ans)

Submission Info

Submission Time
Task B - ニコニコ文字列
User masaharu2015
Language Python (3.8.2)
Score 0
Code Size 189 Byte
Status
Exec Time 62 ms
Memory 9104 KB

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 0 / 30 0 / 70
Status
× 5
× 18
× 30
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt
Subtask1 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt 28 ms 8948 KB
subtask0_sample_02.txt 23 ms 8884 KB
subtask0_sample_03.txt 18 ms 8896 KB
subtask0_sample_04.txt 17 ms 8788 KB
subtask0_sample_05.txt 18 ms 8892 KB
subtask1_01.txt 23 ms 8796 KB
subtask1_02.txt 18 ms 8880 KB
subtask1_03.txt 25 ms 8896 KB
subtask1_04.txt 26 ms 9012 KB
subtask1_05.txt 22 ms 9048 KB
subtask1_06.txt 18 ms 9048 KB
subtask1_07.txt 22 ms 8916 KB
subtask1_08.txt 17 ms 9056 KB
subtask1_09.txt 20 ms 9048 KB
subtask1_10.txt 20 ms 9008 KB
subtask1_11.txt 23 ms 9020 KB
subtask1_12.txt 18 ms 8796 KB
subtask1_13.txt 24 ms 8796 KB
subtask2_01.txt 62 ms 8896 KB
subtask2_02.txt 54 ms 9100 KB
subtask2_03.txt 60 ms 8904 KB
subtask2_04.txt 56 ms 9004 KB
subtask2_05.txt 54 ms 9104 KB
subtask2_06.txt 56 ms 9056 KB
subtask2_07.txt 28 ms 8992 KB
subtask2_08.txt 28 ms 9004 KB
subtask2_09.txt 18 ms 8816 KB
subtask2_10.txt 32 ms 8900 KB
subtask2_11.txt 19 ms 8908 KB
subtask2_12.txt 22 ms 9016 KB