QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#280067#7786. Graft and Transplantucup-team1525#WA 0ms3824kbC++20346b2023-12-09 13:42:042023-12-09 13:42:05

Judging History

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

  • [2023-12-09 13:42:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2023-12-09 13:42:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int n,a[N],ans;
int main()
{
    scanf("%d",&n);
    for (int i=1,u,v;i<n;++i)
    {
        scanf("%d%d",&u,&v);
        ++a[u];
        ++a[v];
    }
    for (int i=1;i<=n;++i)
        if (a[i]!=1)
            ++ans;
    puts(ans%2?"Bob":"Alice");
    return 0;
}

詳細信息

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Alice

result:

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