QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#609719#7786. Graft and Transplantwzxtsl#WA 1ms3692kbC++23832b2024-10-04 13:47:262024-10-04 13:47:27

Judging History

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

  • [2024-10-04 13:47:27]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3692kb
  • [2024-10-04 13:47:26]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define For(i,j,k) for (int i=(j);i<=(k);i++)
#define rof(i,j,k) for (int i=(j);i>=(k);i--)
#define ull unsigned long long
#define lowbit(x) ((x)&(-(x)))
#define PII pair<int,int>
#define int long long
#define endl "\n"
#define ls rt<<1
#define rs rt<<1|1
typedef long long ll;
const int mod = 998244353;
const double eps = 1e-9;
const int N=2e6+7;
int n,m;
void solve(){
	cin>>n;
    int a[n+1]={0};
    int sor[n+1]={0};
    for(int i=1;i<=n;i++){
        int u,v;
        cin>>u>>v;
        a[u]++;
        a[v]++;

    }
    sort(a+1,a+1+n);
    if((n-a[n])%2==0)cout<<"Bob"<<endl;
    else cout<<"Alice"<<endl;
	
}
signed main(){
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
1 2
2 3
3 4

output:

Alice

result:

ok "Alice"

Test #2:

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

input:

4
1 2
1 3
1 4

output:

Bob

result:

ok "Bob"

Test #3:

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

input:

2
1 2

output:

Bob

result:

ok "Bob"

Test #4:

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

input:

3
1 2
1 3

output:

Bob

result:

ok "Bob"

Test #5:

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

input:

5
2 1
2 3
3 4
1 5

output:

Bob

result:

ok "Bob"

Test #6:

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

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: 3688kb

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: 3692kb

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'