wa#求hack#玄关
  • 板块学术版
  • 楼主Winalways
  • 当前回复5
  • 已保存回复5
  • 发布时间2024/8/28 19:40
  • 上次更新2024/8/28 21:35:57
查看原帖
wa#求hack#玄关
1011587
Winalways楼主2024/8/28 19:40

题目

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;
}
2024/8/28 19:40
加载中...