Submission #75441434


Source Code Expand

S = input()
bef = ""
cnt = 0
ret = 0
max2 = 1996488706
for i in S:
    if i == bef:
        ret += cnt*(cnt+1)
        if ret>max2:
            ret %= max2
        cnt = 1
    else:
        cnt+=1
        bef = i
ret += cnt*(cnt+1)
if ret>max2:
    ret %= max2
print(ret//2)

Submission Info

Submission Time
Task C - Not Adjacent
User hydroxed_sil
Language Python (PyPy 3.11-v7.3.20)
Score 300
Code Size 293 Byte
Status AC
Exec Time 74 ms
Memory 108092 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
min.txt AC 55 ms 79496 KiB
random_01.txt AC 67 ms 105456 KiB
random_02.txt AC 65 ms 100456 KiB
random_03.txt AC 67 ms 105356 KiB
random_04.txt AC 63 ms 93460 KiB
random_05.txt AC 68 ms 106004 KiB
random_06.txt AC 62 ms 92952 KiB
random_07.txt AC 68 ms 106104 KiB
random_08.txt AC 62 ms 92600 KiB
random_09.txt AC 74 ms 108092 KiB
random_10.txt AC 69 ms 102976 KiB
random_11.txt AC 69 ms 105992 KiB
random_12.txt AC 60 ms 87188 KiB
random_13.txt AC 71 ms 106232 KiB
random_14.txt AC 67 ms 100732 KiB
random_15.txt AC 74 ms 107932 KiB
random_16.txt AC 63 ms 93444 KiB
random_17.txt AC 71 ms 106580 KiB
random_18.txt AC 67 ms 99456 KiB
random_19.txt AC 70 ms 106664 KiB
random_20.txt AC 62 ms 91128 KiB
random_21.txt AC 70 ms 106748 KiB
random_22.txt AC 65 ms 98684 KiB
random_23.txt AC 69 ms 106284 KiB
random_24.txt AC 61 ms 89208 KiB
random_25.txt AC 61 ms 86676 KiB
sample_01.txt AC 55 ms 79648 KiB
sample_02.txt AC 55 ms 79324 KiB