QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#562989 | #5434. Binary Substrings | Nickqw | AC ✓ | 20ms | 11004kb | C++14 | 2.2kb | 2024-09-14 00:00:25 | 2024-09-14 00:00:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const vector<int> ns = {1, 2, 5, 10, 19, 36, 69, 134, 263, 520, 1033, 2058, 4107, 8204, 16397, 32782, 65551, 131088, 262161};
const vector<vector<int>> primitive_polynomials = {
{},
{1},
{1, 2},
{1, 3},
{3, 4},
{3, 5},
{5, 6},
{6, 7},
{4, 5, 6, 8},
{5, 9},
{7, 10},
{9, 11},
{4, 10, 11, 12},
{8, 11, 12, 13},
{2, 12, 13, 14},
{14, 15},
{11, 13, 14, 16},
{14, 17},
{11, 18},
};
vector<pair<int, int>> lfsr(ll d) {
vector<int> p = primitive_polynomials[d];
ll x = (1 << d) - 1;
vector<int> r;
while (r.size() == 0 || r[0] != x) {
r.push_back(x);
x <<= 1;
for (auto k : p) if ((x >> k) & 1) x ^= 1;
if ((x >> d) & 1) x ^= (1 << d);
}
r.insert(find(r.begin(), r.end(), (1 << (d-1))) + 1, 0);
vector<pair<int, int>> result(1 << d);
for (size_t i=0; i < (1 << d); ++i) { result[r[i]] = {0, r[(i+1) % (r.size())]}; }
return result;
}
int solve(int n) {
if (n == 1) {cout << "0" << endl; return 0;}
int d = (upper_bound(ns.begin(), ns.end(), n) - ns.begin()) - 1;
vector<vector<pair<int, int>>> c(2);
c[0] = lfsr(d);
c[1] = vector<pair<int, int>>(1 << d, {-1, -1});
int l = ns[d];
int s = 0;
unordered_set<int> r;
for (int x=0; x < (1 << d); ++x) r.insert(x);
while (l < n) {
int x = *r.begin();
while (c[1][x].first == -1) {
r.erase(x);
l += 1;
c[1][x] = {1, c[0][x].second ^ 1};
x = c[1][x].second;
}
s = c[0][x].second;
swap(c[0][x], c[1][x]);
}
pair<int, int> pos = {0, s};
string ans;
for (int i=d-1; i >= 0; i--) ans += ((pos.second >> i) & 1) ? '0' : '1';
while (ans.size() < n) {
auto [t, x] = pos;
auto [tn, xn] = c[t][x];
ans += (xn & 1) ? '0' : '1';
pos = {tn, xn};
}
cout << ans << endl;
return 0;
}
int main() {
int t = 1;
while (t--) {
int n; cin >> n;
solve(n);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3560kb
input:
2
output:
10
result:
ok meet maximum 3
Test #2:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
5
output:
11001
result:
ok meet maximum 12
Test #3:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
1
output:
0
result:
ok meet maximum 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
3
output:
100
result:
ok meet maximum 5
Test #5:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
4
output:
0011
result:
ok meet maximum 8
Test #6:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
6
output:
011000
result:
ok meet maximum 16
Test #7:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
7
output:
1100010
result:
ok meet maximum 21
Test #8:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
8
output:
11000101
result:
ok meet maximum 27
Test #9:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
9
output:
100010111
result:
ok meet maximum 34
Test #10:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
10
output:
1110001011
result:
ok meet maximum 42
Test #11:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
11
output:
00101110000
result:
ok meet maximum 50
Test #12:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
12
output:
010111000011
result:
ok meet maximum 59
Test #13:
score: 0
Accepted
time: 17ms
memory: 10696kb
input:
200000
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 19996962278
Test #14:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
24
output:
001111011001010000010011
result:
ok meet maximum 240
Test #15:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
35
output:
11101100101000001001101011100011111
result:
ok meet maximum 526
Test #16:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
30
output:
001111011001010000010011010111
result:
ok meet maximum 381
Test #17:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
45
output:
000111001000101011111011010011000000100101100
result:
ok meet maximum 882
Test #18:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
66
output:
000111001000101011111011010011000000100101100111100011011101010000
result:
ok meet maximum 1953
Test #19:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
50
output:
00011100100010101111101101001100000010010110011110
result:
ok meet maximum 1097
Test #20:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
80
output:
00001111110111100111010110000101110001101101001000100110010101000000010000110001
result:
ok meet maximum 2901
Test #21:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
107
output:
00001111110111100111010110000101110001101101001000100110010101000000010000110001010011110100011100100101101
result:
ok meet maximum 5277
Test #22:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
81
output:
000011111101111001110101100001011100011011010010001001100101010000000100001100010
result:
ok meet maximum 2976
Test #23:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
147
output:
000101011000001011110001110110110010010100100001001110010110100010001100110101010000000011111110111110011110101110000110111010011000101100111010100
result:
ok meet maximum 10124
Test #24:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
255
output:
000101011000001011110001110110110010010100100001001110010110100010001100110101010000000011111110111110011110101110000110111010011000101100111010100111110100001110001001001101101011011110110001101001011101110011001010101111110000001000001100001010001111001
result:
ok meet maximum 31130
Test #25:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
173
output:
00010101100000101111000111011011001001010010000100111001011010001000110011010101000000001111111011111001111010111000011011101001100010110011101010011111010000111000100100110
result:
ok meet maximum 14115
Test #26:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
288
output:
000000111101000011100101111111101110001110110100011111100110110110010001101111101010010010100110100111100000100100001010001011101111001001110000110001100111010010110111010110101011000100010011000010000001011001100101011100111110001010101000001101011110110000000001000111000100101110000001
result:
ok meet maximum 39850
Test #27:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
407
output:
000000111101000011100101111111101110001110110100011111100110110110010001101111101010010010100110100111100000100100001010001011101111001001110000110001100111010010110111010110101011000100010011000010000001011001100101011100111110001010101000001101011110110000000001000111000100101110000001100100100110...
result:
ok meet maximum 80310
Test #28:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
349
output:
000000111101000011100101111111101110001110110100011111100110110110010001101111101010010010100110100111100000100100001010001011101111001001110000110001100111010010110111010110101011000100010011000010000001011001100101011100111110001010101000001101011110110000000001000111000100101110000001100100100110...
result:
ok meet maximum 58821
Test #29:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
526
output:
000000011111000010000011101000110011011111011010110001001011100001100000110010011101010110111000111001001010100011101100111011101111111110111101110011110110001101010100111100100001011001000110111010111101010010110000001001101101101001000000110110010101100110011111110011100110101110010110100000001011...
result:
ok meet maximum 134925
Test #30:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1018
output:
000000011111000010000011101000110011011111011010110001001011100001100000110010011101010110111000111001001010100011101100111011101111111110111101110011110110001101010100111100100001011001000110111010111101010010110000001001101101101001000000110110010101100110011111110011100110101110010110100000001011...
result:
ok meet maximum 510567
Test #31:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
1017
output:
000000011111000010000011101000110011011111011010110001001011100001100000110010011101010110111000111001001010100011101100111011101111111110111101110011110110001101010100111100100001011001000110111010111101010010110000001001101101101001000000110110010101100110011111110011100110101110010110100000001011...
result:
ok meet maximum 509558
Test #32:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
1209
output:
000000001111111000111100000010001110110000011100110000010100110100110110110111111111101111110110111011111001101100101111011010101111000010100010100100100111111110011111001001100111101010010100011100100000011101110000110000100100101111111010111101001010101110000010000110110100111110110011011101011100...
result:
ok meet maximum 721446
Test #33:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
1632
output:
000000001111111000111100000010001110110000011100110000010100110100110110110111111111101111110110111011111001101100101111011010101111000010100010100100100111111110011111001001100111101010010100011100100000011101110000110000100100101111111010111101001010101110000010000110110100111110110011011101011100...
result:
ok meet maximum 1318299
Test #34:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
1829
output:
000000001111111000111100000010001110110000011100110000010100110100110110110111111111101111110110111011111001101100101111011010101111000010100010100100100111111110011111001001100111101010010100011100100000011101110000110000100100101111111010111101001010101110000010000110110100111110110011011101011100...
result:
ok meet maximum 1657336
Test #35:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
3187
output:
000000000111111111001111111000011111001100111000000001001111110100011110110100110100110000110000011000011100001100100110000010000011101011100101110100011010110100011100110100100000110010111000001101001110001100010010000101001011011100110010100000001110111110010101110001111010010011011001000010000101...
result:
ok meet maximum 5049170
Test #36:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
2138
output:
000000000111111111001111111000011111001100111000000001001111110100011110110100110100110000110000011000011100001100100110000010000011101011100101110100011010110100011100110100100000110010111000001101001110001100010010000101001011011100110010100000001110111110010101110001111010010011011001000010000101...
result:
ok meet maximum 2267222
Test #37:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
4030
output:
000000000111111111001111111000011111001100111000000001001111110100011110110100110100110000110000011000011100001100100110000010000011101011100101110100011010110100011100110100100000110010111000001101001110001100010010000101001011011100110010100000001110111110010101110001111010010011011001000010000101...
result:
ok meet maximum 8082284
Test #38:
score: 0
Accepted
time: 1ms
memory: 4040kb
input:
6101
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 18549195
Test #39:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
5917
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 17445655
Test #40:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
6635
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 21943566
Test #41:
score: 0
Accepted
time: 0ms
memory: 4300kb
input:
9993
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 49821572
Test #42:
score: 0
Accepted
time: 1ms
memory: 4068kb
input:
14474
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 104583873
Test #43:
score: 0
Accepted
time: 1ms
memory: 4096kb
input:
11534
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 66388863
Test #44:
score: 0
Accepted
time: 2ms
memory: 4272kb
input:
19098
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 182141836
Test #45:
score: 0
Accepted
time: 2ms
memory: 4208kb
input:
31872
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 507514777
Test #46:
score: 0
Accepted
time: 2ms
memory: 4244kb
input:
27626
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 381257844
Test #47:
score: 0
Accepted
time: 4ms
memory: 5044kb
input:
43245
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 934503599
Test #48:
score: 0
Accepted
time: 4ms
memory: 5156kb
input:
34491
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 594380060
Test #49:
score: 0
Accepted
time: 4ms
memory: 5024kb
input:
64535
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 2081512994
Test #50:
score: 0
Accepted
time: 9ms
memory: 6852kb
input:
65746
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2160380385
Test #51:
score: 0
Accepted
time: 4ms
memory: 6908kb
input:
65861
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2167946005
Test #52:
score: 0
Accepted
time: 9ms
memory: 6820kb
input:
66725
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2225209765
Test #53:
score: 0
Accepted
time: 6ms
memory: 6900kb
input:
86349
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 3726867681
Test #54:
score: 0
Accepted
time: 9ms
memory: 6732kb
input:
68454
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2342045211
Test #55:
score: 0
Accepted
time: 6ms
memory: 6832kb
input:
112260
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 6299544960
Test #56:
score: 0
Accepted
time: 9ms
memory: 6800kb
input:
108023
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 5832941098
Test #57:
score: 0
Accepted
time: 6ms
memory: 6800kb
input:
103787
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 5384393176
Test #58:
score: 0
Accepted
time: 4ms
memory: 6772kb
input:
128710
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8281268235
Test #59:
score: 0
Accepted
time: 4ms
memory: 6760kb
input:
129534
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8387651991
Test #60:
score: 0
Accepted
time: 4ms
memory: 6900kb
input:
128670
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8276121255
Test #61:
score: 0
Accepted
time: 15ms
memory: 10620kb
input:
154721
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 11967003302
Test #62:
score: 0
Accepted
time: 15ms
memory: 10748kb
input:
143149
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 10243718420
Test #63:
score: 0
Accepted
time: 18ms
memory: 10684kb
input:
134065
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 8984762318
Test #64:
score: 0
Accepted
time: 20ms
memory: 10832kb
input:
163454
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 13356170345
Test #65:
score: 0
Accepted
time: 15ms
memory: 10556kb
input:
139150
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 9679327553
Test #66:
score: 0
Accepted
time: 16ms
memory: 10704kb
input:
172380
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 14854850208
Test #67:
score: 0
Accepted
time: 19ms
memory: 10708kb
input:
178166
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 15868884317
Test #68:
score: 0
Accepted
time: 14ms
memory: 10716kb
input:
143651
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 10315696937
Test #69:
score: 0
Accepted
time: 15ms
memory: 10700kb
input:
198199
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 19638413795
Test #70:
score: 0
Accepted
time: 16ms
memory: 10672kb
input:
186272
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 17345817782
Test #71:
score: 0
Accepted
time: 20ms
memory: 10572kb
input:
198102
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 19619194797
Test #72:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
8201
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 33542145
Test #73:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
8202
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 33550335
Test #74:
score: 0
Accepted
time: 1ms
memory: 4060kb
input:
8203
output:
111111111110111011101001111010001010110010000011101111001001010111011100101001001100010001011111110110111011010010010110011001111011011111100001100111000111010111110100001000010010001110111010111100101001101110011010011101001100011101101100011110000010101111001110001010111110110000000111110000101010...
result:
ok meet maximum 33558526
Test #75:
score: 0
Accepted
time: 1ms
memory: 4100kb
input:
8204
output:
111111111111101111111011000110111110111000001101101000110101111111100100111001101110110010010111010101111000110101000111101011101110001101011001111000100111000011110101100111000010010101111101010100010011101101111001100001010001111000111011000100011110010110110111100010000100001001110011111101101101...
result:
ok meet maximum 33566718
Test #76:
score: 0
Accepted
time: 1ms
memory: 4088kb
input:
8205
output:
000000000000111111110001011100000011110101000111001011100111111111011011110111000011101101100001100111110100011001011111001111000010111001110111110100100001010000011000100001010010011000000110011010010000111000001000101001101000001011110001011010000010011100011111010010100101001000010000000111000110...
result:
ok meet maximum 33574910
Test #77:
score: 0
Accepted
time: 1ms
memory: 4328kb
input:
8206
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 33583103
Test #78:
score: 0
Accepted
time: 1ms
memory: 4036kb
input:
16394
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 134193153
Test #79:
score: 0
Accepted
time: 0ms
memory: 4264kb
input:
16395
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 134209535
Test #80:
score: 0
Accepted
time: 1ms
memory: 4032kb
input:
16396
output:
111111111111011111110110001101111101110000011011010001101011111111001001110011011101100100101110101011110001101010001111010111011100011010110011110001001110000111101011001110000100101011111010101000100111011011110011000010100011110001110110001000111100101101101111000100001000010011100111111011011010...
result:
ok meet maximum 134225918
Test #81:
score: 0
Accepted
time: 2ms
memory: 4524kb
input:
16397
output:
111111111111110101010101011011101110110011100100110100010101001111010001010000111101000011101001011011100000011001000110001111110110111010100110010010000011111111100100000000010101100110000100111100011111101000100000011110101100100001110010101101110101110011011011011110011001100001011010010010110010...
result:
ok meet maximum 134242302
Test #82:
score: 0
Accepted
time: 0ms
memory: 4352kb
input:
16398
output:
000000000000011001100110001111000011101111011011100101100110111110010110010100000110101111001001110000101010001001011101000000011100001100100010010010101111111111011010101010011000100010100100000101111111001011010101111100111011010111101100111000011000010001110001111101110111010110001101101100010011...
result:
ok meet maximum 134258686
Test #83:
score: 0
Accepted
time: 2ms
memory: 4208kb
input:
16399
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 134275071
Test #84:
score: 0
Accepted
time: 0ms
memory: 4204kb
input:
32779
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 536821761
Test #85:
score: 0
Accepted
time: 0ms
memory: 4268kb
input:
32780
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 536854527
Test #86:
score: 0
Accepted
time: 0ms
memory: 4472kb
input:
32781
output:
111111111111101010101010110111011101100111001001101000101010011110100010100001111010000111010010110111000000110010001100011111101101110101001100100100000111111111001000000000101011001100001001111000111111010001000000111101011001000011100101011011101011100110110110111100110011000010110100100101100101...
result:
ok meet maximum 536887294
Test #87:
score: 0
Accepted
time: 2ms
memory: 5080kb
input:
32782
output:
111111111111111011111111111110011111111111101011111111111000011111111110111011111111100110011111111010101011111110000000011111101111111011111001111110011110101111101011100001111000011011101110111010011001100110001010101010101100000000000001011111111111100011111111111011011111111110010011111111101001...
result:
ok meet maximum 536920062
Test #88:
score: 0
Accepted
time: 3ms
memory: 5128kb
input:
32783
output:
000000000000001111111111111110111111111111100111111111111010111111111110000111111111101110111111111001100111111110101010111111100000000111111011111110111110011111100111101011111010111000011110000110111011101110100110011001100010101010101011000000000000010111111111111000111111111110110111111111100100...
result:
ok meet maximum 536952830
Test #89:
score: 0
Accepted
time: 0ms
memory: 5020kb
input:
32784
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 536985599
Test #90:
score: 0
Accepted
time: 4ms
memory: 5152kb
input:
65548
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 2147385345
Test #91:
score: 0
Accepted
time: 0ms
memory: 5080kb
input:
65549
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 2147450879
Test #92:
score: 0
Accepted
time: 4ms
memory: 5092kb
input:
65550
output:
111111111111110111111111111100111111111111010111111111110000111111111101110111111111001100111111110101010111111100000000111111011111110111110011111100111101011111010111000011110000110111011101110100110011001100010101010101011000000000000010111111111111000111111111110110111111111100100111111111010010...
result:
ok meet maximum 2147516414
Test #93:
score: 0
Accepted
time: 5ms
memory: 7024kb
input:
65551
output:
111111111111111101111111111010010111110111010111001000010010100101110110000101100010001111000100001101011000110000000001101000111100000110110101000000111001011010011100010101000111101011010110111000100001100111000110011101111101110100010010000111000111011011111111001110101110001010100101110101100101...
result:
ok meet maximum 2147581950
Test #94:
score: 0
Accepted
time: 5ms
memory: 7084kb
input:
65552
output:
000000000000000111111111110010011111100001100001001010010011011000011101011000101101000001011010111001110100010101010111001011111010100011100110101011110110001101111010011001011111001110011100001011010111011110100010000111111000011010010010100001011110001111111110111100111101001100100111100111011000...
result:
ok meet maximum 2147647486
Test #95:
score: 0
Accepted
time: 9ms
memory: 6764kb
input:
65553
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2147713023
Test #96:
score: 0
Accepted
time: 9ms
memory: 6832kb
input:
131085
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8589737985
Test #97:
score: 0
Accepted
time: 4ms
memory: 6936kb
input:
131086
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8589869055
Test #98:
score: 0
Accepted
time: 6ms
memory: 7004kb
input:
131087
output:
111111111111111011111111110100101111101110101110010000100101001011101100001011000100011110001000011010110001100000000011010001111000001101101010000001110010110100111000101010001111010110101101110001000011001110001100111011111011101000100100001110001110110111111110011101011100010101001011101011001011...
result:
ok meet maximum 8590000126
Test #99:
score: 0
Accepted
time: 6ms
memory: 11004kb
input:
131088
output:
111111111111111110111111111111101101111111111011111011111110110110110111101111111111101011011111111010011110111110101100101101101001101101111110110111111011101111101110110011011011001110101111111010001001011110101001111010101000110010100000100010110010110110010110110111110110111111101101111101111011...
result:
ok meet maximum 8590131198
Test #100:
score: 0
Accepted
time: 4ms
memory: 10876kb
input:
131089
output:
000000000000000011111111111111000111111111110000001111111100011100011111000000000000110001111111110010000011111100111011000111001000111000000011100000001111000000111100010001110001000011000000001101001001111100110111110011001011101100101011010011101100011101100011100000011100000000111000000111110000...
result:
ok meet maximum 8590262270
Test #101:
score: 0
Accepted
time: 15ms
memory: 10604kb
input:
131090
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 8590393343
Test #102:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
8197
output:
000000000011110000110111110010110011101101010000111110110110011110000100110110111010010110000000011100001110010010011101110111110001111111010111011110100001100000011010110101101101000011110011111011001000111101110010000110111010000111000101111101010011000001000010110011111100010101011111101011001101...
result:
ok meet maximum 33509395
Test #103:
score: 0
Accepted
time: 1ms
memory: 4296kb
input:
16328
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 133114152
Test #104:
score: 0
Accepted
time: 2ms
memory: 4312kb
input:
32608
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 531233481
Test #105:
score: 0
Accepted
time: 4ms
memory: 5024kb
input:
65141
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 2120796035
Test #106:
score: 0
Accepted
time: 5ms
memory: 6852kb
input:
130420
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8502797880
Test #107:
score: 0
Accepted
time: 0ms
memory: 3988kb
input:
8265
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 34068260
Test #108:
score: 0
Accepted
time: 2ms
memory: 4436kb
input:
16508
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 136067031
Test #109:
score: 0
Accepted
time: 0ms
memory: 5108kb
input:
33008
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 544351055
Test #110:
score: 0
Accepted
time: 6ms
memory: 6868kb
input:
65964
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2174733396
Test #111:
score: 0
Accepted
time: 18ms
memory: 10872kb
input:
131692
output:
000000000000000111111111111110001111111111100000011111111000111000111110000000000001100011111111100100000111111001110110001110010001110000000111000000011110000001111000100011100010000110000000011010010011111001101111100110010111011001010110100111011000111011000111000000111000000001110000001111100000...
result:
ok meet maximum 8669480792
Test #112:
score: 0
Accepted
time: 1ms
memory: 4300kb
input:
15843
output:
000000000001111111100010111000000111101010001110010111001111111110110111101110000111011011000011001111101000110010111110011110000101110011101111101001000010100000110001000010100100110000001100110100100001110000010001010011010000010111100010110100000100111000111110100101001010010000100000001110001100...
result:
ok meet maximum 125318747
Test #113:
score: 0
Accepted
time: 0ms
memory: 4272kb
input:
31560
output:
000000000000110011001100011110000111011110110111001011001101111100101100101000001101011110010011100001010100010010111010000000111000011001000100100101011111111110110101010100110001000101001000001011111110010110101011111001110110101111011001110000110000100011100011111011101110101100011011011000100110...
result:
ok meet maximum 497623597
Test #114:
score: 0
Accepted
time: 4ms
memory: 5060kb
input:
64241
output:
000000000000011111111111111101111111111111001111111111110101111111111100001111111111011101111111110011001111111101010101111111000000001111110111111101111100111111001111010111110101110000111100001101110111011101001100110011000101010101010110000000000000101111111111110001111111111101101111111111001001...
result:
ok meet maximum 2062587185
Test #115:
score: 0
Accepted
time: 9ms
memory: 6868kb
input:
73307
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 2685953056
Test #116:
score: 0
Accepted
time: 9ms
memory: 6916kb
input:
129593
output:
000000000000001111111111100100111111000011000010010100100110110000111010110001011010000010110101110011101000101010101110010111110101000111001101010111101100011011110100110010111110011100111000010110101110111101000100001111110000110100100101000010111100011111111101111001111010011001001111001110110001...
result:
ok meet maximum 8395295323