QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#661744#8145. GameXcc1314WA 1ms3608kbC++171.6kb2024-10-20 17:53:482024-10-20 17:53:53

Judging History

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

  • [2024-10-20 17:53:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3608kb
  • [2024-10-20 17:53:48]
  • 提交

answer

//#pragma GCC optimize(1)
//#pragma GCC optimize(2)
//#pragma GCC optimize(3,"Ofast","inline")

#include<bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define int long long
#define ll __int128
#define double long double
#define lowbit(x) (x&(-x))
#define log(x) (31^__builtin_clz(x))
#define endl '\n'

typedef pair<int,int>PII;
typedef pair<double,double>PDD;
typedef tuple<double,double,double>TDDD;
typedef tuple<int,int,int>TIII;

const int N = 2e5+10;
const int mod = 1e9+7 , P = 131;
const double PI = acos(-1);
const double eps = 1e-8;

mt19937_64 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());//随机数


int read(){
    char c=0;
    int res=0;
    int f=1;
    while(!(c>='0'&&c<='9')){
        if(c=='-'){
            f=-f;
        }
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        res=(res<<3)+(res<<1)+c-'0';
        c=getchar();
    }
    return res*f;
}

void write(int x){
    if(x<0){putchar('-');x=-x;}
    if(x>9) write(x/10);
    putchar(char(x%10+'0'));
}

int n,k;
int w[N];

void solve(){
    cin>>n>>k;

    unordered_map<int,int>S;
    for(int i=1;i<=n;i++)cin>>w[i],S[w[i]]=1;

    sort(w+1,w+1+n);

    int x=0;
    while(S.count(x)){
        x++;
    }

    if(x&1){
        cout<<"Alice"<<endl;
    }else{
        cout<<"Bob"<<endl;
    }

    // cout<<x<<endl;

}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int T;
    cin>>T;
    while(T--)solve();

#ifdef GREENQWQ
    cerr<<fixed<<setprecision(10)<<1.0*clock()/CLOCKS_PER_SEC<<endl;
#endif
    return 0;
}

详细

Test #1:

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

input:

5
14 5
7 13 1 6 14 2 16 17 18 19 34 36 20 23
13 5
8 10 3 13 14 15 16 17 18 19 20 36 38
14 5
14 20 12 6 0 16 8 11 9 17 13 3 5 19
14 5
15 7 13 3 1 17 16 14 0 12 4 10 22 53
14 5
7 3 4 0 14 15 16 17 18 19 20 21 22 23

output:

Bob
Bob
Alice
Bob
Alice

result:

ok 5 tokens

Test #2:

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

input:

10
19 10
23 1 15 29 13 4 10 8 26 16 30 46 60 43 51 56 31 59 53
19 9
3 7 13 23 1 21 25 8 10 22 32 2 26 20 4 41 52 51 57
19 10
18 26 12 10 2 5 17 21 15 29 30 31 32 33 34 35 36 37 38
20 9
32 16 26 0 18 22 2 34 20 23 31 9 29 17 1 33 11 35 36 61
20 9
34 8 28 14 22 6 10 36 32 20 1 21 25 3 27 23 11 5 19 37...

output:

Bob
Bob
Bob
Alice
Bob
Bob
Bob
Bob
Bob
Bob

result:

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