QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325180#7786. Graft and TransplantZhouShang#WA 0ms3600kbC++17223b2024-02-11 05:29:402024-02-11 05:29:41

Judging History

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

  • [2024-02-11 05:29:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3600kb
  • [2024-02-11 05:29:40]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,x,y,d[1<<20];
int main(){
	cin>>n,m=n-1;
	for(int i=1;i<n;i++)
		cin>>x>>y,d[x]++,d[y]++;
	for(int i=1;i<=n;i++)
		m-=d[i]==1;
	cout<<(m&1?"Alice\n":"Bob\n");
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3600kb

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3580kb

input:

2
1 2

output:

Alice

result:

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