QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#303201 | #7786. Graft and Transplant | Delay_for_five_minutes | WA | 1ms | 3448kb | C++20 | 421b | 2024-01-11 21:08:09 | 2024-01-11 21:08:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define all(x) x.begin(),x.end()
const int N=53;
int n,x,y,d[N];
vector<int> e[N];
int main(){
ios::sync_with_stdio(0);cin.tie(0);
cin>>n;
for(int i=1;i<n;++i){
cin>>x>>y,++d[x],++d[y];
}
int m=0;
for(int i=1;i<=n;++i)m=max(m,d[i]);
cout<<((n-m&1)?"Bob":"Alice")<<'\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3436kb
input:
4 1 2 2 3 3 4
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
4 1 2 1 3 1 4
output:
Bob
result:
ok "Bob"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
2 1 2
output:
Bob
result:
ok "Bob"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
3 1 2 1 3
output:
Bob
result:
ok "Bob"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
5 2 1 2 3 3 4 1 5
output:
Bob
result:
ok "Bob"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
6 4 3 4 2 4 5 4 1 4 6
output:
Bob
result:
ok "Bob"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
7 2 4 4 1 1 5 5 3 3 7 7 6
output:
Bob
result:
ok "Bob"
Test #8:
score: -100
Wrong Answer
time: 1ms
memory: 3444kb
input:
8 2 3 3 1 3 6 7 6 6 5 7 8 6 4
output:
Alice
result:
wrong answer 1st words differ - expected: 'Bob', found: 'Alice'