QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#692676#7786. Graft and Transplant123456zmy#WA 0ms3824kbC++17318b2024-10-31 14:54:002024-10-31 14:54:20

Judging History

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

  • [2024-10-31 14:54:20]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2024-10-31 14:54:00]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y,u=0;
    scanf("%d",&n);
    vector<int>d(n+1);
    for (int i=1;i<n;i++)scanf("%d %d",&x,&y),d[x]++,d[y]++;
    for (int i=1;i<=n;i++)d[i]--;
    for (int i=1;i<=n;i++)u+=(d[i]>0);
    if (u%2)printf("Bob\n");else printf("Alice\n");
}

詳細信息

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Alice

result:

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