QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#660450 | #7786. Graft and Transplant | oumashu | WA | 0ms | 3608kb | C++17 | 410b | 2024-10-20 11:16:26 | 2024-10-20 11:16:26 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n;
int d[60];
int main()
{
ios::sync_with_stdio(false), cin.tie(0);
cin >> n;
for (int i = 1; i < n; i++) {
int u, v;
cin >> u >> v;
d[u]++, d[v]++;
}
int ans = n;
for(int i=1;i<=n;i++)if(d[i]==1)ans--;
if (ans & 1)
cout << "Bob";
else
cout << "Alice";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3520kb
input:
4 1 2 2 3 3 4
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
4 1 2 1 3 1 4
output:
Bob
result:
ok "Bob"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3600kb
input:
2 1 2
output:
Alice
result:
wrong answer 1st words differ - expected: 'Bob', found: 'Alice'