Submission #16775212


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(int(ans))

Submission Info

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

Judge Result

Set Name Sample Subtask1 All
Score / Max Score 0 / 0 30 / 30 70 / 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 18 ms 8964 KB
subtask0_sample_02.txt 17 ms 8792 KB
subtask0_sample_03.txt 16 ms 8880 KB
subtask0_sample_04.txt 18 ms 9020 KB
subtask0_sample_05.txt 20 ms 8872 KB
subtask1_01.txt 20 ms 8864 KB
subtask1_02.txt 22 ms 8872 KB
subtask1_03.txt 19 ms 8896 KB
subtask1_04.txt 24 ms 8800 KB
subtask1_05.txt 20 ms 9032 KB
subtask1_06.txt 18 ms 8888 KB
subtask1_07.txt 20 ms 8868 KB
subtask1_08.txt 18 ms 8804 KB
subtask1_09.txt 19 ms 8792 KB
subtask1_10.txt 19 ms 9020 KB
subtask1_11.txt 18 ms 9024 KB
subtask1_12.txt 18 ms 9032 KB
subtask1_13.txt 18 ms 8868 KB
subtask2_01.txt 62 ms 9012 KB
subtask2_02.txt 54 ms 9132 KB
subtask2_03.txt 62 ms 9152 KB
subtask2_04.txt 55 ms 9008 KB
subtask2_05.txt 52 ms 8988 KB
subtask2_06.txt 54 ms 9132 KB
subtask2_07.txt 30 ms 8896 KB
subtask2_08.txt 34 ms 8888 KB
subtask2_09.txt 18 ms 8896 KB
subtask2_10.txt 19 ms 8904 KB
subtask2_11.txt 21 ms 8900 KB
subtask2_12.txt 18 ms 8816 KB