QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#668564 | #8726. Magic Show | _Alexande_ | 0 | 98ms | 2284kb | C++14 | 4.5kb | 2024-10-23 15:00:17 | 2024-10-23 15:00:26 |
Judging History
Alice
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
mt19937 rnd ( 191981 );
const int N = 5005;
int n = 4980;
int rd[N], tmp[N];
vector < pair < int, int > > e;
vector < int > rnd_2 ( int lim ) {
for ( int i = 1; i <= lim; i ++ ) {
tmp[i] = i;
}
for ( int i = 1; i <= lim; i ++ ) {
swap ( tmp[i], tmp[rnd () % lim + 1] );
}
vector < int > res;
for ( int i = 1; i <= 2; i ++ ) {
res.push_back ( tmp[i] );
}
return res;
}
vector < pair < int, int > > Alice () {
long long x = setN ( 4980 );
for ( int i = 1; i <= n; i ++ ) {
rd[i] = i;
}
for ( int i = 1; i <= n; i ++ ) {
swap ( rd[i], rd[rnd () % n + 1] );
}
for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
for ( int k = i; k <= i + 80 - 1; k ++ ) {
vector < int > tmp = rnd_2 ( i - 1 );
if ( ( x >> ( long long ) j ) & 1ll ) {
e.push_back ( { rd[k], rd[tmp[0]] } );
// cout << rd[k] << " " << rd[tmp[0]] << '\n';
}
else {
e.push_back ( { rd[k], rd[tmp[1]] } );
}
}
// cout << '\n';
}
for ( int i = 2; i <= 100; i ++ ) {
e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
}
random_shuffle ( e.begin (), e.end () );
return e;
}
/*
4757 1957
4421 2446
1320 3971
3657 2747
4395 3415
2167 1238
2677 923
3749 1403
589 3085
2200 611
2783 923
2044 1152
2327 4256
1264 4224
3960 4879
251 242
446 2720
1677 3306
4040 4099
1580 1383
402 121
972 3274
533 2446
840 1604
604 22
942 2747
4698 3971
115 1499
4094 3059
283 4472
847 2446
3676 3402
1491 1499
2974 2287
2879 1002
2461 2446
849 1630
2570 574
1841 4656
2433 4099
4575 2107
1882 1238
2768 923
603 1002
4627 1499
3665 3085
3220 4077
2242 1781
3286 4924
1111 3028
316 611
2810 2832
146 4529
1662 4099
3800 591
4043 4224
1899 2950
35 4472
3637 591
4929 2107
2437 1152
2369 3585
969 3274
931 923
1300 592
262 2266
38 4396
664 2107
465 2522
1411 2731
3308 4077
1664 984
4801 2088
976 4224
207 2522
4606 4924
1307 3475
3154 4099
16 1002
1059 2720
2472 3971
1907 262
226 984
1405 242
3731 2495
2866 1152
1033 452
193 2832
4126 1755
3636 3220
427 242
4599 1307
3570 3971
3219 3585
319 1580
4561 4099
902 2974
328 2950
1352 1499
2491 591
288 771
4139 1459
322 709
868 849
1196 2266
4823 589
3885 2522
2644 2974
4242 574
2099 38
3792 3633
3626 2495
4948 2879
130 1152
2873 3960
4532 4656
4168 1238
4538 603
2536 1085
3584 2287
2300 4575
508 3085
2053 604
3367 976
912 972
80 1152
1988 3308
2822 1300
4145 2731
4505 3402
3442 2720
13 1403
3524 2044
1953 976
434 2747
1345 2621
2301 4043
965 4395
4524 2287
2791 96
37 1459
2295 283
2230 4924
4123 603
394 1383
4756 1781
879 4803
799 3220
324 4256
2148 1059
542 916
1513 4094
881 3770
1053 452
1014 591
2065 4879
650 4224
1775 4929
3918 1307
4790 283
*/
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
mt19937 rndd ( 191981 );
const int N = 5005;
int nn = 4980;
int rdd[N], tmpp[N];
set < pair < int, int > > mp;
vector < int > rndd_2 ( int lim ) {
for ( int i = 1; i <= lim; i ++ ) {
tmpp[i] = i;
}
for ( int i = 1; i <= lim; i ++ ) {
swap ( tmpp[i], tmpp[rndd () % lim + 1] );
}
vector < int > res;
for ( int i = 1; i <= 2; i ++ ) {
res.push_back ( tmpp[i] );
}
return res;
}
long long Bob ( vector < pair < int, int > > e ) {
for ( pair < int, int > it : e ) {
mp.insert ( it );
mp.insert ( { it.second, it.first } );
}
for ( int i = 1; i <= nn; i ++ ) {
rdd[i] = i;
}
for ( int i = 1; i <= nn; i ++ ) {
swap ( rdd[i], rdd[rndd () % nn + 1] );
}
long long x = 0;
for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
long long val = -1;
for ( int k = i; k <= i + 80 - 1; k ++ ) {
vector < int > tmpp = rndd_2 ( i - 1 );
if ( j < 2 ) {
cout << rdd[k] << " " << rdd[tmpp[0]] << '\n';
}
if ( mp.find ( { rdd[k], rdd[tmpp[0]] } ) != mp.end () ) {
val = 1;
break;
}
if ( mp.find ( { rdd[k], rdd[tmpp[1]] } ) != mp.end () ) {
val = 0;
break;
}
}
cout << '\n';
if ( val != -1 ) {
// cout << j << " " << val << '\n';
x += ( 1ll << ( long long ) j );
}
}
return x;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 98ms = 48ms + 50ms
memory: 1876kb,2284kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 2374 2156 2987 4858 1901 4277 1445 4469 3690 191 4575 1505 2814 3708 2296 2667 589 1295 1099 4293 3805 2803 2309 1137 942 3724 96 2482 3407 2926 2726 1989 1240...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 2374 2156 2987 4858 1901 4277 1445 4469 3690 191 4575 1505 2814 3708 2296 2667 589 1295 1099 4293 3805 2803 2309 1137 942 3724 96 2482 3407 2926 2726 1989 1240...
output:
2 4980 4622 1 975 1 1037 1 1336 1 2865 2 4443 3 2098 4 92 4 2093 4 2304 4 3636 4 3848 5 2499 6 1367 6 1781 7 4978 8 4265 9 4013 10 2485 10 3584 11 2446 12 2633 13 984 13 2515 13 4012 13 4762 14 1095 14 1452 15 749 15 1263 15 2676 15 2769 16 159 16 1002 16 1818 16 4032 16 4191 17 1006 18 3448 19 223 ...
input:
2 4980 4622 1 975 1 1037 1 1336 1 2865 2 4443 3 2098 4 92 4 2093 4 2304 4 3636 4 3848 5 2499 6 1367 6 1781 7 4978 8 4265 9 4013 10 2485 10 3584 11 2446 12 2633 13 984 13 2515 13 4012 13 4762 14 1095 14 1452 15 749 15 1263 15 2676 15 2769 16 159 16 1002 16 1818 16 4032 16 4191 17 1006 18 3448 19 223 ...
output:
4757 1957 2472 730 1907 3402 226 4721 1405 3665 3731 771 2866 2167 1033 1664 193 4331 4126 771 3636 207 427 4098 4599 2107 3570 4757 3219 3676 319 4396 4561 561 902 3770 328 242 1352 4472 2491 1499 288 931 4139 589 322 4924 868 3220 1196 3657 4823 4656 3885 3665 2644 4079 4242 262 2099 923 3792 994...
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 98ms = 49ms + 49ms
memory: 1880kb,2284kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 2374 2156 2987 4858 1901 4277 1445 4469 3690 191 4575 1505 3459 3708 2296 2667 589 1295 1099 4293 3805 2803 2309 1137 942 3724 96 2482 3407 2926 2726 1989 197 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 2374 2156 2987 4858 1901 4277 1445 4469 3690 191 4575 1505 3459 3708 2296 2667 589 1295 1099 4293 3805 2803 2309 1137 942 3724 96 2482 3407 2926 2726 1989 197 ...
output:
2 4980 4622 1 975 1 1037 1 1261 1 1336 2 4443 3 2098 4 463 4 2093 5 2499 6 1367 6 1781 7 4978 8 4265 9 4013 10 2485 10 3584 11 2446 12 2633 13 984 13 2515 13 4762 14 1095 14 1452 15 749 15 2769 16 159 16 824 17 1006 18 3448 19 223 20 56 21 4803 22 510 22 1879 22 2339 22 2619 22 2653 22 3317 22 3769 ...
input:
2 4980 4622 1 975 1 1037 1 1261 1 1336 2 4443 3 2098 4 463 4 2093 5 2499 6 1367 6 1781 7 4978 8 4265 9 4013 10 2485 10 3584 11 2446 12 2633 13 984 13 2515 13 4762 14 1095 14 1452 15 749 15 2769 16 159 16 824 17 1006 18 3448 19 223 20 56 21 4803 22 510 22 1879 22 2339 22 2619 22 2653 22 3317 22 3769 ...
output:
4757 1957 2472 730 1907 3402 226 4721 1405 3665 3731 771 2866 2167 1033 1664 193 4331 4126 771 3636 207 427 4098 4599 2107 3570 4757 3219 3676 319 4396 4561 561 902 3770 328 242 1352 4472 2491 1499 288 931 4139 589 322 4924 868 3220 1196 3657 4823 4656 3885 3665 2644 4079 4242 262 2099 923 3792 994...
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 97ms = 51ms + 46ms
memory: 1872kb,2276kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 3959 2156 2987 4858 1901 4277 294 4469 3671 191 1058 1505 2814 3708 2296 2667 2472 1295 1099 4293 3805 2803 611 1137 942 3724 96 2482 3648 2926 4297 1989 197 1...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4980 2272 3959 2156 2987 4858 1901 4277 294 4469 3671 191 1058 1505 2814 3708 2296 2667 2472 1295 1099 4293 3805 2803 611 1137 942 3724 96 2482 3648 2926 4297 1989 197 1...
output:
2 4980 4622 1 1336 1 2865 2 4443 3 4562 4 92 4 2304 4 3636 4 3848 5 2244 6 591 6 1367 6 1933 7 598 8 1323 9 4013 10 2485 10 4826 11 2446 12 2633 13 1403 13 4173 13 4762 14 1147 15 749 15 1263 15 3377 16 1002 16 4032 16 4191 17 1006 18 1366 18 3448 19 223 19 2089 20 56 21 2976 21 4803 22 510 22 604 2...
input:
2 4980 4622 1 1336 1 2865 2 4443 3 4562 4 92 4 2304 4 3636 4 3848 5 2244 6 591 6 1367 6 1933 7 598 8 1323 9 4013 10 2485 10 4826 11 2446 12 2633 13 1403 13 4173 13 4762 14 1147 15 749 15 1263 15 3377 16 1002 16 4032 16 4191 17 1006 18 1366 18 3448 19 223 19 2089 20 56 21 2976 21 4803 22 510 22 604 2...
output:
4757 1957 2472 730 1907 3402 226 4721 1405 3665 3731 771 2866 2167 1033 1664 193 4331 4126 771 3636 207 427 4098 4599 2107 3570 4757 3219 3676 319 4396 4561 561 902 3770 328 242 1352 4472 2491 1499 288 931 4139 589 322 4924 868 3220 1196 3657 4823 4656 3885 3665 2644 4079 4242 262 2099 923 3792 994...