Submission #14872438


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 Python (3.8.2)
Score 0
Code Size 695 Byte
Status
Exec Time 2214 ms
Memory 324884 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 27 ms 8828 KB
subtask0_sample_02.txt 18 ms 9096 KB
subtask0_sample_03.txt 22 ms 8992 KB
subtask0_sample_04.txt 18 ms 8944 KB
subtask0_sample_05.txt 16 ms 8828 KB
subtask1_01.txt 20 ms 8932 KB
subtask1_02.txt 20 ms 8836 KB
subtask1_03.txt 18 ms 8940 KB
subtask1_04.txt 2214 ms 324884 KB
subtask1_05.txt 2214 ms 319580 KB
subtask1_06.txt 2214 ms 316912 KB
subtask1_07.txt 18 ms 9060 KB
subtask1_08.txt 22 ms 8840 KB
subtask1_09.txt 19 ms 9060 KB
subtask1_10.txt 22 ms 8828 KB
subtask1_11.txt 18 ms 8920 KB
subtask1_12.txt 17 ms 8836 KB
subtask1_13.txt 18 ms 8840 KB
subtask2_01.txt 20 ms 9104 KB
subtask2_02.txt 18 ms 9024 KB
subtask2_03.txt 18 ms 9108 KB
subtask2_04.txt 2213 ms 276520 KB
subtask2_05.txt 2213 ms 273200 KB
subtask2_06.txt 2213 ms 277316 KB
subtask2_07.txt 35 ms 8948 KB
subtask2_08.txt 30 ms 9044 KB
subtask2_09.txt 21 ms 8960 KB
subtask2_10.txt 22 ms 8936 KB
subtask2_11.txt 20 ms 8944 KB
subtask2_12.txt 20 ms 8936 KB