Submission #1122952

#TimeUsernameProblemLanguageResultExecution timeMemory
1122952marinalucaCollider (IZhO11_collider)C++20
100 / 100
202 ms1576 KiB
#include <bits/stdc++.h> #pragma GCC optimize ("O3") #pragma GCC optimize ("fast-math") #pragma GCC optimize ("unroll-loops") using namespace std; #define int long long #define ll long long #define all (x) begin(x), end (x) #define xx first #define yy second using pii = pair <int, int>; using tii = tuple <int, int, int>; int n, m; string s; int x, y; signed main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> m; cin >> s; for (int i = 0; i < m; ++ i) { char op; cin >> op >> x; x = x - 1; if (op == 'a') { cin >> y; y = y - 1; char ch = s[x]; s.erase (s.begin() + x); s.insert (s.begin() + y, ch); } else cout << s[x] << '\n'; } return 0 ^ 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...