UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#197309#3429. 双人博弈Ycmake10080ms2000kbC++11325b2023-11-11 08:46:292023-11-11 13:00:59

answer

#include<bits/stdc++.h>
using namespace std;

const int N=1e5+5;
int n,a[N],s[N],t; 

int main(){
	cin>>n;
	for(int i=1;i<=n;i++) scanf("%d",a+i);
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++) if(a[t]==a[i]) s[t]++,n--; else a[++t]=a[i],s[t]=1;
	for(int i=1;i<=t;i++) if(s[t]&1) cout<<"Alice",exit(0);
	cout<<"Bob";
}

详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 0ms
memory: 1212kb

input:

2
1 2

output:

Alice

result:

ok "Alice"

Test #2:

score: 0
Accepted
time: 0ms
memory: 1212kb

input:

2
2 2

output:

Bob

result:

ok "Bob"

Test #3:

score: 0
Accepted
time: 0ms
memory: 1212kb

input:

2
2 4

output:

Alice

result:

ok "Alice"

Subtask #2:

score: 20
Accepted

Test #4:

score: 20
Accepted
time: 11ms
memory: 1996kb

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ...

output:

Alice

result:

ok "Alice"

Test #5:

score: 0
Accepted
time: 13ms
memory: 2000kb

input:

100000
4852 5063 39780 40806 48265 81218 96735 115329 117809 123175 125946 134012 138499 147184 1516...

output:

Alice

result:

ok "Alice"

Subtask #3:

score: 20
Accepted

Test #6:

score: 20
Accepted
time: 0ms
memory: 1208kb

input:

10
1 4 4 1 6 6 4 6 6 4

output:

Bob

result:

ok "Bob"

Test #7:

score: 0
Accepted
time: 0ms
memory: 1208kb

input:

10
1 4 4 1 6 6 4 6 6 3

output:

Alice

result:

ok "Alice"

Subtask #4:

score: 40
Accepted

Test #8:

score: 40
Accepted
time: 23ms
memory: 1740kb

input:

100000
816970941 205006355 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...

output:

Bob

result:

ok "Bob"

Test #9:

score: 0
Accepted
time: 18ms
memory: 2000kb

input:

100000
892035194 54971177 269410793 465533634 639684700 213114683 443540512 301413525 277593864 2548...

output:

Alice

result:

ok "Alice"

Test #10:

score: 0
Accepted
time: 15ms
memory: 1744kb

input:

100000
816970941 205006354 945030420 872718974 544433065 309498648 572338912 816155137 380139690 444...

output:

Alice

result:

ok "Alice"

Extra Test:

score: 0
Extra Test Passed