UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#215158#2484. 取石子erican10080ms1204kbC++111.5kb2024-11-26 21:16:462024-11-26 23:05:20

answer

/*  Erica N  */
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define int long long
#define ull unsigned long long
#define pii pair<int, int>
#define ps second
#define pf first
#define itn int
#define rd read()
int read(){
    int xx = 0, ff = 1;char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-')ff = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9')xx = xx * 10 + (ch - '0'), ch = getchar();
    return xx * ff;
}
// void write(int out) {
// 	if (out < 0)
// 		putchar('-'), out = -out;
// 	if (out > 9)
// 		write(out / 10);
// 	putchar(out % 10 + '0');
// }
#define cdbg(x...) do { cerr << #x << " -> "; err(x); } while (0)
void err() { cerr << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cerr << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }


const int N = 1e6 + 5;
const int INF = 1e18;
const int M = 1e7;
const int MOD = 1e9 + 7;

int a[N];

void solve(){
    int n=rd;

    int mn=INF,cnt=0;
    for(itn i=1;i<=n;i++){
        a[i]=rd;
        mn=min(mn,a[i]);
    }

    for(int i=1;i<=n;i++){
        if(a[i]==mn)cnt++;
    }

    if(cnt>n/2)puts("Bob");
    else puts("Alice");
}

signed main() {
    // freopen(".in","r",stdin);
    // freopen(".out","w",stdout);

    int T=rd;
    while(T--){
        solve();
    }



}

Details

小提示:点击横条可展开更详细的信息

Test #1:

score: 10
Accepted
time: 0ms
memory: 1124kb

input:

100
2
799452644 758660838
2
44905205 44905205
2
816266571 816266571
2
967602921 867503349
2
23885824...

output:

Alice
Bob
Bob
Alice
Alice
Alice
Bob
Alice
Bob
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Alice
Alic...

result:

ok 100 lines

Test #2:

score: 10
Accepted
time: 0ms
memory: 1128kb

input:

100
2
765485632 746332502
2
423771645 747641819
2
319475431 319475431
2
279774682 905874006
2
180899...

output:

Alice
Alice
Bob
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Bob
Bob
Bob
Bob
Alice
Bob
Alic...

result:

ok 100 lines

Test #3:

score: 10
Accepted
time: 0ms
memory: 1124kb

input:

100
2
559735557 559735557
2
941938857 941938857
2
748932928 954375869
2
415240455 415240455
2
266198...

output:

Bob
Bob
Alice
Bob
Alice
Alice
Alice
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Bob
...

result:

ok 100 lines

Test #4:

score: 10
Accepted
time: 0ms
memory: 1124kb

input:

100
1
312552923
3
366651438 398802428 51929556
9
706947288 884189505 572119470 29701839 512541044 29...

output:

Bob
Alice
Alice
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Alice
...

result:

ok 100 lines

Test #5:

score: 10
Accepted
time: 0ms
memory: 1128kb

input:

100
1
857380246
5
875540130 930489851 255919485 693830960 452775050
7
114108229 15438506 151095413 3...

output:

Bob
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Bob
Alice
Bob
Alice
Alice
Alice
Alice
Alic...

result:

ok 100 lines

Test #6:

score: 10
Accepted
time: 0ms
memory: 1128kb

input:

100
10
862378379 735095751 713660721 764385945 714007027 741621912 713660721 816930010 901821108 819...

output:

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

result:

ok 100 lines

Test #7:

score: 10
Accepted
time: 0ms
memory: 1128kb

input:

100
23
440277079 677838331 708797502 393217330 452204047 868185165 403053827 790696903 10048405 5122...

output:

Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alice
Alic...

result:

ok 100 lines

Test #8:

score: 10
Accepted
time: 0ms
memory: 1128kb

input:

100
50
390724858 390724858 390724858 390724858 390724858 390724858 390724858 390724858 390724858 390...

output:

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

result:

ok 100 lines

Test #9:

score: 10
Accepted
time: 0ms
memory: 1124kb

input:

100
50
994069762 994203646 995123108 993758482 996962456 993758482 994477101 997566475 997931936 998...

output:

Alice
Alice
Bob
Bob
Alice
Bob
Alice
Bob
Alice
Bob
Alice
Alice
Alice
Bob
Bob
Alice
Bob
Bob
Bob
Alice
...

result:

ok 100 lines

Test #10:

score: 10
Accepted
time: 80ms
memory: 1204kb

input:

100
10000
819454462 880853819 893226970 944823516 926418416 918957936 935587136 819454462 856936256 ...

output:

Alice
Bob
Bob
Bob
Bob
Bob
Bob
Bob
Alice
Bob
Bob
Alice
Alice
Bob
Alice
Bob
Bob
Bob
Bob
Bob
Alice
Bob
...

result:

ok 100 lines

Extra Test:

score: 0
Extra Test Passed