QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#301883#7786. Graft and Transplantzzuqy#WA 1ms3564kbC++14657b2024-01-10 13:47:162024-01-10 13:47:17

Judging History

你现在查看的是最新测评结果

  • [2024-01-10 13:47:17]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3564kb
  • [2024-01-10 13:47:16]
  • 提交

answer

#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<deque>
#define ll long long
#define mod 998244353
#define sc(A) scanf("%d",&A)
#define rep(A,B,C) for(int C=A;C<=B;++C)
#define fep(A,B,C) for(int C=A;C>=B;--C)
#define put(x) printf("%d\n",x)
#define db double
using namespace std;
const int MAXN=510,maxn=77;
int n,m,x,maxx=62,top;
int ru[MAXN],ans;
signed main() 
{
	//freopen("1.in","r",stdin);
	sc(n);
	rep(2,n,i)
	{
		int x,y;
		sc(x);sc(y);
		++ru[x];++ru[y];
	}
	rep(1,n,i)if(ru[i]!=1)++ans;
	//put(ans);
	puts(ans%2==1?"Bob":"Alice");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3420kb

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3564kb

input:

2
1 2

output:

Alice

result:

wrong answer 1st words differ - expected: 'Bob', found: 'Alice'