QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#757545#7786. Graft and TransplantteamJZWWA 0ms3644kbC++17280b2024-11-17 10:09:462024-11-17 10:09:46

Judging History

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

  • [2024-11-17 10:09:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-11-17 10:09:46]
  • 提交

answer

#include<bits/stdc++.h>
#define N 100
using namespace std;
int n,u,v,cnt[N],ans;
int main(){
	cin>>n;
	for(int i=1;i<=n-1;i++){
		cin>>u>>v;
		cnt[u]++,cnt[v]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]>=2)ans++;
	if(ans%2==1)cout<<"Bob";
	else cout<<"Alice";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Alice

result:

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