/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 14ms 3.109 MiB
#2 Wrong Answer 69ms 5.117 MiB
#3 Wrong Answer 66ms 4.852 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-11-11 03:40:52
Judged By
Score
10
Total Time
69ms
Peak Memory
5.117 MiB