답안 #897468

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
897468 2024-01-03T06:58:35 Z kokoue 입자 가속기 (IZhO11_collider) C++14
100 / 100
230 ms 2700 KB
#include<bits/stdc++.h>
using namespace std;
int n,q;
vector<char> a;
int  main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>q;
    char c;
    for(int i=0;i<n;i++)
    {
        cin>>c;
        a.push_back(c);
    }
    char t;
    int idx,idx2;
    for(int i=0;i<q;i++)
    {
        cin>>t;
        if(t=='q')
        {
            cin>>idx;
            cout<<a[idx-1]<<"\n";
            continue;
        }
        cin>>idx>>idx2;
        char temp=a[idx-1];
        a.erase(a.begin()+idx-1);
        a.insert(a.begin()+idx2-1,temp);
      //  for(int j=0;j<a.size();j++) cout<<a[j]<<" ";
    //    cout<<"\n";
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 8 ms 736 KB Output is correct
4 Correct 64 ms 2264 KB Output is correct
5 Correct 118 ms 2300 KB Output is correct
6 Correct 168 ms 2380 KB Output is correct
7 Correct 187 ms 2516 KB Output is correct
8 Correct 83 ms 2516 KB Output is correct
9 Correct 230 ms 2700 KB Output is correct
10 Correct 166 ms 2684 KB Output is correct