/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 13ms 2.777 MiB
#2 Wrong Answer 64ms 5.25 MiB
#3 Wrong Answer 65ms 4.734 MiB
#4 Wrong Answer 65ms 4.516 MiB
#5 Wrong Answer 66ms 4.73 MiB
#6 Wrong Answer 62ms 4.727 MiB
#7 Wrong Answer 63ms 4.562 MiB
#8 Wrong Answer 62ms 3.344 MiB
#9 Wrong Answer 26ms 3.027 MiB
#10 Wrong Answer 27ms 3.023 MiB
#11 Wrong Answer 62ms 4.672 MiB
#12 Accepted 60ms 4.723 MiB
#13 Accepted 51ms 4.719 MiB
#14 Wrong Answer 58ms 4.582 MiB
#15 Accepted 67ms 4.5 MiB
#16 Wrong Answer 68ms 4.562 MiB
#17 Wrong Answer 67ms 4.625 MiB

Code

t = int(input())
for i in range(t):
    n=int(input())
    q=[]
    s=list(map(int,input().split()))
    start = False
    count=0
    len=0
    max_len=0
    for j in range(n):
        if s[j]==1:
            start= True
            count+=1
            max_len=max(count,max_len)
        elif s[j]==3 and start :
            count+=1
            max_len=max(count,max_len)
        elif s[j]==2:
            q.append(count)
            max_len=count
            count=0
            start= False
        elif start :
            count+=1
            max_len=max(count,max_len)
    print(max_len)

Information

Submit By
Type
Submission
Problem
P1036 Perfect subarray
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-14 14:15:02
Judged At
2024-03-14 14:15:02
Judged By
Score
25
Total Time
68ms
Peak Memory
5.25 MiB