General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
223799269 Practice:
Dolphin__
1607D - 22 PyPy 3 Accepted 920 ms 29008 KB 2023-09-18 09:13:01 2023-09-18 09:13:01
→ Source
for _ in range(int(input())):
    n = int(input())
    a = map(int, input().split())
    b = list(input())
    c = sorted(zip(b, a))
    for i, (x, y) in enumerate(c):
        if x == 'B' and y < (i + 1) or x == 'R' and y > (i + 1):
            print('NO')
            break
    else:
        print('YES')
	  		
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details