QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#833062#5090. 妙妙题PhNe#26.455696 508ms180008kbC++142.2kb2024-12-26 12:42:032024-12-26 12:42:04

Judging History

This is the latest submission verdict.

  • [2024-12-26 12:42:04]
  • Judged
  • Verdict: 26.455696
  • Time: 508ms
  • Memory: 180008kb
  • [2024-12-26 12:42:03]
  • Submitted

answer

#include<map>
#include<set>
#include<ctime>
#include<cmath>
#include<queue>
#include<bitset>
#include<cstdio>
#include<vector>
#include<random>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
#define I ll
#define her1 20081214
#define IV void
#define cht 998244352
#define Mod 998244353
#define ld double
#define Aestas16 392699
#define ull unsigned long long
#define cp(x,y)memcpy(x,y,sizeof y)
#define mem(x,val)memset(x,val,sizeof x)
#define D(i,j,n)for(register int i=j;i>=n;i--)
#define E(i,now)for(register int i=first[now],v=e[i].to;i;v=e[i=e[i].nxt].to)
#define F(i,j,n)for(register int i=j;i<=n;i++)
#define DL(i,j,n)for(register i64 i=j;i>=n;i--)
#define EL(i,now)for(register i64 i=first[now];i;i=e[i].nxt)
#define FL(i,j,n)for(register i64 i=j;i<=n;i++)
#undef ll

#include "tmp.h"

#include "assert.h"
mt19937_64 rnd(her1);
#include "functional"
using i64 = int;
i64 v,n;bool flag;
IV init(i64 N,bool type,i64 p){
    flag=0;n=N;
}

bool mat2[]={0,1,0,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0};
bool mat[]={
    0,0,1,1,0,1,1,1,1,1,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0
    ,0,1,1,1,1,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,1};
bool guess(ull A,i64 x){
    // i64 c0=0,c1=0;
    if(n==3){
        if(A==0)return 0;
        if(A==1)return 1;
        if(A==2)return 0;
        if(A==3)return 1;
    }
    if(n<=5){
        A&=7;
        if(A==0)return 0;
        if(A==1)return 1;
        if(A==2)return 0;
        if(A==3)return 0;
        if(A==4)return 1;
        if(A==5)return 0;
        if(A==6)return 1;
        if(A==7)return 1;
    }
    if(n==6){
        return mat2[A];
    }
    i64 c1=__builtin_popcount(A);
    if(c1<n/3)return 0;if(c1>2*n/3)return 1;
    A&=63;
    return mat[A];
    // i64 cnt=0,mx=0,mn=0;
    // F(i,0,n-2){
    //     if(A>>i&1)mx=max(mx,++cnt);
    //     else mn=min(mn,--cnt);
    //     if(cnt<0)return 0;
    // }
    // return 1;
    // i64 cnt=0;
    // F(i,0,n-2)putchar((A>>i&1)+'0');puts("");
    // F(i,0,n-2)if((A>>i&1)==(A&1))
    //   cnt++;else break;
    // if(cnt&1)return 0;else return 1;
    // if(!flag){
    // }
    // return v;
}

詳細信息


Pretests


Final Tests

Test #1:

score: 1.35982
Acceptable Answer
time: 389ms
memory: 142760kb

input:

47 1 512
65536
59357300018926
96293527518067
137737813750604
78491116915335
88993654874821
78360968852287
2702630495168
114190034399180
83706287931245
55843777475204
63987647760479
11819697729154
76479374308061
97575794268961
13640589330115
19983697841730
74715951846822
13599519328054
61548920225107...

output:

JFIBEIIYTAFEUXOULOWO
0.353553

result:

points 0.3535530 Partially Correct!

Test #2:

score: 0.480769
Acceptable Answer
time: 417ms
memory: 143196kb

input:

48 1 1
65536
258400084282002
18817291621552
34157414175968
261341895829058
57721360254810
38139952911729
53122991565876
214222729945708
39585781480156
48503996366320
134007771804549
248553732684813
247186913037501
110017143518730
113208754435931
131680128766130
195535268670747
147744476202390
276072...

output:

JFIBEIIYTAFEUXOULOWO
0.125000

result:

points 0.1250 Partially Correct!

Test #3:

score: 3.84615
Accepted
time: 0ms
memory: 4120kb

input:

3 0 1
8
0
1
2
3
4
5
6
7

output:

JFIBEIIYTAFEUXOULOWO
1.000000

result:

ok Accepted!

Test #4:

score: 3.84615
Accepted
time: 0ms
memory: 4068kb

input:

4 0 1
16
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

output:

JFIBEIIYTAFEUXOULOWO
1.000000

result:

ok Accepted!

Test #5:

score: 3.84615
Accepted
time: 0ms
memory: 4116kb

input:

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

output:

JFIBEIIYTAFEUXOULOWO
1.000000

result:

ok Accepted!

Test #6:

score: 3.84615
Accepted
time: 0ms
memory: 4116kb

input:

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

output:

JFIBEIIYTAFEUXOULOWO
1.000000

result:

ok Accepted!

Test #7:

score: 0.740192
Acceptable Answer
time: 0ms
memory: 4148kb

input:

7 0 1
128
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...

output:

JFIBEIIYTAFEUXOULOWO
0.192450

result:

points 0.192450 Partially Correct!

Test #8:

score: 0
Wrong Answer
time: 1ms
memory: 3812kb

input:

8 0 1
256
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #9:

score: 0.480769
Acceptable Answer
time: 1ms
memory: 4388kb

input:

9 0 1
512
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...

output:

JFIBEIIYTAFEUXOULOWO
0.125000

result:

points 0.1250 Partially Correct!

Test #10:

score: 0
Wrong Answer
time: 1ms
memory: 3748kb

input:

10 0 1
1024
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #11:

score: 0.344012
Acceptable Answer
time: 3ms
memory: 4252kb

input:

11 0 1
2048
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

JFIBEIIYTAFEUXOULOWO
0.089443

result:

points 0.0894430 Partially Correct!

Test #12:

score: 0
Wrong Answer
time: 6ms
memory: 4788kb

input:

12 0 1
4096
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #13:

score: 0.261696
Acceptable Answer
time: 13ms
memory: 8856kb

input:

13 0 1
8192
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

JFIBEIIYTAFEUXOULOWO
0.068041

result:

points 0.0680410 Partially Correct!

Test #14:

score: 0
Wrong Answer
time: 23ms
memory: 9932kb

input:

14 0 1
16384
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #15:

score: 0.207673
Acceptable Answer
time: 60ms
memory: 18260kb

input:

15 0 1
32768
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...

output:

JFIBEIIYTAFEUXOULOWO
0.053995

result:

points 0.0539950 Partially Correct!

Test #16:

score: 0
Wrong Answer
time: 128ms
memory: 34260kb

input:

16 0 1
65536
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #17:

score: 1.35982
Acceptable Answer
time: 212ms
memory: 84268kb

input:

28 0 4096
65536
12151528
151281107
6356985
55622754
60790524
53095221
162774027
194726956
201380075
180643942
225783870
139946880
218528657
225747273
45233416
69963165
110071370
18713620
44573845
197368669
192189960
141638483
205070195
74240494
192234058
55620586
106561140
236994814
168337406
215313...

output:

JFIBEIIYTAFEUXOULOWO
0.353553

result:

points 0.3535530 Partially Correct!

Test #18:

score: 0.740192
Acceptable Answer
time: 222ms
memory: 87860kb

input:

29 0 512
65536
410980218
273986093
178466579
150072202
250912479
270586913
393616450
140036310
132749116
193167620
238207721
326701767
60326704
175391453
459652996
91592080
465308012
303071205
317027207
313954262
271839860
162796025
383149978
185842070
506111563
99795943
67286207
299755290
444249030...

output:

JFIBEIIYTAFEUXOULOWO
0.192450

result:

points 0.192450 Partially Correct!

Test #19:

score: 0.480769
Acceptable Answer
time: 234ms
memory: 89700kb

input:

30 0 64
65536
214691366
235660933
597567210
280356575
393308773
32061236
891978407
203580173
963799529
818831701
435986085
699779062
393711419
235031222
190999512
651187471
263424929
403655957
709360404
520961430
84146157
915935067
839531745
598427362
31351715
260657569
651872369
657176264
286669978...

output:

JFIBEIIYTAFEUXOULOWO
0.125000

result:

points 0.1250 Partially Correct!

Test #20:

score: 0.207673
Acceptable Answer
time: 238ms
memory: 91044kb

input:

31 0 1
65536
0
2147483647
1
2147483646
2
2147483645
4
2147483643
8
2147483639
16
2147483631
32
2147483615
64
2147483583
128
2147483519
256
2147483391
512
2147483135
1024
2147482623
2048
2147481599
4096
2147479551
8192
2147475455
16384
2147467263
32768
2147450879
65536
2147418111
131072
2147352575
26...

output:

JFIBEIIYTAFEUXOULOWO
0.053995

result:

points 0.0539950 Partially Correct!

Test #21:

score: 0
Wrong Answer
time: 254ms
memory: 93652kb

input:

32 0 1
65536
0
4294967295
0
1431655765
2863311530
4294967295
0
286331153
572662306
858993459
1145324612
1431655765
1717986918
2004318071
2290649224
2576980377
2863311530
3149642683
3435973836
3722304989
4008636142
4294967295
0
16843009
33686018
50529027
67372036
84215045
101058054
117901063
13474407...

output:

JFIBEIIYTAFEUXOULOWO
0

result:

wrong answer Wrong Answer!

Test #22:

score: 1.35982
Acceptable Answer
time: 490ms
memory: 174876kb

input:

60 0 4096
65536
323063836466945924
793208291393593433
189732482682253627
339930035043069470
789975177022429968
414130113627522972
91354260708955341
246387313915805097
970513132875638428
12986596413062042
625318425426451677
353996229352655370
207780311111953778
34041113763273101
354089840612182482
43...

output:

JFIBEIIYTAFEUXOULOWO
0.353553

result:

points 0.3535530 Partially Correct!

Test #23:

score: 1.35982
Acceptable Answer
time: 508ms
memory: 176268kb

input:

61 0 512
65536
1269579383276536574
695100626888423752
1516888087373291385
62428637511494860
2066149187156155714
2191875477617107915
1990208032576906010
904462045833512333
1432974211708032269
1282245156402897867
2096783067184239171
2075613347620236839
1250324067295528212
47976314605632040
59849885805...

output:

JFIBEIIYTAFEUXOULOWO
0.353553

result:

points 0.3535530 Partially Correct!

Test #24:

score: 0.740192
Acceptable Answer
time: 505ms
memory: 178856kb

input:

62 0 64
65536
3579036048363638035
1601308923709322678
3797465667647602123
766217468233066219
450676595845310450
1532660195163344938
1771678237392312816
1676569536181862657
2613010877472702833
494389864650935313
2858087890091928221
2143267956909629504
395591804550444159
510332675328606646
41204665032...

output:

JFIBEIIYTAFEUXOULOWO
0.192450

result:

points 0.192450 Partially Correct!

Test #25:

score: 0.207673
Acceptable Answer
time: 498ms
memory: 177248kb

input:

63 0 1
65536
0
9223372036854775807
0
1317624576693539401
2635249153387078802
3952873730080618203
5270498306774157604
6588122883467697005
7905747460161236406
9223372036854775807
0
72624976668147841
145249953336295682
217874930004443523
290499906672591364
363124883340739205
435749860008887046
50837483...

output:

JFIBEIIYTAFEUXOULOWO
0.053995

result:

points 0.0539950 Partially Correct!

Test #26:

score: 0.740192
Acceptable Answer
time: 506ms
memory: 180008kb

input:

64 0 1
65536
0
18446744073709551615
0
6148914691236517205
12297829382473034410
18446744073709551615
0
1229782938247303441
2459565876494606882
3689348814741910323
4919131752989213764
6148914691236517205
7378697629483820646
8608480567731124087
9838263505978427528
11068046444225730969
12297829382473034...

output:

JFIBEIIYTAFEUXOULOWO
0.192450

result:

points 0.192450 Partially Correct!