QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#685493#7786. Graft and TransplantHanZhongBalls#WA 0ms3812kbC++14531b2024-10-28 19:43:132024-10-28 19:43:14

Judging History

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

  • [2024-10-28 19:43:14]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3812kb
  • [2024-10-28 19:43:13]
  • 提交

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'