General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
75433741 Practice:
shameles
1330B - 39 PyPy 3 Time limit exceeded on test 3 2000 ms 18176 KB 2020-04-03 23:09:58 2020-04-03 23:09:58
 
 
→ Source
import sys
input=sys.stdin.readline
t=int(input())
for i in range(t):
    n=int(input())
    a=[int(i) for i in input().split() if i!='\n']
    maxa=max(a)
    freq,freq2=[0]*(maxa),[0]*(maxa)
    ans=[]
    freq[a[0]-1]=1
    for i in range(1,len(a)):
        freq2[a[i]-1]+=1
    for i in range(1,len(a)):
        if set(freq[:i])=={1} and set(freq2[:n-i])=={1}:
            #print('1')
            ans.append([str(i),str(n-i)])
            if len(ans)==2:
                break
        #print(freq,freq2,ans)
        freq[a[i]-1]+=1
        freq2[a[i]-1]-=1
    if len(ans)==0:
        sys.stdout.write('0'+'\n')
    else:
        sys.stdout.write(str(len(ans))+'\n')
        for i in (ans):
            for j in i:
                sys.stdout.write(j+' ')
            sys.stdout.write('\n')
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details