QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#281311#7786. Graft and Transplantucup-team2000#WA 1ms3544kbC++20707b2023-12-10 02:29:342023-12-10 02:29:35

Judging History

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

  • [2023-12-10 02:29:35]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3544kb
  • [2023-12-10 02:29:34]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define lep(i,a,b) for(int i = (a); i <= (b); i++)
#define rep(i,b,a) for(int i = (b); i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second

void submit(string ans) {
    cout << ans << "\n";
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> deg(n+1);
    lep(i,1,n-1) {
        int u,v;
        cin >> u >> v;
        deg[u]++, deg[v]++;
    }
    int numg = 0;
    lep(i,1,n) numg += (deg[i] > 1);
    if (numg&1) {
        submit("Bob");
    } else {
        submit("Alice");
    }
}

详细

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Alice

result:

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