QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#252063 | #7786. Graft and Transplant | Lynkcat# | WA | 0ms | 3508kb | C++20 | 855b | 2023-11-15 15:20:16 | 2023-11-15 15:20:16 |
Judging History
answer
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
// #define int ll
// #define N
using namespace std;
int du[55];
void BellaKira()
{
int n;
cin>>n;
for (int i=1;i<n;i++)
{
int x,y;
cin>>x>>y;
du[x]++,du[y]++;
}
int tot=0;
for (int i=1;i<=n;i++) tot+=(du[i]==1);
if ((n-1)%2==tot%2) cout<<"Bob\n";
else cout<<"Alice\n";
}
signed main()
{
IOS;
cin.tie(0);
int T=1;
while (T--)
{
BellaKira();
}
}
/*list:
1.mod 998244353 or 1e9+7 or ???
2.N
3.duipai shuju xingtai duoyidian
...
*/
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3392kb
input:
4 1 2 2 3 3 4
output:
Alice
result:
ok "Alice"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3372kb
input:
4 1 2 1 3 1 4
output:
Bob
result:
ok "Bob"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3508kb
input:
2 1 2
output:
Alice
result:
wrong answer 1st words differ - expected: 'Bob', found: 'Alice'