跳到正文

个人记录

10/29 12nd.CPS-J

NothingIsImpossible约 6 分钟
原文
文章信息与版本

文章信息

发布
2026年10月29日
收录
2026年11月25日
更新
2026年11月25日
篇幅
约 6 分钟

版本

  1. v1当前
II
problemproblem

image.png image.png

AC codecode
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("keynegative.in","r",stdin);
	freopen("keynegative.out","w",stdout);
	string s;
	cin>>s;
	if(s[0]=='0') cout<<s;
	else {cout<<1;for(char c:s.substr(1,s.length()-1)) cout<<(c=='0'?'1':'0');}
	return 0;
}
WRONG codecode

NOTHING

causecause ofof deathdeath

NOTHING

IIII
problemproblem

image.png image.png image.png image.png

AC codecode
C++
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	freopen("conveyorchecksum.in","r",stdin);
	freopen("conveyorchecksum.out","w",stdout);
	int n,m,q,sum=0;
	cin>>n>>m;
	vector<int> a(2*n),b(2*n);
	for(int i=1;i<=n;i++){
		cin>>a[i];
		a[i+n]=a[i];
		q=a[i];
		q^=a[i-1];
		sum+=q;
	}
	int id=0;
	q=a[1];
	q^=a[n];
	cout<<sum-q<<' ';	
	for(int i=1;i<=m;i++){
		int x;
		cin>>x;
		id+=x;
		id%=n;
		if(id==0) q=a[1]^a[n];
		else {q=a[n-id];q^=a[n-id+1];}
		cout<<sum-q<<' '<<endl;	
	}
	return 0;
}
 
WA codecode

#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ freopen(“conveyorchecksum.in”,“r”,stdin); freopen(“conveyorchecksum.out”,“w”,stdout); int n,m,q,sum=0; cin>>n>>m; vector<int> a(n+1),b(m+1); for(int i=1;i<=n;i++){ cin>>a[i]; if(i!=1){ q=a[i]; q^=a[i-1]; sum+=q; //cout<<a[i-1]<<’ ‘<<a[i]<<’ ‘<<q<<endl; } } sum+=a[1]^a[n]; int id=0; q=a[1]; q^=a[n]; // cout<<a[n]<<’ ‘<<a[1]<<’ ‘<<q<<endl; cout<<sum-q<<’ ’; for(int i=1;i<=m;i++){ int x; cin>>x; id+=x; id%=n; if(id==0) q=a[1]^a[n]; else {q=a[n-id];q^=a[n-id+1];} cout<<sum-q<<’ ‘<<endl; } return 0; } /*5 5 10 13 2 5 6 4 1 5 1 2 */

causecause ofof deathdeath

环状计算错误

IIIIII
problemproblem

image.png image.png image.png image.png

AC codecode
C++
WA codecode
TLE code1code1 0′0'
C++
WA code2code2 90′90'
C++
causecause ofof deathdeath

1

IVIV
problemproblem
AC codecode
WA codecode (′)(')
C++
causecause ofof deathdeath

原文