QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#627630#8145. GameXSatonRE 3ms6836kbC++201.2kb2024-10-10 16:32:132024-10-10 16:32:14

Judging History

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

  • [2024-10-10 16:32:14]
  • 评测
  • 测评结果:RE
  • 用时:3ms
  • 内存:6836kb
  • [2024-10-10 16:32:13]
  • 提交

answer

///by Saton.
#include<bits/stdc++.h>
#define PI acos(-1)
#define fi first
#define se second 
#define sz(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define int long long
#define ll __int128
#define DD double double
#define LD long double
#define rep(i,a,b) for(int i = (a);i <= (b);i ++)
#define lep(i,a,b) for(int i = (a);i >= (b);i --)
#define FLUSH fflush(stdout)
using namespace std;
typedef pair<int,int> PII;
const int N = 4e5 + 10,mod = 998244353;
int n,m,k;
int a[N];

void solve() {
    memset(a,0,sizeof(a));
    cin >> n >> k;
    rep(i,1,n) {
        int x;
        cin >> x;
        a[x] = 1;
    }
    for(int i = 0,j = k;j > 0;i ++) {
        if(i%2 && !a[i]) {
            a[i] = 1;
            j --;
        }
    }
    for(int i = 0,j = k;j > 0;i ++) {
        if(i%2==0 && !a[i]) {
            a[i] = 1;
            j --;
        }
    }    
    int mex = 0;
    while(a[mex]) mex ++;
    
    // cout << mex << '\n';
    cout << (mex%2==0 ? "Alice" : "Bob") << '\n';
} 

signed main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    while(T --) {
        solve();
    }
    // solve();
       
    return 0;
}  
/*   /\_/\
*   (= ._.)
*   / >  \>
*/

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 6780kb

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: 0
Accepted
time: 2ms
memory: 6700kb

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:

Alice
Bob
Bob
Bob
Alice
Alice
Alice
Bob
Alice
Bob

result:

ok 10 tokens

Test #3:

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

input:

10
195 181
40 276 550 44 306 438 532 72 166 476 88 190 120 296 466 366 86 106 2 162 436 442 372 448 12 184 552 102 270 68 416 364 230 154 492 548 198 410 456 148 524 232 302 460 244 16 214 478 152 146 288 468 122 374 76 332 358 344 512 64 450 444 238 494 336 530 334 426 414 502 14 156 212 536 474 30...

output:

Alice
Alice
Alice
Alice
Bob
Bob
Alice
Alice
Alice
Bob

result:

ok 10 tokens

Test #4:

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

input:

10
500 465
1406 104 1354 796 572 500 1326 970 1040 974 778 986 1120 1372 666 962 68 266 1014 502 254 1064 400 584 642 388 1030 872 774 1066 198 1168 1240 752 1308 412 664 1192 1232 148 292 924 1118 116 242 1190 800 944 700 842 72 1054 714 1164 514 976 1058 912 396 682 744 1082 980 334 206 1104 994 1...

output:

Bob
Bob
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Alice

result:

ok 10 tokens

Test #5:

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

input:

10
925 959
1983 2781 643 331 2735 1293 1637 2221 2187 2389 39 2611 555 1627 2669 231 1721 77 1179 1825 1329 485 1935 2481 583 1531 903 1851 759 1869 891 365 731 1471 2089 1575 2443 2045 2311 1043 251 1173 2019 1647 399 2729 1547 2553 1827 2393 2401 2751 867 1259 1373 2483 1867 2529 733 1209 2715 225...

output:

Alice
Bob
Alice
Alice
Bob
Alice
Bob
Alice
Alice
Bob

result:

ok 10 tokens

Test #6:

score: 0
Accepted
time: 3ms
memory: 6772kb

input:

10
1821 1942
1202 1872 548 5206 3088 4998 1770 624 2498 896 3928 2162 3686 3420 30 4982 662 5120 1444 2924 4976 5370 2672 4938 2432 1250 2994 4396 5660 450 3052 78 2834 4974 4640 4306 2352 4092 2832 992 1778 3822 3122 4126 1146 752 1428 3706 2740 4936 3974 2158 4118 2856 3890 5624 4360 710 4 1826 49...

output:

Alice
Alice
Alice
Alice
Bob
Alice
Alice
Alice
Alice
Alice

result:

ok 10 tokens

Test #7:

score: -100
Runtime Error

input:

1
192100 192702
216111 222521 59395 31279 257483 405633 510473 46917 336583 12999 537951 383933 32827 71369 250671 27197 516283 425151 465401 252951 507197 416829 350375 358959 45643 195101 495005 336019 330053 314913 516225 110063 413377 470139 280889 402103 453523 421079 375611 451359 504401 51892...

output:


result: