QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#592965#8726. Magic Show-Ofast0 0ms1920kbC++201.4kb2024-09-27 10:37:252024-09-27 10:37:25

Judging History

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

  • [2024-09-27 10:37:25]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:1920kb
  • [2024-09-27 10:37:25]
  • 提交

Alice

#include <bits/stdc++.h>
#include"Alice.h"
#define mp make_pair
#define fir first
#define sec second
using namespace std;
	int fa[5005],vis[5005];
	vector <pair<int,int>> Alice(){
		mt19937 rnd(20080511);
		mt19937 rnd2(19911225);
		unsigned long long X=setN(4098);
		vector <int> id;
		for(int i=0;i<4096;i++)
			id.push_back(i+3);
		shuffle(id.begin(),id.end(),rnd);
		for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
		vector <pair<int,int>> res;
		res.push_back(mp(2,1));fa[2]=1;
		int cnt=0;
		for(int i=0;i<4096;i+=64){
			for(int j=i;j<i+64;j++){
				fa[id[j]]=rnd()%(id[j]/2)+1;
				if(((X>>cnt)&1)^vis[id[j]]){
					fa[id[j]]+=(id[j]/2);
					if(fa[id[j]]==id[j])fa[id[j]]--;
				}
			}
			cnt++;
		}
		for(int i=3;i<=4098;i++)
			res.push_back(mp(i,fa[i]));
		return res;
	}

Bob

#include <bits/stdc++.h>
#include"Bob.h"
#define mp make_pair
#define fir first
#define sec second
using namespace std;
	int fa[5005],inv[5005],vis[5005];
	long long Bob(vector <pair<int,int>> p){
		mt19937 rnd(20080511);
		mt19937 rnd2(19911225);
		vector <int> id;
		for(int i=0;i<4096;i++)
			id.push_back(i+3);
		shuffle(id.begin(),id.end(),rnd);
		for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
		for(int i=0;i<4096;i++)
			inv[id[i]]=i/64;
		unsigned long long ans=0;
		for(auto it:p){
			if(it.fir==2)continue;
			if((it.sec>it.fir/2)^vis[it.fir])
				ans|=1ull<<(inv[it.fir]);
		}
		return ans;
	}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1920kb,1888kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 1
4 1
5 2
6 2
7 3
8 5
9 1
10 7
11 5
12 6
13 11
14 12
15 14
16 1
17 13
18 10
19 13
20 12
21 16
22 20
23 10
24 9
25 24
26 22
27 18
28 10
29 7
30 2
31 28
32 17
3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 1
4 1
5 2
6 2
7 3
8 5
9 1
10 7
11 5
12 6
13 11
14 12
15 14
16 1
17 13
18 10
19 13
20 12
21 16
22 20
23 10
24 9
25 24
26 22
27 18
28 10
29 7
30 2
31 28
32 17
3...

output:

2
4098 2476
1 2
1 3
1 4
1 49
1 54
1 194
1 701
2 5
2 6
2 30
2 397
3 37
3 113
3 135
3 142
3 304
3 450
3 773
4 35
5 8
5 2436
6 12
6 50
6 60
6 1294
6 3717
7 80
7 715
8 164
8 460
8 559
8 589
8 1847
8 2440
8 3770
10 23
10 71
10 343
11 77
11 723
11 849
11 860
12 14
12 1163
12 1792
13 17
13 43
13 699
13 947...

input:

2
4098 2476
1 2
1 3
1 4
1 49
1 54
1 194
1 701
2 5
2 6
2 30
2 397
3 37
3 113
3 135
3 142
3 304
3 450
3 773
4 35
5 8
5 2436
6 12
6 50
6 60
6 1294
6 3717
7 80
7 715
8 164
8 460
8 559
8 589
8 1847
8 2440
8 3770
10 23
10 71
10 343
11 77
11 723
11 849
11 860
12 14
12 1163
12 1792
13 17
13 43
13 699
13 947...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1920kb,1884kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 1
4 1
5 2
6 2
7 3
8 5
9 1
10 7
11 5
12 11
13 11
14 12
15 7
16 9
17 13
18 1
19 4
20 12
21 16
22 20
23 10
24 9
25 24
26 9
27 5
28 10
29 7
30 2
31 28
32 17
33 19...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 1
4 1
5 2
6 2
7 3
8 5
9 1
10 7
11 5
12 11
13 11
14 12
15 7
16 9
17 13
18 1
19 4
20 12
21 16
22 20
23 10
24 9
25 24
26 9
27 5
28 10
29 7
30 2
31 28
32 17
33 19...

output:

2
4098 2476
1 2
1 3
1 4
1 49
1 54
1 194
2 5
2 6
2 30
2 397
3 37
3 113
3 135
3 142
3 154
3 304
3 450
3 773
3 2767
5 8
5 27
6 50
6 60
6 3717
7 15
7 80
7 715
8 164
8 460
8 589
8 1847
8 2029
8 2440
8 3770
10 23
10 55
10 71
10 343
11 12
11 77
12 14
12 1163
13 17
13 43
13 699
13 947
14 214
15 494
15 1247
...

input:

2
4098 2476
1 2
1 3
1 4
1 49
1 54
1 194
2 5
2 6
2 30
2 397
3 37
3 113
3 135
3 142
3 154
3 304
3 450
3 773
3 2767
5 8
5 27
6 50
6 60
6 3717
7 15
7 80
7 715
8 164
8 460
8 589
8 1847
8 2029
8 2440
8 3770
10 23
10 55
10 71
10 343
11 12
11 77
12 14
12 1163
13 17
13 43
13 699
13 947
14 214
15 494
15 1247
...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1920kb,1888kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 2
4 1
5 4
6 5
7 6
8 5
9 5
10 7
11 10
12 11
13 11
14 5
15 7
16 9
17 5
18 10
19 4
20 12
21 6
22 9
23 21
24 21
25 24
26 9
27 5
28 24
29 21
30 2
31 13
32 17
33 3
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4098
2 1
3 2
4 1
5 4
6 5
7 6
8 5
9 5
10 7
11 10
12 11
13 11
14 5
15 7
16 9
17 5
18 10
19 4
20 12
21 6
22 9
23 21
24 21
25 24
26 9
27 5
28 24
29 21
30 2
31 13
32 17
33 3
...

output:

2
4098 2476
1 2
1 4
1 49
1 194
1 537
2 3
2 30
2 59
2 397
2 2721
3 113
3 154
3 450
3 2767
4 5
4 56
4 93
4 376
5 6
5 8
5 14
5 17
5 27
5 34
5 51
5 82
5 168
5 1452
5 1824
5 2436
5 2511
6 21
6 50
6 60
6 925
6 1294
6 3717
7 15
7 80
8 40
8 52
8 164
8 460
8 559
8 589
8 1847
8 2440
8 3770
9 22
9 76
10 71
10 ...

input:

2
4098 2476
1 2
1 4
1 49
1 194
1 537
2 3
2 30
2 59
2 397
2 2721
3 113
3 154
3 450
3 2767
4 5
4 56
4 93
4 376
5 6
5 8
5 14
5 17
5 27
5 34
5 51
5 82
5 168
5 1452
5 1824
5 2436
5 2511
6 21
6 50
6 60
6 925
6 1294
6 3717
7 15
7 80
8 40
8 52
8 164
8 460
8 559
8 589
8 1847
8 2440
8 3770
9 22
9 76
10 71
10 ...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.