結果
| 問題 | No.1471 Sort Queries |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-26 10:16:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 193 ms / 2,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 367 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 93,876 KB |
| 最終ジャッジ日時 | 2026-03-26 01:57:29 |
| 合計ジャッジ時間 | 6,479 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
N,Q=map(int,input().split())
S=input()
from collections import Counter
from copy import deepcopy
cum=[Counter() for i in range(N+1)]
for i in range(N):
cum[i+1]=deepcopy(cum[i])
cum[i+1][S[i]]+=1
a_l=[chr(i) for i in range(97, 97+26)]
for i in range(Q):
L,R,X=map(int,input().split())
tmp_c=cum[R]-cum[L-1]
tmp=0
for j in a_l:
if tmp<=X<=tmp+tmp_c[j]:
print(j)
break
else:
tmp+=tmp_c[j]