結果
問題 | No.1471 Sort Queries |
ユーザー | GrayCoder |
提出日時 | 2021-04-09 23:33:13 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 937 bytes |
コンパイル時間 | 1,643 ms |
コンパイル使用メモリ | 173,156 KB |
実行使用メモリ | 8,756 KB |
最終ジャッジ日時 | 2023-09-07 18:30:28 |
合計ジャッジ時間 | 14,219 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
8,756 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,384 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 2 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,380 KB |
testcase_07 | AC | 2 ms
4,376 KB |
testcase_08 | AC | 1 ms
4,380 KB |
testcase_09 | AC | 1 ms
4,380 KB |
testcase_10 | AC | 2 ms
4,376 KB |
testcase_11 | AC | 1 ms
4,384 KB |
testcase_12 | AC | 1 ms
4,380 KB |
testcase_13 | AC | 134 ms
4,380 KB |
testcase_14 | AC | 112 ms
4,380 KB |
testcase_15 | AC | 213 ms
4,380 KB |
testcase_16 | AC | 38 ms
4,376 KB |
testcase_17 | AC | 93 ms
4,380 KB |
testcase_18 | AC | 60 ms
4,380 KB |
testcase_19 | AC | 53 ms
4,376 KB |
testcase_20 | AC | 218 ms
4,380 KB |
testcase_21 | AC | 101 ms
4,376 KB |
testcase_22 | AC | 81 ms
4,384 KB |
testcase_23 | AC | 495 ms
4,376 KB |
testcase_24 | AC | 490 ms
4,380 KB |
testcase_25 | AC | 809 ms
4,380 KB |
testcase_26 | AC | 423 ms
4,380 KB |
testcase_27 | AC | 733 ms
4,376 KB |
testcase_28 | AC | 728 ms
4,380 KB |
testcase_29 | AC | 422 ms
4,380 KB |
testcase_30 | AC | 465 ms
4,380 KB |
testcase_31 | AC | 748 ms
4,380 KB |
testcase_32 | AC | 617 ms
4,376 KB |
testcase_33 | TLE | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, s, e) for (int i = s; i < e; ++i) #define sort_(a) stable_sort(a.begin(), a.end()) #define rsort(a) stable_sort(a.rbegin(), a.rend()) #define sum(a) accumulate(a.begin(), a.end(), 0LL) #define join(a, d) accumulate(a.begin() + 1, a.end(), a[0], [](string s, string t) { return s + d + t; }) #define all(a) a.begin(), a.end() #define degrees(a) a * 180.0 / M_PI; #define radians(a) (a * M_PI) / 180.0; // #define __lcm(a, b) std::__detail::__lcm(a, b) typedef long long ll; const long mod = 1e9 + 7; int main(void) { #ifdef DEBUG freopen("input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); int N, Q, L, R, X; cin >> N >> Q; string S; cin >> S; string s; rep(i, 0, Q) { cin >> L >> R >> X; s = S.substr(L - 1, R - L + 1); sort_(s); cout << s[X - 1] << endl; } return 0; }