제출 #171015

#제출 시각아이디문제언어결과실행 시간메모리
171015div2der입자 가속기 (IZhO11_collider)C++14
100 / 100
231 ms3504 KiB
#include <iostream> #include <climits> #include <vector> using namespace std; const int N = 2e6; const int INF = INT_MAX; vector <pair <int, int> >v; int main () { //cerr << "Ready\n"; string s; int n, q; cin >> n >> q; cin >> s; while(q--) { char type; cin >> type; if (type == 'a') { int x, y; cin >> x >> y; #define eb emplace_back #define mkp make_pair v.eb(mkp(x, y)); } else { int pos; cin >> pos; #define sz(s) (int)(s.size()) for (int j = sz(v) - 1; j >= 0; -- j) { if (v[j].second == pos){ pos = v[j].first; continue; } if (v[j].second < pos) --pos; if (v[j].first <= pos) ++pos; } --pos; cout << s[pos] << '\n'; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...