| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 171015 | div2der | 입자 가속기 (IZhO11_collider) | C++14 | 231 ms | 3504 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
