QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#557184#8726. Magic ShowLe0Chan0 0ms0kbC++201.3kb2024-09-11 07:49:002024-09-11 07:49:00

Judging History

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

  • [2024-09-11 07:49:00]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-09-11 07:49:00]
  • 提交

Alice

#include <bits/stdc++.h>
using namespace std;
#include "Alice.h"
#define LL long long
#define pii pair<int,int>
#define fi first 
#define se second
std::vector<std::pair<int, int>> Alice();
long long setN(int n);
vector<pii> Alice(){
    int n=4943;
    LL V=setN(4943);
    vector<pii> as;
    as.push_back({1,2});
    for(int l=3;l<=4943;l+=61){
        int now=l;
        for(int i=0;i<=60;i++){
            if(V&(1ll<<i)) as.push_back({now,now-2});
            else as.push_back({now,now-1});
            now++;
        }
    }
    return as;
}
// int main(){
//     Alice();return 0;
// }

Bob

#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
#define LL long long
#define pii pair<int,int>
#define fi first 
#define se second
long long Bob(std::vector<std::pair<int, int>> V);
const int N=5e3+5;
bool vis[N];
int fa[N],ans[N];
int n=4943;
vector<int> g[N];
void add(int x,int y){g[x].push_back(y);}
LL Bob(vector<pii> as){
    for(auto [x,y]:as){
        if(x<y) fa[y]=x;
        else fa[x]=y;
    }
    for(int l=3;l<=n;l+=61){
        int now=l;
        for(int j=0;j<=60;j++){
            if(fa[now]){
                ans[j]=now-fa[now]-1;
            }
            now++;
        }
    }
    LL rs=0;
    for(int j=0;j<=60;j++) rs+=1ll<<ans[j];
    cout<<rs<<"\n";
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

input:

1
4005

output:

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

input:

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

output:

2
4943 3758
1 2
3 4
3 5
5 6
6 7
6 8
8 9
8 10
11 13
12 14
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
26 27
27 28
28 29
31 32
33 34
34 35
35 36
36 37
37 38
38 39
39 40
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
52 53
54 55
55 56
57 58
58 59
59 60
60 61
61 62
62 63
64 ...

input:

2
4943 3758
1 2
3 4
3 5
5 6
6 7
6 8
8 9
8 10
11 13
12 14
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
26 27
27 28
28 29
31 32
33 34
34 35
35 36
36 37
37 38
38 39
39 40
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
52 53
54 55
55 56
57 58
58 59
59 60
60 61
61 62
62 63
64 ...

output:


Subtask #2:

score: 0
Runtime Error

Test #13:

score: 0
Runtime Error

input:

1
17476204

output:

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

input:

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

output:

2
4943 3758
1 2
3 4
3 5
4 6
6 7
6 8
7 9
9 10
12 13
12 14
14 16
16 17
16 18
18 19
18 20
20 21
20 22
22 23
23 24
24 25
25 27
27 28
28 29
31 32
33 34
34 35
35 36
36 37
37 38
38 39
39 40
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
52 53
54 55
55 56
57 58
58 59
59 60
60 61
61 62
62 63
64 ...

input:

2
4943 3758
1 2
3 4
3 5
4 6
6 7
6 8
7 9
9 10
12 13
12 14
14 16
16 17
16 18
18 19
18 20
20 21
20 22
22 23
23 24
24 25
25 27
27 28
28 29
31 32
33 34
34 35
35 36
36 37
37 38
38 39
39 40
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
52 53
54 55
55 56
57 58
58 59
59 60
60 61
61 62
62 63
64 ...

output:


Subtask #3:

score: 0
Runtime Error

Test #25:

score: 0
Runtime Error

input:

1
355365355024496523

output:

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

input:

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

output:

2
4943 3758
1 2
2 4
4 5
4 6
6 7
7 8
8 9
8 10
11 13
13 14
14 16
16 17
17 18
17 19
18 20
19 21
21 22
21 23
22 24
24 25
25 27
26 28
27 29
31 32
33 34
34 35
35 36
36 37
36 38
38 39
38 40
40 42
42 43
42 44
44 45
45 46
46 47
47 48
48 49
48 50
50 51
51 53
54 55
54 56
56 58
58 59
59 60
59 61
61 62
62 63
65 ...

input:

2
4943 3758
1 2
2 4
4 5
4 6
6 7
7 8
8 9
8 10
11 13
13 14
14 16
16 17
17 18
17 19
18 20
19 21
21 22
21 23
22 24
24 25
25 27
26 28
27 29
31 32
33 34
34 35
35 36
36 37
36 38
38 39
38 40
40 42
42 43
42 44
44 45
45 46
46 47
47 48
48 49
48 50
50 51
51 53
54 55
54 56
56 58
58 59
59 60
59 61
61 62
62 63
65 ...

output: