結果
| 問題 |
No.1471 Sort Queries
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-24 22:25:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 136 ms / 2,000 ms |
| コード長 | 390 bytes |
| コンパイル時間 | 418 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 79,696 KB |
| 最終ジャッジ日時 | 2024-12-15 22:04:14 |
| 合計ジャッジ時間 | 5,796 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
n, q = map(int, input().split())
s = input()
cut = [[0] * 26]
for i in s:
cut.append(cut[-1][:])
cut[-1][ord(i) - ord('a')] += 1
for _ in range(q):
l, r, x = [int(i) for i in input().split()]
count = [cut[r][i] - cut[l-1][i] for i in range(26)]
for ind, i in enumerate(count):
if i >= x:
print(chr(ind + ord("a")))
break
x -= i