General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
134336409 Practice:
OLOGY
1607D - 22 Python 2 Accepted 405 ms 17772 KB 2021-11-04 20:44:56 2021-11-04 20:44:56
→ Source
from itertools import izip

def solution():
    _ = input()
    return "YES" if all((x[0] == 'B' and x[1] >= i) or (x[0] == 'R' and x[1] <= i) for i, x in enumerate(sorted((c, x) for x, c in izip(map(int, raw_input().strip().split()), raw_input().strip())), 1)) 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