QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#282909 | #7786. Graft and Transplant | Loging# | WA | 0ms | 1500kb | C++20 | 607b | 2023-12-13 14:17:09 | 2023-12-13 14:17:10 |
Judging History
answer
#include<cstdio>
//struct E{
// int a,b;
//}edge[M<<1];
//int tot,head[M];
//void Addedge(int a,int b){
// edge[++tot].to=b;
// edge[tot].nx=head[a];
// head[a]=tot;
//}
#define M 1005
int Deg[M];
//void dfs(int now){
// for(int i=head[now];i;i=edge[i].nx){
// int nxt=edge[i].to;
// if(nxt==fa[now])continue;
// fa[nxt]=now;
// }
//}
int main(){
int n;
scanf("%d",&n);
for(int i=1;i<n;i++){
int a,b;
scanf("%d%d",&a,&b);
Deg[a]++;Deg[b]++;
}
int cnt=n;
for(int i=1;i<=n;i++){
if(Deg[i]==1)cnt--;
}
if(cnt&1)puts("Bob");
else puts("Alice");
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 1500kb
input:
4 1 2 2 3 3 4
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 1440kb
input:
4 1 2 1 3 1 4
output:
Bob
result:
ok "Bob"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 1400kb
input:
2 1 2
output:
Alice
result:
wrong answer 1st words differ - expected: 'Bob', found: 'Alice'