Submission #16775185


Source Code Expand

Copy
s=int(input())

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 185 Byte
Status
Exec Time 69 ms
Memory 9216 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 19 ms 9040 KB
subtask0_sample_02.txt 24 ms 9164 KB
subtask0_sample_03.txt 20 ms 8872 KB
subtask0_sample_04.txt 17 ms 8832 KB
subtask0_sample_05.txt 15 ms 8976 KB
subtask1_01.txt 26 ms 8876 KB
subtask1_02.txt 20 ms 8984 KB
subtask1_03.txt 19 ms 9048 KB
subtask1_04.txt 18 ms 9112 KB
subtask1_05.txt 18 ms 9172 KB
subtask1_06.txt 19 ms 8880 KB
subtask1_07.txt 20 ms 9172 KB
subtask1_08.txt 18 ms 9176 KB
subtask1_09.txt 17 ms 8984 KB
subtask1_10.txt 19 ms 8928 KB
subtask1_11.txt 20 ms 9044 KB
subtask1_12.txt 19 ms 8884 KB
subtask1_13.txt 17 ms 8880 KB
subtask2_01.txt 69 ms 8992 KB
subtask2_02.txt 69 ms 9156 KB
subtask2_03.txt 69 ms 8980 KB
subtask2_04.txt 69 ms 8984 KB
subtask2_05.txt 68 ms 9148 KB
subtask2_06.txt 69 ms 8984 KB
subtask2_07.txt 69 ms 8988 KB
subtask2_08.txt 69 ms 9216 KB
subtask2_09.txt 19 ms 9188 KB
subtask2_10.txt 18 ms 8904 KB
subtask2_11.txt 19 ms 9004 KB
subtask2_12.txt 21 ms 9052 KB