#7~#10黑了,求助!!!
查看原帖
#7~#10黑了,求助!!!
819278
48WangYanJi楼主2023/4/21 21:25

直接套函数做的,然而有四个点黑了

小黑子真下头...

代码:```cpp #include<bits/stdc++.h>

using namespace std;

int main(){

int T;
cin>>T;
while(T>0){
	int n,q;
	cin>>n>>q;
	string s,t;
	cin>>s>>t;
	if(s.compare(t)==0){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	while(q>0){
		int o,p;
		string c;
		cin>>o>>p>>c;
		if(o==0){
			s.replace(p-1,1,c);
		}
		if(o==1){
			t.replace(p-1,1,c);
		}
		if(s.compare(t)==0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
		q--;
	}
	T--;
}
return 0;

}

2023/4/21 21:25
加载中...