結果
| 問題 | No.1471 Sort Queries |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-09 23:33:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 937 bytes |
| 記録 | |
| コンパイル時間 | 2,062 ms |
| コンパイル使用メモリ | 174,344 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-25 12:14:40 |
| 合計ジャッジ時間 | 13,482 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 TLE * 1 -- * 6 |
ソースコード
#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;
}