题目
wa记录
#include <bits/stdc++.h>
using namespace std;
const int N=6*1e5+10;
int n,q,ask,x,btime;
bool flag;
string s;
char c;
int ti_me[N];
int main(){
cin>>n>>s>>q;
int len=s.length();
for(int i=0;i<q;i++){
cin>>ask>>x>>c;
if(ask==1){
s[x-1]=c;
ti_me[x-1]=i;
}
if(ask==2){
btime=i;
flag=true;
}
if(ask==3){
btime=i;
flag=false;
}
}
for(int i=0;i<len;i++){
if(flag){
if(ti_me[i]>btime) cout<<s[i];
else cout<<(char) towlower(s[i]);
}
if(!flag){
if(ti_me[i]>btime) cout<<s[i];
else cout<<(char) toupper(s[i]);
}
}
return 0;
}