QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#407445#8295. Binary TreelonlynessAC ✓2ms3652kbC++23613b2024-05-08 18:24:572024-05-08 18:24:58

Judging History

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

  • [2024-05-08 18:24:58]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3652kb
  • [2024-05-08 18:24:57]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cmath>
using namespace std;
#define int long long 
#define endl "\n"
const int N = 3e5+10;
int n,m,k;
typedef pair<int,int> PII;
void solve()
{
    cin>>n;
    for(int i = 0;i < n-1;i ++)
    {
        int a,b;
        cin>>a>>b;
    }
    if(n%2)cout<<"Alice"<<endl;
    else cout<<"Bob"<<endl;
}
signed  main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
   int t=1;
   cin>>t;
   while(t--)
   {
       solve();
   }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

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

input:

1
5
1 2
1 3
3 4
3 5

output:

Alice

result:

ok single line: 'Alice'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3604kb

input:

1001
1
14
1 2
1 8
2 3
2 4
3 6
4 5
4 9
5 7
5 12
6 13
7 11
8 14
9 10
42
1 2
1 6
2 3
2 5
3 4
3 7
4 10
5 12
6 9
6 24
7 8
7 20
8 13
8 34
9 11
9 14
10 16
10 22
11 18
11 40
12 39
13 15
14 19
15 17
15 21
16 31
17 26
18 32
19 29
19 35
20 38
21 25
22 23
23 27
24 30
25 28
30 42
31 33
33 36
33 41
34 37
27
1 2
1...

output:

Alice
Bob
Bob
Alice
Bob
Bob
Bob
Alice
Alice
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Bob
Alice
Bob
Bob
Bob
Alice
Bob
Alice
Bob
Bob
Alice
Alice
Bob
Bob
Bob
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Bob
Bob
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Bob
Bob
Bob
Bob
Alice
Bob
Alice
Bob
Bob
Bob
Bob
Al...

result:

ok 1001 lines

Extra Test:

score: 0
Extra Test Passed