結果
問題 |
No.1471 Sort Queries
|
ユーザー |
![]() |
提出日時 | 2021-04-09 21:28:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 108 ms / 2,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 82,364 KB |
実行使用メモリ | 78,616 KB |
最終ジャッジ日時 | 2024-06-25 04:10:50 |
合計ジャッジ時間 | 4,073 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
n, q = map(int, input().split()) S = input() d = 26 C = [[0]*(n+1) for _ in range(d)] for i, s in enumerate(S): for j in range(d): C[j][i+1] += C[j][i] c = ord(s) - ord('a') C[c][i+1] += 1 for _ in range(q): l, r, x = map(int, input().split()) l -= 1 for j in range(d): x -= C[j][r] - C[j][l] if x <= 0: break print(chr(j + ord('a')))