QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#593000#7786. Graft and TransplantztttttWA 0ms3696kbC++14362b2024-09-27 11:01:312024-09-27 11:01:31

Judging History

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

  • [2024-09-27 11:01:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3696kb
  • [2024-09-27 11:01:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int cnt[60]; 
int main(){
	int n;
	cin>>n;
	for(int i=1;i<n;i++){
		int a,b;
		cin>>a>>b;
		cnt[a]++;
		cnt[b]++;
	}
	int z=0;
	for(int i=1;i<n;i++){
		if(cnt[i]>1){
			z++;
		}
	}
	if(z==0){
		puts("Bob");
	}else{
		if(z%2){
			puts("Bob");
		}else{
			puts("Alice");
		}
	} 
	return 0;
}

詳細信息

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Bob

result:

ok "Bob"

Test #4:

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

input:

3
1 2
1 3

output:

Bob

result:

ok "Bob"

Test #5:

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

input:

5
2 1
2 3
3 4
1 5

output:

Bob

result:

ok "Bob"

Test #6:

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

input:

6
4 3
4 2
4 5
4 1
4 6

output:

Bob

result:

ok "Bob"

Test #7:

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

input:

7
2 4
4 1
1 5
5 3
3 7
7 6

output:

Alice

result:

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