結果
問題 |
No.1471 Sort Queries
|
ユーザー |
|
提出日時 | 2021-04-12 22:42:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 1,709 ms |
コンパイル使用メモリ | 172,512 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-28 18:09:20 |
合計ジャッジ時間 | 12,449 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 TLE * 2 -- * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair<int, int> int main() { int n, q; cin >> n >> q; string s; cin >> s; vector<int> v(n); rep(i, n) v[i] = s[i]-'a'; rep(i, q) { int l, r, x; cin >> l >> r >> x; l--, r--, x--; vector<int> subv; for (int j = l; j <= r; j++) subv.push_back(v[j]); sort(subv.begin(), subv.end()); string ans; ans.push_back(subv[x]+'a'); cout << ans << endl; } }