QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#404159#2541. Coins and BoxesZxc200611#WA 0ms3576kbC++14338b2024-05-03 14:25:302024-05-03 14:25:31

Judging History

你现在查看的是最新测评结果

  • [2024-05-03 14:25:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3576kb
  • [2024-05-03 14:25:30]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int SG(int n,int b)
{
	if(b%2==1)
		return n%2;
	if(n%(b+1)==b)
		return 2;
	return (n%(b+1))%2;
}
int n;
int main()
{
	cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		int a,b;
		cin>>a>>b;
		cout<<SG(a,b)<<endl;
		ans^=SG(a,b);
	}
	cout<<(ans==0?"Bob":"Alice")<<endl;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3576kb

input:

4
1 6 7 12
3 5 10 11

output:

1
1
1
0
Alice

result:

wrong answer expected '21', found '1'