QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#668491#8726. Magic Show_Alexande_0 102ms2280kbC++142.6kb2024-10-23 14:38:452024-10-23 14:38:51

Judging History

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

  • [2024-10-23 14:38:51]
  • 评测
  • 测评结果:0
  • 用时:102ms
  • 内存:2280kb
  • [2024-10-23 14:38:45]
  • 提交

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 = 2; i <= 100; i ++ ) {
        e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 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]] } );
            }
            else {
                e.push_back ( { rd[k], rd[tmp[1]] } );
            }
        }
    }
	return e;
}

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] );	
	}
	for ( int i = 2; i <= 100; i ++ ) {
		e.push_back ( { rdd[i], rdd[rndd () % ( i - 1 ) + 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 ( mp.find ( { rdd[k], rdd[tmpp[0]] } ) != mp.end () ) {
                val = 1;
                break;
            }
            if ( mp.find ( { rdd[k], rdd[tmpp[0]] } ) != mp.end () ) {
                val = 0;
                break;
            }
        }
        if ( val ) {
            x += ( 1ll << ( long long ) j );
        }
    }
	return x;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 99ms = 49ms + 50ms
memory: 1912kb,2280kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

output:

2
4980 4269
1 355
1 383
1 4618
2 1000
3 2839
4 291
4 1385
4 1836
4 3551
4 4765
5 4557
6 1082
6 2822
6 4095
6 4523
7 4791
8 838
9 2836
10 402
10 3213
11 2387
12 1573
13 151
13 704
13 1268
13 1863
13 2747
14 1437
14 4903
15 2885
15 3235
15 3720
16 3520
16 4030
16 4967
17 3396
18 3042
19 2280
20 1013
2...

input:

2
4980 4269
1 355
1 383
1 4618
2 1000
3 2839
4 291
4 1385
4 1836
4 3551
4 4765
5 4557
6 1082
6 2822
6 4095
6 4523
7 4791
8 838
9 2836
10 402
10 3213
11 2387
12 1573
13 151
13 704
13 1268
13 1863
13 2747
14 1437
14 4903
15 2885
15 3235
15 3720
16 3520
16 4030
16 4967
17 3396
18 3042
19 2280
20 1013
2...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 102ms = 57ms + 45ms
memory: 1908kb,2176kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

output:

2
4980 3386
1 355
1 2269
1 3488
2 1000
3 2839
4 463
4 1836
4 3551
4 4765
5 4557
6 2822
6 3408
6 3835
6 4523
7 4791
8 838
9 2836
10 402
11 2387
12 1573
13 151
13 704
13 1863
13 2747
14 1437
14 4903
15 2837
15 2885
15 3235
15 3720
15 3848
16 3402
16 3520
18 3042
19 2280
20 1013
22 231
22 402
22 1755
2...

input:

2
4980 3386
1 355
1 2269
1 3488
2 1000
3 2839
4 463
4 1836
4 3551
4 4765
5 4557
6 2822
6 3408
6 3835
6 4523
7 4791
8 838
9 2836
10 402
11 2387
12 1573
13 151
13 704
13 1863
13 2747
14 1437
14 4903
15 2837
15 2885
15 3235
15 3720
15 3848
16 3402
16 3520
18 3042
19 2280
20 1013
22 231
22 402
22 1755
2...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 99ms = 53ms + 46ms
memory: 1916kb,2172kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4980
330 3028
3971 3028
4098 330
1363 3028
1152 330
1167 1152
709 1167
4472 1167
3625 1152
3279 3625
1499 4098
3402 3279
4331 1152
591 4331
1957 4472
4099 1152
4044 3028...

output:

2
4980 3386
1 355
1 383
2 1000
3 4177
4 1337
4 1385
4 1836
4 3551
4 4765
5 910
6 3280
6 3731
6 4194
7 1998
8 786
9 2836
10 1411
11 2387
12 1573
13 151
13 589
13 704
13 1268
14 664
14 4903
15 2885
15 3235
16 4967
18 3042
19 2280
20 1013
22 231
22 1755
22 3497
23 1428
27 2557
27 4593
27 4924
28 3634
2...

input:

2
4980 3386
1 355
1 383
2 1000
3 4177
4 1337
4 1385
4 1836
4 3551
4 4765
5 910
6 3280
6 3731
6 4194
7 1998
8 786
9 2836
10 1411
11 2387
12 1573
13 151
13 589
13 704
13 1268
14 664
14 4903
15 2885
15 3235
16 4967
18 3042
19 2280
20 1013
22 231
22 1755
22 3497
23 1428
27 2557
27 4593
27 4924
28 3634
2...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.