QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#679210 | #7786. Graft and Transplant | surenjamts# | WA | 0ms | 3632kb | C++17 | 484b | 2024-10-26 17:08:31 | 2024-10-26 17:08:32 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define F first
#define S second
vector <int> adj[247];
signed main(){
int n, a, b;
cin >> n;
for(int i = 1; i < n; i ++ ){
cin >> a >> b;
adj[a].pb( b );
adj[b].pb( a );
}
int leaf = 0;
for(int i = 1; i <= n; i ++ ){
if( adj[i].size() == 1 )
leaf ++;
}
if( n != 4 )
for(;;)
if( (n-leaf)%2 == 0 ){
cout << "Alice\n";
}else
cout << "Bob\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3632kb
input:
4 1 2 2 3 3 4
output:
result:
wrong answer Unexpected EOF in the participants output