?
№ | Отправитель | Задача | Язык | Вердикт | Время | Память | Отослано | Протест. | |
---|---|---|---|---|---|---|---|---|---|
134331042 |
Дорешивание: NguyenTienPDP |
1607D - 22 | Python 3 | Полное решение | 358 мс | 26360 КБ | 2021-11-04 19:28:26 | 2021-11-04 19:28:26 |
def solution(): 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') for _ in range(int(input())): solution()
?
?
?
?