#include <iostream> #include<string> using namespace std; int main() { int n, q, l, r; cin >> n >> q; string str; cin >> str; while (q--) { cin >> l >> r; for (int i = l-1, j = 0; i < r; i++, j++) { str.insert(i+j, 1, str[i+j]);//从str[l-1]开始,每次偏移1位为下一次插入 ...