Submission #675418

# Submission time Handle Problem Language Result Execution time Memory
675418 2022-12-27T08:48:27 Z Summers Collider (IZhO11_collider) C++17
100 / 100
202 ms 20488 KB
#include<bits/stdc++.h>
#include <ext/rope>
#define endl '\n'
using namespace std;
using namespace __gnu_cxx;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    long long n,m,i,j,l,r,x;
    string s1;
    rope<char>s;
    char t;

    cin>>n>>m;
    cin>>s1;

    for(i=0;i<n;i++)s.push_back(s1[i]);

    for(i=0;i<m;i++)
    {
        cin>>t;

        if(t=='a')
        {
            cin>>l>>r;
            l--; r--;
            x=s[l];
            s.erase(l,1);
            s.insert(r,x);
        }
        else
        {
            cin>>l;
            cout<<s[l-1]<<endl;
        }
    }

}

Compilation message

collider.cpp: In function 'int main()':
collider.cpp:13:21: warning: unused variable 'j' [-Wunused-variable]
   13 |     long long n,m,i,j,l,r,x;
      |                     ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 24 ms 468 KB Output is correct
3 Correct 30 ms 3568 KB Output is correct
4 Correct 78 ms 15700 KB Output is correct
5 Correct 123 ms 16584 KB Output is correct
6 Correct 161 ms 18324 KB Output is correct
7 Correct 178 ms 19596 KB Output is correct
8 Correct 89 ms 18788 KB Output is correct
9 Correct 202 ms 20488 KB Output is correct
10 Correct 157 ms 19540 KB Output is correct