General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
134137031 Practice:
OLOGY
1607D - 21 Python 2 Accepted 498 ms 17436 KB 2021-11-02 20:12:20 2021-11-03 12:33:35
→ Source
from itertools import izip

def solution():
    _ = input()
    return "YES" if all((x[0] == 'B' and x[1] >= i+1) or (x[0] == 'R' and x[1] <= i+1) for i, x in enumerate(sorted((c, x) for x, c in izip(map(int, raw_input().split()), raw_input())))) else "NO"
 
for case in xrange(input()):
    print '%s' % solution()
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details