QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#668709#8726. Magic Show_Alexande_0 4ms32892kbC++142.3kb2024-10-23 15:36:042024-10-23 15:36:08

Judging History

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

  • [2024-10-23 15:36:08]
  • 评测
  • 测评结果:0
  • 用时:4ms
  • 内存:32892kb
  • [2024-10-23 15:36:04]
  • 提交

Alice

#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;
mt19937 rnd1 ( 114514 ), rnd2 ( 191981 ), rnd3 ( 998244 );

const int N = 5005;

int n = 5000;
int rd[N], dad1[N], dad2[N];
vector < pair < int, int > > e;

vector < pair < int, int > > Alice () {
	long long x = setN ( 5000 );
    for ( int i = 1; i <= n; i ++ ) {
        rd[i] = i;
    }
    srand ( rnd3 () );
    random_shuffle ( rd + 1, rd + 1 + n );
	for ( int i = 2; i <= n; i ++ ) {
        dad1[i] = rnd1 () % ( i - 1 ) + 1;
        dad2[i] = rnd2 () % ( i - 1 ) + 1;
    }
    for ( int i = 2; i <= 80; i ++ ) {
        e.push_back ( { i, rnd3 () % ( i - 1 ) + 1 } );
    }
    int len = 80;
    for ( int i = 1; i <= 80; i ++ ) {
        for ( int j = 0; j <= 60; j ++ ) {
            len ++;
            if ( ( 1ll << j ) & x ) {
                e.push_back ( { len, dad1[len] } );
            }
            else {
                e.push_back ( { len, dad2[len] } );
            }
        }
    }
    for ( int i = len + 1; i <= 5000; i ++ ) {
        e.push_back ( { i, rnd3 () % ( i - 1 ) + 1 } );
    }
    vector < pair < int, int > > ans;
    for ( pair < int, int > tmp : e ) {
        ans.push_back ( { rd[tmp.first], rd[tmp.second] } );
    }
    return ans;
}

Bob

#include <bits/stdc++.h>
#include "Bob.h"

using namespace std;
mt19937 rndd1 ( 114514 ), rndd2 ( 191981 ), rndd3 ( 998244 );

const int N = 5005;

int nn = 5000;
int rdd[N], dadd1[N], dadd2[N];
int mp[N][N], p[N];

long long Bob ( vector < pair < int, int > > e ) {
    for ( int i = 1; i <= nn; i ++ ) {
        rdd[i] = i;
    }
    srand ( rndd3 () );
    random_shuffle ( rdd + 1, rdd + 1 + nn );
	for ( int i = 2; i <= nn; i ++ ) {
        dadd1[i] = rndd1 () % ( i - 1 ) + 1;
        dadd2[i] = rndd2 () % ( i - 1 ) + 1;
    }
    for ( pair < int, int > tmp : e ) {
        mp[tmp.first][tmp.second] = mp[tmp.second][tmp.first] = 1;
    }
    int len = 0;
    for ( int i = 1; i <= 80; i ++ ) {
        for ( int j = 0; j <= 60; j ++ ) {
            len ++;
            if ( mp[len][dadd1[len]] ) {
                p[j] = 1;
            }
        }
    }
    long long x = 0;
    for ( int i = 0; i <= 60; i ++ ) {
        if ( p[i] ) {
            x += 1ll << i;
        }
    }
	return x;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1952kb,32872kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

output:

2
5000 2773
1 4189
2 666
3 1134
4 4064
7 1556
9 2511
10 3359
14 3392
14 3471
16 1202
16 2187
16 3108
17 110
17 3195
18 4790
19 3711
20 3728
21 1095
23 141
23 2507
25 2119
25 2257
28 2595
28 4050
29 333
29 3221
29 4882
33 948
33 1760
33 2252
34 1968
35 4285
37 4603
38 1899
39 282
40 194
40 4197
40 47...

input:

2
5000 2773
1 4189
2 666
3 1134
4 4064
7 1556
9 2511
10 3359
14 3392
14 3471
16 1202
16 2187
16 3108
17 110
17 3195
18 4790
19 3711
20 3728
21 1095
23 141
23 2507
25 2119
25 2257
28 2595
28 4050
29 333
29 3221
29 4882
33 948
33 1760
33 2252
34 1968
35 4285
37 4603
38 1899
39 282
40 194
40 4197
40 47...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
64

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 4ms = 1ms + 3ms
memory: 1952kb,32872kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

output:

2
5000 2773
1 3505
2 666
3 1134
4 4064
7 1556
9 1230
10 3359
10 3529
12 1593
12 3663
14 3392
14 3471
16 1202
16 2187
16 3108
17 110
18 4790
19 3711
20 3728
21 1095
25 2119
25 2257
28 137
28 2595
28 4050
29 333
29 3221
29 4882
33 948
33 1760
33 2252
34 2372
34 3858
35 3254
35 4285
37 4603
38 1899
39 ...

input:

2
5000 2773
1 3505
2 666
3 1134
4 4064
7 1556
9 1230
10 3359
10 3529
12 1593
12 3663
14 3392
14 3471
16 1202
16 2187
16 3108
17 110
18 4790
19 3711
20 3728
21 1095
25 2119
25 2257
28 137
28 2595
28 4050
29 333
29 3221
29 4882
33 948
33 1760
33 2252
34 2372
34 3858
35 3254
35 4285
37 4603
38 1899
39 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
64

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1952kb,32892kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
316 4770
973 4770
4910 316
2496 4770
3855 973
2508 3855
4834 316
480 316
3581 316
2266 2496
4567 973
2692 4567
2863 2508
2030 3581
1601 973
977 3581
4512 4770
3696 ...

output:

2
5000 2773
1 3505
2 666
3 2087
4 4064
7 1556
8 3532
9 2511
10 2046
10 3529
12 1593
14 3392
15 3319
16 3231
17 110
17 3195
18 4790
19 3711
20 2199
21 2148
22 257
22 1907
23 141
25 2119
25 2257
28 3434
29 417
29 2105
29 3221
33 1084
34 1968
34 3858
35 3254
37 4603
38 1899
39 282
40 194
40 1704
40 419...

input:

2
5000 2773
1 3505
2 666
3 2087
4 4064
7 1556
8 3532
9 2511
10 2046
10 3529
12 1593
14 3392
15 3319
16 3231
17 110
17 3195
18 4790
19 3711
20 2199
21 2148
22 257
22 1907
23 141
25 2119
25 2257
28 3434
29 417
29 2105
29 3221
33 1084
34 1968
34 3858
35 3254
37 4603
38 1899
39 282
40 194
40 1704
40 419...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
64