Submission #331070

#TimeUsernameProblemLanguageResultExecution timeMemory
331070BinyominCollider (IZhO11_collider)C++14
100 / 100
929 ms2824 KiB
# 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 timeMemoryGrader output
Fetching results...