General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
134792326 Practice:
sYm0N_01
1607D - 22 Python 3 Accepted 389 ms 25892 KB 2021-11-09 22:33:06 2021-11-09 22:33:06
→ Source
for _ 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