Submission #14872478


Source Code Expand

Copy
def readinput():
    s=input()
    return s

def findToken(s):
    tokens=[]
    it=s.find('25')
    if (it<0):
        return tokens
    ie=it+2
    #print(it,ie)
    while(ie+2<=len(s)):
        if s[ie:ie+2]=='25':
            ie+=2
        else:
            #print(it,ie)
            tokens.append(s[it:ie])
            it=s.find('25',ie)
            ie=it+2
    else:
        tokens.append(s[it:ie])
    return tokens      

def main(s):
    tokens=findToken(s)
    #print(tokens)
    sum=0
    for token in tokens:
        m=len(token)//2
        sum+=m*(m+1)//2
    return sum

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)

Submission Info

Submission Time
Task B - ニコニコ文字列
User bokukko
Language PyPy3 (7.3.0)
Score 0
Code Size 695 Byte
Status
Exec Time 2220 ms
Memory 664756 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask0_sample_05.txt
Subtask1 0 / 30 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 0 / 70 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 63 ms 61852 KB
subtask0_sample_02.txt 51 ms 61712 KB
subtask0_sample_03.txt 53 ms 61984 KB
subtask0_sample_04.txt 52 ms 61960 KB
subtask0_sample_05.txt 52 ms 61684 KB
subtask1_01.txt 50 ms 61996 KB
subtask1_02.txt 55 ms 61940 KB
subtask1_03.txt 52 ms 61992 KB
subtask1_04.txt 2219 ms 664472 KB
subtask1_05.txt 2220 ms 642940 KB
subtask1_06.txt 2219 ms 664756 KB
subtask1_07.txt 64 ms 63076 KB
subtask1_08.txt 53 ms 63084 KB
subtask1_09.txt 54 ms 63252 KB
subtask1_10.txt 52 ms 61792 KB
subtask1_11.txt 53 ms 61896 KB
subtask1_12.txt 53 ms 63452 KB
subtask1_13.txt 51 ms 61960 KB
subtask2_01.txt 45 ms 62464 KB
subtask2_02.txt 53 ms 62424 KB
subtask2_03.txt 50 ms 62596 KB
subtask2_04.txt 2215 ms 487968 KB
subtask2_05.txt 2215 ms 487884 KB
subtask2_06.txt 2215 ms 487888 KB
subtask2_07.txt 63 ms 63656 KB
subtask2_08.txt 54 ms 63824 KB
subtask2_09.txt 55 ms 63392 KB
subtask2_10.txt 54 ms 63160 KB
subtask2_11.txt 56 ms 63112 KB
subtask2_12.txt 58 ms 64716 KB