結果

問題 No.1471 Sort Queries
ユーザー wolgnikwolgnik
提出日時 2021-04-09 21:34:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 2,328 ms
コンパイル使用メモリ 86,624 KB
実行使用メモリ 80,008 KB
最終ジャッジ日時 2023-09-07 10:10:01
合計ジャッジ時間 6,898 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,028 KB
testcase_01 AC 85 ms
71,284 KB
testcase_02 AC 85 ms
71,032 KB
testcase_03 AC 92 ms
75,984 KB
testcase_04 AC 87 ms
71,368 KB
testcase_05 AC 82 ms
71,308 KB
testcase_06 AC 85 ms
70,868 KB
testcase_07 AC 87 ms
71,264 KB
testcase_08 AC 94 ms
75,668 KB
testcase_09 AC 92 ms
75,920 KB
testcase_10 AC 84 ms
71,272 KB
testcase_11 AC 85 ms
71,128 KB
testcase_12 AC 85 ms
76,044 KB
testcase_13 AC 101 ms
76,532 KB
testcase_14 AC 100 ms
76,860 KB
testcase_15 AC 104 ms
76,532 KB
testcase_16 AC 104 ms
76,848 KB
testcase_17 AC 98 ms
76,880 KB
testcase_18 AC 98 ms
76,980 KB
testcase_19 AC 102 ms
76,868 KB
testcase_20 AC 108 ms
76,872 KB
testcase_21 AC 105 ms
76,916 KB
testcase_22 AC 102 ms
76,784 KB
testcase_23 AC 117 ms
79,568 KB
testcase_24 AC 117 ms
79,708 KB
testcase_25 AC 118 ms
79,664 KB
testcase_26 AC 114 ms
78,952 KB
testcase_27 AC 117 ms
79,892 KB
testcase_28 AC 116 ms
79,644 KB
testcase_29 AC 119 ms
78,796 KB
testcase_30 AC 111 ms
76,864 KB
testcase_31 AC 124 ms
79,388 KB
testcase_32 AC 123 ms
78,640 KB
testcase_33 AC 125 ms
79,624 KB
testcase_34 AC 126 ms
79,844 KB
testcase_35 AC 119 ms
79,776 KB
testcase_36 AC 117 ms
80,008 KB
testcase_37 AC 114 ms
79,592 KB
testcase_38 AC 114 ms
79,836 KB
testcase_39 AC 116 ms
79,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, Q = map(int, input().split())
S = list(map(lambda c: ord(c) - ord("a"), list(input())[: -1]))

cs = [[0] * (N + 1) for _ in range(26)]
for i in range(26):
  for j in range(N): cs[i][j + 1] = cs[i][j] + (S[j] == i)

for _ in range(Q):
  l, r, x = map(int, input().split())
  for i in range(26):
    c = cs[i][r] - cs[i][l - 1]
    x -= c
    if x <= 0:
      print(chr(i + ord("a")))
      break
0