QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#593000 | #7786. Graft and Transplant | zttttt | WA | 0ms | 3696kb | C++14 | 362b | 2024-09-27 11:01:31 | 2024-09-27 11:01:31 |
Judging History
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'