# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
897469 | presko | 입자 가속기 (IZhO11_collider) | C++14 | 214 ms | 2924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
vector<char> order;
int main()
{
int n,q;
string s="";
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n>>q;
cin>>s;
for(int i=0;i<n;i++)order.push_back(s[i]);
for(int i=0;i<q;i++)
{
char t;
cin>>t;
if(t=='q')
{
int pos;
cin>>pos;
cout<<order[pos-1]<<"\n";
}
else
{
int x,y;
cin>>x>>y;
char sym=order[x-1];
order.erase(order.begin()+x-1);
order.insert(order.begin()+y-1,sym);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |