QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#281311 | #7786. Graft and Transplant | ucup-team2000# | WA | 1ms | 3544kb | C++20 | 707b | 2023-12-10 02:29:34 | 2023-12-10 02:29:35 |
Judging History
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'