QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#685493 | #7786. Graft and Transplant | HanZhongBalls# | WA | 0ms | 3812kb | C++14 | 531b | 2024-10-28 19:43:13 | 2024-10-28 19:43:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
#define N 50005
#define eps 1e-10
#define F first
#define S second
#define INF 0x3f3f3f3f
#define mod 1000000007
int n,d[N];
int main(){
int u,v,cnt=0;
scanf("%d",&n);
for(int i=1;i<n;++i){
scanf("%d%d",&u,&v);
++d[u];++d[v];
}
for(int i=1;i<=n;++i){
if(d[i]>1) ++cnt;
}
if(cnt&1){
puts("Bob");
}else{
puts("Alice");
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3812kb
input:
4 1 2 2 3 3 4
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
4 1 2 1 3 1 4
output:
Bob
result:
ok "Bob"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3764kb
input:
2 1 2
output:
Alice
result:
wrong answer 1st words differ - expected: 'Bob', found: 'Alice'