General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
213988640 Practice:
TravellerAK
1607D - 22 PyPy 3-64 Accepted 842 ms 46256 KB 2023-07-16 09:00:55 2023-07-16 09:00:55
→ Source
for f in range(int(input())):n=int(input());a=[(c,int(x))for x,c in zip(input().split(),input())];print('YES')if all((x[0] =='B'and x[1]>=i)or(x[0]=='R'and x[1]<=i)for i,x in enumerate(sorted(a),start=1))else print('NO')
   	 	   	 		  		 		 		  		   	
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details