# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331070 | Binyomin | Collider (IZhO11_collider) | C++14 | 929 ms | 2824 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
# include <bits/stdc++.h>
# include <ext/rope>
# define fi first
# define se second
# define pb push_back
# define int long long
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std ;
int32_t main() {
speed ;
//freopen("cupboard.in", "r", stdin ) ;
//freopen("cupboard.out", "w", stdout ) ;
int n, m ; cin >> n >> m ;
string s ; cin >> s ;
for( int i = 0 ; i < m ; i ++ ) {
char a ; cin >> a ;
if( a == 'a' ) {
int x, y ; cin >> x >> y ;
x --; y -- ;
string t;
t += s[x];
s.erase(x, 1) ;
s.insert(y, t) ;
}
else {
int x ; cin >> x ;
cout << s[x-1] << '\n' ;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |