QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#437674 | #5434. Binary Substrings | chenxinyang2006 | AC ✓ | 70ms | 37424kb | C++20 | 3.7kb | 2024-06-09 15:07:01 | 2024-06-09 15:07:03 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;
template <class T>
void chkmax(T &x,T y){
if(x < y) x = y;
}
template <class T>
void chkmin(T &x,T y){
if(x > y) x = y;
}
inline int popcnt(int x){
return __builtin_popcount(x);
}
inline int ctz(int x){
return __builtin_ctz(x);
}
/*ll power(ll p,int k = mod - 2){
ll ans = 1;
while(k){
if(k % 2 == 1) ans = ans * p % mod;
p = p * p % mod;
k /= 2;
}
return ans;
}*/
int n,k;
vector <pii> G[1 << 19];
int cnt,cur[1 << 19],buc[1 << 19];
void add(int u,int v){
// printf("add %d->%d\n",u,v);
++cnt;
G[u].eb(mkp(v,cnt));
G[v].eb(mkp(u,cnt));
}
void addd(int u,int v){
++cnt;
G[u].eb(mkp(v,cnt));
}
vector <int> ans;
void dfs(int u){
for(int i = cur[u];i < SZ(G[u]);i = cur[u]){
cur[u] = i + 1;
int v = G[u][i].first;
if(buc[G[u][i].second]) continue;
buc[G[u][i].second] = 1;
dfs(v);
ans.eb(v & 1);
}
}
int nxt[1 << 19][2],val[1 << 19],idx[1 << 19],vis[1 << 19],sz[1 << 19];
int cut,remain;
int test(){
if(remain > sz[cut]) return 0;
int p = cut;
while(remain){
addd(p,nxt[p][1]);
p = nxt[p][1];
remain--;
}
return 1;
}
int main(){
// freopen("test.in","r",stdin);
scanf("%d",&n);
if(n == 1){
printf("0\n");
return 0;
}
if(n == 2){
printf("01\n");
return 0;
}
if(n == 3){
printf("101\n");
return 0;
}
if(n == 4){
printf("1001\n");
return 0;
}
while((1 << (k + 1)) + k <= n) k++;
// printf("k=%d\n",k);
rep(S,0,(1 << k) - 1) addd(S >> 1,S & ((1 << (k - 1)) - 1));
rep(u,0,(1 << (k - 1)) - 1) if(cur[u] < SZ(G[u])) dfs(u);
/* printf("semi ans\n");
for(int p:ans) printf("%d",p);
printf("\n");*/
memset(idx,-1,sizeof(idx));
memset(vis,-1,sizeof(vis));
rep(i,0,(1 << k) - 1){
rep(j,0,k - 1) if(ans[(i + j) % (1 << k)]) val[i] |= 1 << (k - 1 - j);
assert(idx[val[i]] == -1);
idx[val[i]] = i;
}
// rep(i,0,(1 << k) - 1) printf("%d ",val[i]);
// printf("\n");
rep(i,0,(1 << k) - 1) nxt[val[i]][0] = val[(i + 1) % (1 << k)];
rep(S,0,(1 << (k + 1)) - 1){
int u = S >> 1;
if((S & ((1 << k) - 1)) != nxt[u][0]) nxt[u][1] = S & ((1 << k) - 1);
}
cut = -1;
rep(u,0,(1 << k) - 1){
if(vis[u] != -1) continue;
int p = u;
while(vis[p] == -1){
vis[p] = 1;
p = nxt[p][1];
sz[u]++;
}
if(cut == -1 || sz[cut] < sz[u]) cut = u;
}
/* rep(u,0,(1 << k) - 1) printf("%d ",nxt[u][0]);
printf("\n");
rep(u,0,(1 << k) - 1) printf("%d ",nxt[u][1]);
printf("\n"); */
// return 0;
rep(u,0,(1 << k) - 1) G[u].clear();
memset(buc,0,sizeof(buc));
memset(cur,0,sizeof(cur));
memset(vis,-1,sizeof(vis));
cnt = 0;
remain = n - k - (1 << k) + 1;
/* printf("remain=%d cut=%d\n",remain,cut);
rep(u,0,(1 << k) - 1) printf("%d ",sz[u]);
printf("\n");*/
int ovo = 0;
rep(u,0,(1 << k) - 1){
if(!sz[u] || u == cut) continue;
ovo |= test();
if(ovo) break;
int p = u;
while(vis[p] == -1){
addd(p,nxt[p][1]);
vis[p] = 1;
p = nxt[p][1];
remain--;
}
}
if(!ovo) test();
rep(u,0,(1 << k) - 1) if(u != cut) addd(u,nxt[u][0]);
ans.clear();
dfs(nxt[cut][0]);
per(i,k - 1,0) printf("%d",nxt[cut][0] >> i & 1);
reverse(ans.begin(),ans.end());
for(int p:ans) printf("%d",p);
printf("\n");
//接下来视为长度为 k 的串之间的 transfer
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3720kb
input:
2
output:
01
result:
ok meet maximum 3
Test #2:
score: 0
Accepted
time: 5ms
memory: 16232kb
input:
5
output:
11001
result:
ok meet maximum 12
Test #3:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
1
output:
0
result:
ok meet maximum 1
Test #4:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
3
output:
101
result:
ok meet maximum 5
Test #5:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
4
output:
1001
result:
ok meet maximum 8
Test #6:
score: 0
Accepted
time: 0ms
memory: 16180kb
input:
6
output:
110010
result:
ok meet maximum 16
Test #7:
score: 0
Accepted
time: 0ms
memory: 16176kb
input:
7
output:
1101001
result:
ok meet maximum 21
Test #8:
score: 0
Accepted
time: 0ms
memory: 16172kb
input:
8
output:
11010001
result:
ok meet maximum 27
Test #9:
score: 0
Accepted
time: 5ms
memory: 16076kb
input:
9
output:
111010001
result:
ok meet maximum 34
Test #10:
score: 0
Accepted
time: 0ms
memory: 16092kb
input:
10
output:
0111010001
result:
ok meet maximum 42
Test #11:
score: 0
Accepted
time: 0ms
memory: 16092kb
input:
11
output:
01110100010
result:
ok meet maximum 50
Test #12:
score: 0
Accepted
time: 5ms
memory: 16124kb
input:
12
output:
011101000101
result:
ok meet maximum 59
Test #13:
score: 0
Accepted
time: 54ms
memory: 37424kb
input:
200000
output:
000000000000010000011111101111011111110000111110000000010110000011101111010011101000111110011000101110000010001110100011110011100010111000010000101010001111011110101011000001111100101001110100000100101100010111110110100110010000011100110011011111000100010001111101110111011100000111100001000111110000...
result:
ok meet maximum 19996962278
Test #14:
score: 0
Accepted
time: 3ms
memory: 16176kb
input:
24
output:
001111010010000101011001
result:
ok meet maximum 240
Test #15:
score: 0
Accepted
time: 0ms
memory: 16164kb
input:
35
output:
00110111000101001111101011001000001
result:
ok meet maximum 526
Test #16:
score: 0
Accepted
time: 5ms
memory: 16168kb
input:
30
output:
001101110100100001010110011110
result:
ok meet maximum 381
Test #17:
score: 0
Accepted
time: 2ms
memory: 16176kb
input:
45
output:
000111001111101100101001100010000010110101110
result:
ok meet maximum 882
Test #18:
score: 0
Accepted
time: 0ms
memory: 16176kb
input:
66
output:
000110111100000010110011101000111110110101011100100101001100010000
result:
ok meet maximum 1953
Test #19:
score: 0
Accepted
time: 5ms
memory: 16176kb
input:
50
output:
00011101000100000101100111110110101110010100110001
result:
ok meet maximum 1097
Test #20:
score: 0
Accepted
time: 5ms
memory: 16076kb
input:
80
output:
00001111001111110110111001011001101001001110001010001100001000000101110101011110
result:
ok meet maximum 2901
Test #21:
score: 0
Accepted
time: 0ms
memory: 16076kb
input:
107
output:
00001101100011101111100000010111001111010000111111011011101010111100101100110100100111000101000110000100000
result:
ok meet maximum 5277
Test #22:
score: 0
Accepted
time: 0ms
memory: 16112kb
input:
81
output:
000011110110111001110001010001100001000000101110101011110010110011010010011111101
result:
ok meet maximum 2976
Test #23:
score: 0
Accepted
time: 2ms
memory: 16184kb
input:
147
output:
000100000001111111011101010111011011110101111100101110011010001001000111000010100001100000100110110011101001010100110010011110001011000110101101010
result:
ok meet maximum 10124
Test #24:
score: 0
Accepted
time: 0ms
memory: 16196kb
input:
255
output:
000100010101100101001001011011010011100100011001100010000011011100011110110000111011111100000010111100111110100000000111111101110101000111000010100001100000100110101110110111101011010101111100101110011011001110100101010011001001111000101100011010001001000
result:
ok meet maximum 31130
Test #25:
score: 0
Accepted
time: 0ms
memory: 16244kb
input:
173
output:
00010001010110010111010100011001100010000000111111101110110111101011100110100010010001110000101000011000001001101100111010010101001100100111100010110001101011010101111100101
result:
ok meet maximum 14115
Test #26:
score: 0
Accepted
time: 0ms
memory: 16104kb
input:
288
output:
000010000000011111111011101111010100001100110011110100101101001101010011101000101010001100100010001111000010110000110100001001000011100000101000001100000010011100100101001001111100010111000110110001001100011101011110110111110101101101011101010101111110010111100110111001110110010101100110
result:
ok meet maximum 39850
Test #27:
score: 0
Accepted
time: 2ms
memory: 16228kb
input:
407
output:
000010001011011101000111001100001000010101110010100010010111011010001010011001011001001101101100111000100000000111111110111011110101000011001101001000110101100011000101010001100100010001111000010110000110100001001000011100000101000001100000010011101011110110111110101101101011101010101111110010111100...
result:
ok meet maximum 80310
Test #28:
score: 0
Accepted
time: 0ms
memory: 16208kb
input:
349
output:
000010000000011111111011101111010100001100110100100011010110001100010100110010110010011011011001110001000111100001011000011010000100100001110000010100000110000001001110101111011011111010110110101110101010111111001011110011011100111011001010110011001111010010110100110101001110010010100100111110001011...
result:
ok meet maximum 58821
Test #29:
score: 0
Accepted
time: 0ms
memory: 16256kb
input:
526
output:
000001000000000111111111011110111011111011011011111101011011101011101101011110101011010101011111110010111110011011110011101110010101110011110110010110110011010110011100110011111010010111010011011010011101010010101010011001010011110010010110010011010010010011111100010111100011011100010011100011101100...
result:
ok meet maximum 134925
Test #30:
score: 0
Accepted
time: 0ms
memory: 16276kb
input:
1018
output:
000001000110110110001110001010001010101100101010010011001101100100011101011000011000110100110001011001100100100010011011101100111100010000010101111001010000100101111011010000111001110000100001011011110100111110111000001111011111111000000001011111100111111101000000011011111000111111011000000111011110...
result:
ok meet maximum 510567
Test #31:
score: 0
Accepted
time: 0ms
memory: 16260kb
input:
1017
output:
000001000110110110001110001010001010101100101010010011001101100100011101011000011000110100110001011001100100100010011011101100111100010000010101111001010000100101111011010000111001110000100001011011110100111111101000000011011111000111111011000000111011110000111110111000001111011111111000000001011111...
result:
ok meet maximum 509558
Test #32:
score: 0
Accepted
time: 0ms
memory: 16232kb
input:
1209
output:
000000100000000001111111111011110111110111011111101010000001100111101001000001101011110001100000101001110101011110101010000110010111100100111101101100001110001101000101001011101011010001100010111001100110010001011001000110100100010010010001110001000101000100011111100001011110000110111000010011100001...
result:
ok meet maximum 721446
Test #33:
score: 0
Accepted
time: 0ms
memory: 16272kb
input:
1632
output:
000000100000000110111111000111111101100000001110111110000111111011100000011110111100000111110111111111000000000101111111001111111101000000000001111111111011110111110111011000111100010100001010101110010101000100101011101101010001110010111000100100010101101110101001111001011000010010011010110110010100...
result:
ok meet maximum 1318299
Test #34:
score: 0
Accepted
time: 0ms
memory: 16352kb
input:
1829
output:
000000100011101101111001101000010001011110111010000111100111000001000010111011110100011111001100000010000001010111110010100000100101111101101000001110011101000100001101101110001110000101000110101011000110010011000100110011101100100001110101110000110000101100111001001000010011011110110011111000100000...
result:
ok meet maximum 1657336
Test #35:
score: 0
Accepted
time: 3ms
memory: 16452kb
input:
3187
output:
000000010000000101011111100101000000100101111110110100000011100111101000100000110110111100011100000101000110110101100011100100110000100110011110110010000011101011110000110000010110011101010010000110011011110010001111101011000000110001110110011000011101001101000101100101110100100111100110110000100010...
result:
ok meet maximum 5049170
Test #36:
score: 0
Accepted
time: 2ms
memory: 16468kb
input:
2138
output:
000000010000000000011111111111011111011110111111011101111111010100000001100111110100100000011010111110001100000010100111101001001011010010011010100100111001001001010010010011111101000101111010001101110100010011101000111011010001010110100011001101000111101010001011010100011010101000100101010001110010...
result:
ok meet maximum 2267222
Test #37:
score: 0
Accepted
time: 2ms
memory: 16644kb
input:
4030
output:
000000010001111011011111001101000001000101111101110100000111100111100000100000101110111110100011111100110000000100001101110111100111010000100001011110111101000011111001110000001000000101101111101100111111000100000001010111111001010000001001011111101101000000111001111010001000001101101111000111000001...
result:
ok meet maximum 8082284
Test #38:
score: 0
Accepted
time: 3ms
memory: 16732kb
input:
6101
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 18549195
Test #39:
score: 0
Accepted
time: 0ms
memory: 16740kb
input:
5917
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 17445655
Test #40:
score: 0
Accepted
time: 3ms
memory: 16856kb
input:
6635
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 21943566
Test #41:
score: 0
Accepted
time: 0ms
memory: 17360kb
input:
9993
output:
000000000100000000010101111111100101000000001001011111111011010000000011100111111010001000000011011011111100011100000001010001111011010110000011100100111010001001100010111011001100111100010001000001010111011111010100011111100101110000001001000111011011011110011010011110110010110000111010100110100011...
result:
ok meet maximum 49821572
Test #42:
score: 0
Accepted
time: 5ms
memory: 17544kb
input:
14474
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 104583873
Test #43:
score: 0
Accepted
time: 2ms
memory: 17556kb
input:
11534
output:
000000000100000000010101111111100101000000001001011111111011010000000011100111111010001000000011011011111100011100000001010001111011010110000011100100111010001001100010111011001100111100010001000001010111011111010100011111100101110000001001000111011011011110011010011110110010110000111010100110100011...
result:
ok meet maximum 66388863
Test #44:
score: 0
Accepted
time: 6ms
memory: 18320kb
input:
19098
output:
000000000100000111011110111110001111100000010100000110111010111100011110010000101000010011110101111011000011000001110111001111000011110100001011000010111101001101010000110100101011110010110101000010010010101111011011010100001110001010111100010101010000101010101011100101010101000100101010101110110101...
result:
ok meet maximum 182141836
Test #45:
score: 0
Accepted
time: 7ms
memory: 19064kb
input:
31872
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 507514777
Test #46:
score: 0
Accepted
time: 3ms
memory: 18636kb
input:
27626
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 381257844
Test #47:
score: 0
Accepted
time: 16ms
memory: 22660kb
input:
43245
output:
000000000001000011111101110111111100011110000000010100001111011101011100000111100100011011000010011100100111001100010011000100010101100111011101010010000111100101101111000010010010000101101101101111010011100011111001100010100000100011101011111011100011000000111101100111101000011101000010111100010111...
result:
ok meet maximum 934503599
Test #48:
score: 0
Accepted
time: 7ms
memory: 20796kb
input:
34491
output:
000000000001000000000000000111111111111111011111110111111011110001111111000001010000000101110101111110011101010001010011101011110101100011000001100011100111110011100010000001000011101111110111111110111110111111111011110111101111111111011101111011111011101111101111011101111110111011101111111111101010...
result:
ok meet maximum 594380060
Test #49:
score: 0
Accepted
time: 14ms
memory: 22300kb
input:
64535
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2081512994
Test #50:
score: 0
Accepted
time: 27ms
memory: 24836kb
input:
65746
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101010000000000001100111111111101001000000000001101011111111110001100000000000101001111...
result:
ok meet maximum 2160380385
Test #51:
score: 0
Accepted
time: 18ms
memory: 24888kb
input:
65861
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101010000000000001100111111111101001000000000001101011111111110001100000000000101001111...
result:
ok meet maximum 2167946005
Test #52:
score: 0
Accepted
time: 21ms
memory: 24936kb
input:
66725
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011000011110000011011110000110110010000101100100110111101001101100100001100110110010000100011011001000011110101100100001011010110010000110101011001000010010101100...
result:
ok meet maximum 2225209765
Test #53:
score: 0
Accepted
time: 23ms
memory: 27264kb
input:
86349
output:
000000000000100000000000000001111111111111111011111110111000011111111000010110000000010110100111111010100101100000011001101001111010011001011000011010011010011010010110010110010110100100110110100101101100100101101001001001001110011011011011000100011100010011101110001010110001000101010100111011101010...
result:
ok meet maximum 3726867681
Test #54:
score: 0
Accepted
time: 16ms
memory: 24888kb
input:
68454
output:
000000000000100000000000000001111111111111111011111110111000011111111000010110000000010110100111111010100101100000011001101001111010011001011000011010011010011010010110010110010110100100110110100101101100100101101001001001001110011011011011000100011100010011101110001010110001000101010100111011101010...
result:
ok meet maximum 2342045211
Test #55:
score: 0
Accepted
time: 25ms
memory: 27236kb
input:
112260
output:
000000000000100001111111011101111111100011110000000001010000111110111010111000000111100100011101100001001110001001111011000101011000011011101010011010010001100110010110111001100100111000010001101100011110111001001100000111101011001110100001100011000101111001110011001110011000100010000100011101110111...
result:
ok meet maximum 6299544960
Test #56:
score: 0
Accepted
time: 29ms
memory: 28120kb
input:
108023
output:
000000000000100001111111011101111111100011110000000001010000111110111010111000000111100100011101100001001110001001111011000101011000011011101010011010010001100110010110111001100100111000010001101100011110111001001100000111101011001110100001100011000101111001110011001110011000100010000100011101110111...
result:
ok meet maximum 5832941098
Test #57:
score: 0
Accepted
time: 16ms
memory: 25620kb
input:
103787
output:
000000000000100001111111011101111111100011110000000001010000111110111010111000000111100100011101100001001110001001111011000101011000011011101010011010010001100110010110111001100100111000010001101100011110111001001100000111101011001110100001100011000101111001110011001110011000100010000100011101110111...
result:
ok meet maximum 5384393176
Test #58:
score: 0
Accepted
time: 31ms
memory: 28012kb
input:
128710
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8281268235
Test #59:
score: 0
Accepted
time: 26ms
memory: 28012kb
input:
129534
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8387651991
Test #60:
score: 0
Accepted
time: 31ms
memory: 29188kb
input:
128670
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8276121255
Test #61:
score: 0
Accepted
time: 52ms
memory: 34364kb
input:
154721
output:
000000000000010000000000000101011111111111100101000000000000100101111111111110110100000000000011100111111111101000100000000000110110111111111100011100000000000101000111111110110101100000000011100100111111101000100110000000110110110011111010011100010000001101000111011111100101110001111111010100010100...
result:
ok meet maximum 11967003302
Test #62:
score: 0
Accepted
time: 42ms
memory: 34212kb
input:
143149
output:
000000000000010000000000000000011111111111111111011111111011000001111111110001110100000000010100010111111111010111010000000001100001011111111100111001111111000100001000000001010111101111111101010000111111111001011110000000001001000011111011101101110000001111000100011101100001010111000100111101010001...
result:
ok meet maximum 10243718420
Test #63:
score: 0
Accepted
time: 37ms
memory: 34172kb
input:
134065
output:
000000000000010000000000000000011111111111111111011111111011100001111111110000101100000000010110100111111101010010110000000110011010011111010011001011000001101001101001110100101100101100010110100110100110010010110010110011011010010011011001001011011001001001001110001001101101100010101100100100110010...
result:
ok meet maximum 8984762318
Test #64:
score: 0
Accepted
time: 43ms
memory: 36300kb
input:
163454
output:
000000000000010000000000000101011111111111100101000000000000100101111111111110110100000000000011100111111111101000100000000000110110111111111100011100000000000101000111111110110101100000000011100100111111101000100110000000110110110011111010011100010000001101000111011111100101110001111111010100010100...
result:
ok meet maximum 13356170345
Test #65:
score: 0
Accepted
time: 63ms
memory: 34344kb
input:
139150
output:
000000000000010000000000000000011111111111111111011111111011100001111111110000101100000000010110100111111101010010110000000110011010011111010011001011000001101001101001110100101100101100010110100110100110010010110010110011011010010011011001001011011001001001001110001001101101100010101100100100110010...
result:
ok meet maximum 9679327553
Test #66:
score: 0
Accepted
time: 63ms
memory: 34248kb
input:
172380
output:
000000000000010000111111110111011111111100011110000000000101000011111101110101110000000111100100011110110000100111000010011110110001101011000011011100101001101001000100101100101101110110100100111000011100110110001101000100011011100101110111001000100100011101101110110111000111000011100001010001111000...
result:
ok meet maximum 14854850208
Test #67:
score: 0
Accepted
time: 67ms
memory: 34944kb
input:
178166
output:
000000000000010000111111110111011111111100011110000000000101000011111101110101110000000111100100011110110000100111000010011110110001101011000011011100101001101001000100101100101101110110100100111000011100110110001101000100011011100101110111001000100100011101101110110111000111000011100001010001111000...
result:
ok meet maximum 15868884317
Test #68:
score: 0
Accepted
time: 61ms
memory: 34532kb
input:
143651
output:
000000000000010000000000000000011111111111111111011111111011000001111111110001110100000000010100010111111111010111010000000001100001011111111100111001111111000100001000000001010111101111111101010000111111111001011110000000001001000011111011101101110000001111000100011101100001010111000100111101010001...
result:
ok meet maximum 10315696937
Test #69:
score: 0
Accepted
time: 70ms
memory: 34468kb
input:
198199
output:
000000000000010000011111101111011111110000111110000000010110000011101111010011101000111110011000101110000010001110100011110011100010111000010000101010001111011110101011000001111100101001110100000100101100010111110110100110010000011100110011011111000100010001111101110111011100000111100001000111110000...
result:
ok meet maximum 19638413795
Test #70:
score: 0
Accepted
time: 58ms
memory: 36068kb
input:
186272
output:
000000000000010001111111111011011111111111001101000000000001000101111111111101110100000000000111100111111111010000100000000001101110111111111100111010000000000100001011111111110111101000000000011111001111111101000001000000000110111101111111110011110100000000010000010111111111011111010000000001111110...
result:
ok meet maximum 17345817782
Test #71:
score: 0
Accepted
time: 64ms
memory: 36048kb
input:
198102
output:
000000000000010000011111101111011111110000111110000000010110000011101111010011101000111110011000101110000010001110100011110011100010111000010000101010001111011110101011000001111100101001110100000100101100010111110110100110010000011100110011011111000100010001111101110111011100000111100001000111110000...
result:
ok meet maximum 19619194797
Test #72:
score: 0
Accepted
time: 3ms
memory: 17080kb
input:
8201
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 33542145
Test #73:
score: 0
Accepted
time: 3ms
memory: 16988kb
input:
8202
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 33550335
Test #74:
score: 0
Accepted
time: 0ms
memory: 17164kb
input:
8203
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 33558526
Test #75:
score: 0
Accepted
time: 0ms
memory: 17300kb
input:
8204
output:
000000000100000000000001111111111111011111101111101111111011110111111110111011110111011101111111110110111011111011011110111101101111101110110111111011011011101101101101111111111010110111111101011101111110101111011111010111110111101011011011110101111110111010110111011101011101101110101111010111010111...
result:
ok meet maximum 33566718
Test #76:
score: 0
Accepted
time: 4ms
memory: 17224kb
input:
8205
output:
000000000100000000000001111111111111011111101111101111111011110111111110111011110111011101111111110110111011111011011110111101101111101110110111111011011011101101101101111111111010110111111101011101111110101111011111010111110111101011011011110101111110111010110111011101011101101110101111010111010111...
result:
ok meet maximum 33574910
Test #77:
score: 0
Accepted
time: 3ms
memory: 17288kb
input:
8206
output:
000000000100000000000001111111111111011111101111101111111011110111111110111011110111011101111111110110111011111011011110111101101111101110110111111011011011101101101101111111111010110111111101011101111110101111011111010111110111101011011011110101111110111010110111011101011101101110101111010111010111...
result:
ok meet maximum 33583103
Test #78:
score: 0
Accepted
time: 4ms
memory: 17996kb
input:
16394
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 134193153
Test #79:
score: 0
Accepted
time: 4ms
memory: 17916kb
input:
16395
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 134209535
Test #80:
score: 0
Accepted
time: 8ms
memory: 18076kb
input:
16396
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 134225918
Test #81:
score: 0
Accepted
time: 0ms
memory: 18340kb
input:
16397
output:
000000000100000000000000111111111111110111111011111110111110111111110111101111111110111011110111101110111110111011101111111111011011101111110110111101111101101111101111011011111101110110111011011111110110110111011101101101111011011011011111111111010110111111110101110111111101011110111111010111110111...
result:
ok meet maximum 134242302
Test #82:
score: 0
Accepted
time: 0ms
memory: 18440kb
input:
16398
output:
000000000100000000000000111111111111110111111011111110111110111111110111101111111110111011110111101110111110111011101111111111011011101111110110111101111101101111101111011011111101110110111011011111110110110111011101101101111011011011011111111111010110111111110101110111111101011110111111010111110111...
result:
ok meet maximum 134258686
Test #83:
score: 0
Accepted
time: 5ms
memory: 18324kb
input:
16399
output:
000000000100000000000000111111111111110111111011111110111110111111110111101111111110111011110111101110111110111011101111111111011011101111110110111101111101101111101111011011111101110110111011011111110110110111011101101101111011011011011111111111010110111111110101110111111101011110111111010111110111...
result:
ok meet maximum 134275071
Test #84:
score: 0
Accepted
time: 4ms
memory: 19624kb
input:
32779
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 536821761
Test #85:
score: 0
Accepted
time: 8ms
memory: 19680kb
input:
32780
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 536854527
Test #86:
score: 0
Accepted
time: 8ms
memory: 19712kb
input:
32781
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 536887294
Test #87:
score: 0
Accepted
time: 12ms
memory: 20652kb
input:
32782
output:
000000000001000000000000000111111111111111011111110111111011111111011111011111111101111011110111111111101110111101111101110111110111101110111111011101110111111111110110111011111110110111101111110110111110111110110111111011110110111111101110110111011101110110111101101110110111111110110110111011110110...
result:
ok meet maximum 536920062
Test #88:
score: 0
Accepted
time: 9ms
memory: 20616kb
input:
32783
output:
000000000001000000000000000111111111111111011111110111111011111111011111011111111101111011110111111111101110111101111101110111110111101110111111011101110111111111110110111011111110110111101111110110111110111110110111111011110110111111101110110111011101110110111101101110110111111110110110111011110110...
result:
ok meet maximum 536952830
Test #89:
score: 0
Accepted
time: 8ms
memory: 20572kb
input:
32784
output:
000000000001000000000000000111111111111111011111110111111011111111011111011111111101111011110111111111101110111101111101110111110111101110111111011101110111111111110110111011111110110111101111110110111110111110110111111011110110111111101110110111011101110110111101101110110111111110110110111011110110...
result:
ok meet maximum 536985599
Test #90:
score: 0
Accepted
time: 14ms
memory: 23228kb
input:
65548
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2147385345
Test #91:
score: 0
Accepted
time: 12ms
memory: 23236kb
input:
65549
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2147450879
Test #92:
score: 0
Accepted
time: 12ms
memory: 23140kb
input:
65550
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2147516414
Test #93:
score: 0
Accepted
time: 24ms
memory: 24904kb
input:
65551
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101101110111111110110111101111111011011111011111101101111110111110110111111101111011011...
result:
ok meet maximum 2147581950
Test #94:
score: 0
Accepted
time: 22ms
memory: 24924kb
input:
65552
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101101110111111110110111101111111011011111011111101101111110111110110111111101111011011...
result:
ok meet maximum 2147647486
Test #95:
score: 0
Accepted
time: 21ms
memory: 24916kb
input:
65553
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101101110111111110110111101111111011011111011111101101111110111110110111111101111011011...
result:
ok meet maximum 2147713023
Test #96:
score: 0
Accepted
time: 29ms
memory: 30104kb
input:
131085
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8589737985
Test #97:
score: 0
Accepted
time: 36ms
memory: 29996kb
input:
131086
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8589869055
Test #98:
score: 0
Accepted
time: 35ms
memory: 30292kb
input:
131087
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8590000126
Test #99:
score: 0
Accepted
time: 39ms
memory: 33624kb
input:
131088
output:
000000000000010000000000000000011111111111111111011111111011111110111111111011111101111111111011111011111111111011110111110111110111101111110111101111011111111111101110111101111111011101111101111110111011111101111101110111111101111011101111111101110111011110111011101110111111111111101101110111111111...
result:
ok meet maximum 8590131198
Test #100:
score: 0
Accepted
time: 55ms
memory: 34140kb
input:
131089
output:
000000000000010000000000000000011111111111111111011111111011111110111111111011111101111111111011111011111111111011110111110111110111101111110111101111011111111111101110111101111111011101111101111110111011111101111101110111111101111011101111111101110111011110111011101110111111111111101101110111111111...
result:
ok meet maximum 8590262270
Test #101:
score: 0
Accepted
time: 53ms
memory: 34200kb
input:
131090
output:
000000000000010000000000000000011111111111111111011111111011111110111111111011111101111111111011111011111111111011110111110111110111101111110111101111011111111111101110111101111111011101111101111110111011111101111101110111111101111011101111111101110111011110111011101110111111111111101101110111111111...
result:
ok meet maximum 8590393343
Test #102:
score: 0
Accepted
time: 0ms
memory: 16988kb
input:
8197
output:
000000001000111110110111111001101000000100010111111011101000000111100111101000010000011011101111100111010000010000101111101111010000011111001111000000100000101111011111010000111111001110000000100001110111011100001111000010110000101101001101010010110010101101001001010010110110101101001110010010110001...
result:
ok meet maximum 33509395
Test #103:
score: 0
Accepted
time: 5ms
memory: 17988kb
input:
16328
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 133114152
Test #104:
score: 0
Accepted
time: 3ms
memory: 19372kb
input:
32608
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 531233481
Test #105:
score: 0
Accepted
time: 16ms
memory: 23184kb
input:
65141
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2120796035
Test #106:
score: 0
Accepted
time: 30ms
memory: 28432kb
input:
130420
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8502797880
Test #107:
score: 0
Accepted
time: 3ms
memory: 17256kb
input:
8265
output:
000000000100000000000001111111111111011111101111101111111011110111111110111011110111011101111111110101000000000110011111110100100000000110110000000010011000000001110100000000101010000000011001000000001000100000000111100000000010110000000001101000000000100100000000011100000000001010000000000110000000...
result:
ok meet maximum 34068260
Test #108:
score: 0
Accepted
time: 3ms
memory: 18364kb
input:
16508
output:
000000000100000000000000111111111111110111111011111110111110111111110111010000000011110011111101000010000000110111011111110011101000101100111010001101001110100010010011101000111000111010001111110110100010111101101000110111011010001001110110100011101101101000101011011010001100110110100011110101101000...
result:
ok meet maximum 136067031
Test #109:
score: 0
Accepted
time: 11ms
memory: 20680kb
input:
33008
output:
000000000001000000000000000111111111111111011111110111111011111111011111011111111101111011110111111111101110111101111101110111110111101110111111011101110111111111110101000000000001100111111111010010000000000110101111111110001100000000001010011111111010101111111110101010000000001100101111111110010011...
result:
ok meet maximum 544351055
Test #110:
score: 0
Accepted
time: 28ms
memory: 24820kb
input:
65964
output:
000000000000100000000000000001111111111111111011111110111111110111111011111111101111101111111111011110111110111101111011111111111011101111011111101110111110111110111011111101111011101111111011101110111011111111111101010000000000001100111111111101001000000000001101011111111110001100000000000101001111...
result:
ok meet maximum 2174733396
Test #111:
score: 0
Accepted
time: 56ms
memory: 36012kb
input:
131692
output:
000000000000010000000000000000011111111111111111011111111011111110111111111011111101111111111011111011111111111011110111110111110111101111110111101111011111111111101110111101111111011101111101111110111011111101111101110111111101111011101111111101110111011110111011101110111111111111101010000000000000...
result:
ok meet maximum 8669480792
Test #112:
score: 0
Accepted
time: 2ms
memory: 17844kb
input:
15843
output:
000000000100011111101101111111001101000000010001011111110111010000000111100111110100001000000110111011111100111010000001000010111111011110100000011111001111100000010000001011110111111010000111111100111000000001000011110111011111000111100000010100001101110101110001111001000101000010011101011110110001...
result:
ok meet maximum 125318747
Test #113:
score: 0
Accepted
time: 11ms
memory: 18960kb
input:
31560
output:
000000000100001111101110111111000111100000001010000111011101011100001111001000110100001001110010111101100010010000111011011011100001110001000110100011001110010111001000010010001101111011011100111110001110110000010100010011111010111011000001100001001111100111101100000100000110111110111110011111100000...
result:
ok meet maximum 497623597
Test #114:
score: 0
Accepted
time: 16ms
memory: 22632kb
input:
64241
output:
000000000001000111111110110111111111001101000000000100010111111111011101000000000111100111111101000010000000011011101111111100111010000000010000101111111101111010000000011111001111110100000100000001101111011111110011110100000001000001011111110111110100000001111110011111100000001000000010111110111111...
result:
ok meet maximum 2062587185
Test #115:
score: 0
Accepted
time: 22ms
memory: 24884kb
input:
73307
output:
000000000000100000000000000001111111111111111011111110111000011111111000010110000000010110100111111010100101100000011001101001111010011001011000011010011010011010010110010110010110100100110110100101101100100101101001001001001110011011011011000100011100010011101110001010110001000101010100111011101010...
result:
ok meet maximum 2685953056
Test #116:
score: 0
Accepted
time: 49ms
memory: 28284kb
input:
129593
output:
000000000000100011111111101101111111111001101000000000010001011111111110111010000000000111100111111110100001000000000110111011111111100111010000000001000010111111111011110100000000011111001111111010000010000000011011110111111110011110100000000100000101111111101111101000000001111110011111101000000100...
result:
ok meet maximum 8395295323