QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#59363#2542. Destructive GameJayfeather233WA 10ms3772kbC++398b2022-10-29 13:57:452022-10-29 13:57:47

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-29 13:57:47]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3772kb
  • [2022-10-29 13:57:45]
  • 提交

answer

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int who_win=0;
	int n,a,b;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d%d",&a,&b);
		if(b&1){
			while(a){
				who_win^=(a&1);
				a/=b;
			}
		}else{
			a%=(b+1);
			if(a==b) who_win^=1;
			else who_win^=(a&1);
		}
	}
	if(who_win) printf("Alice");
	else printf("Bob");
	return 0;
}
/*
2
10 3
7 4
*/

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3556kb

input:

2
10 3
7 4

output:

Bob

result:

ok "Bob"

Test #2:

score: 0
Accepted
time: 2ms
memory: 3696kb

input:

16
903 5
246 38
884 12
752 10
200 17
483 6
828 27
473 21
983 35
953 36
363 35
101 3
34 23
199 8
134 2
932 28

output:

Alice

result:

ok "Alice"

Test #3:

score: 0
Accepted
time: 2ms
memory: 3760kb

input:

16
35 37
852 17
789 37
848 40
351 27
59 32
271 11
395 20
610 3
631 33
543 14
256 28
48 8
277 24
748 38
109 40

output:

Bob

result:

ok "Bob"

Test #4:

score: -100
Wrong Answer
time: 10ms
memory: 3772kb

input:

44093
679258466 979122815
364581740 877180543
305876472 336784414
310018487 420673582
812521202 704056164
60062693 286928662
588815435 723319078
981049166 824574842
897082766 884032874
247411373 200440521
84262500 432750630
189259452 301263664
197298622 387145248
723440748 760643145
238879131 483683...

output:

Alice

result:

wrong answer 1st words differ - expected: 'Bob', found: 'Alice'