QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#306335 | #5434. Binary Substrings | NemanjaSo2005 | AC ✓ | 20ms | 50964kb | C++14 | 4.0kb | 2024-01-16 17:25:56 | 2024-01-16 17:25:57 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define int long long
using namespace std;
int N,M,K;
const int maxn=(1<<20)+5;
vector<int> graf[maxn];
int perm[maxn],sleduje[maxn];
bool bio[maxn],uzmi[maxn];
priority_queue<pair<int,int>> PQ;
void getcycle(int x){
if(bio[x])
return;
int gde=x,s=0;
//cout<<"PRATIM "<<gde<<endl;
do {
s++;
bio[gde]=true;
// cout<<gde<<endl;
gde=perm[gde];
} while(gde!=x);
// cout<<"CIKLUS "<<s<<" "<<x<<endl;
PQ.push({s,x});
}
int count_substrings(string x) {
unordered_set<string> substrings;
// Iterate over all substrings
for (int i = 0; i < x.length(); ++i) {
string substring = "";
for (int j = i; j < x.length(); ++j) {
substring.push_back(x[j]);
substrings.insert(substring);
}
}
// Return the count of distinct substrings
return substrings.size();
}
void napravi(int k){
M=1<<(k-1);
for(int i=0;i<(1<<(k));i++){
int a=i>>1;
int b=i&((1<<(k-1))-1);
graf[a].push_back(b);
}
}
vector<int> V,R;
void poperm(int gde){
R.push_back(gde);
if(perm[gde]==0)
return;
int p=perm[gde];
perm[gde]=0;
poperm(p);
}
void euler(int gde){
while(graf[gde].size()){
int ko=graf[gde].back();
graf[gde].pop_back();
euler(ko);
}
V.push_back(gde);
}
void pisivektor(vector<int> V){
for(int i=0;i<V.size();i++)
cout<<V[i]<<" ";
cout<<endl;
}
signed main(){
cin>>N;
if(N==1){
cout<<"0\n";
return 0;
}
if(N==2){
cout<<"01\n";
return 0;
}
if(N==3){
cout<<"010\n";
return 0;
}
if(N==4){
cout<<"1001\n";
return 0;
}
for(int i=0;i<=20;i++){
if((1<<i)+i-1<=N)
K=i;
}
// cout<<"DUZINA JE "<<K<<endl;
napravi(K);
euler(0);
reverse(V.begin(),V.end());
string poc="";
if(((1<<(K))+K-1)!=N){
vector<int> B;
for(int i=1;i<V.size();i++)
B.push_back((V[i-1]<<1) + (V[i]&1));
/*
cout<<"NIZ B"<<endl;
pisivektor(B);*/
B.push_back(B[0]);
for(int i=0;i+1<B.size();i++)
perm[B[i]]=B[i+1]^1;
for(int i=0;i+1<B.size();i++)
sleduje[B[i]]=B[i+1];
/*
cout<<"PERM:"<<endl;
for(int i=0;i<B.size();i++)
cout<<perm[i]<<" ";
cout<<endl;
cout<<"SLEDUJE:"<<endl;
for(int i=0;i<B.size();i++)
cout<<sleduje[i]<<" ";
cout<<endl;
*/
for(int i=0;i+1<B.size();i++)
getcycle(B[i]);
int dod=N-((1<<K)+K-1);
//cout<<"DOD JE "<<dod<<endl;
vector<pair<int,int>> odbac;
while(PQ.size()){
if(dod==0)
break;
if(PQ.top().first>dod){
odbac.push_back(PQ.top());
PQ.pop();
}
else{
dod-=PQ.top().first;
uzmi[PQ.top().second]=true;
PQ.pop();
}
}
int poc=0;
if(odbac.size() and dod!=0){
poc=sleduje[odbac[0].second];
uzmi[odbac[0].second]=true;
}
/* cout<<"POCETAK JE "<<poc<<endl;
cout<<"UZIMAM:"<<endl;
for(int i=0;i<B.size();i++)
cout<<uzmi[i]<<" ";
cout<<endl;
*/
for(int i=(1<<(K-1));i>=2;i>>=1)
R.push_back((i&poc)>=1);
// cout<<R.size()<<endl;
for(int it=1;it<B.size();it++){
if(uzmi[poc])
poperm(poc);
else
R.push_back(poc);
poc=sleduje[poc];
}/*
cout<<"CEO R je "<<endl;
for(int i=0;i<R.size();i++)
cout<<R[i]<<" ";
cout<<endl;*/
}
else{
//cout<<"OVAKAV"<<endl;
for(int i=1;i<K;i++)
cout<<"0";
for(int i=1;i<V.size();i++)
cout<<(V[i]&1);
cout<<endl;
return 0;
}
string X;
for(int i=0;i<N;i++)
X.push_back('0'+(R[i]&1));
cout<<X<<"\n";
//cout<<count_substrings(X)<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 28968kb
input:
2
output:
01
result:
ok meet maximum 3
Test #2:
score: 0
Accepted
time: 5ms
memory: 29448kb
input:
5
output:
01100
result:
ok meet maximum 12
Test #3:
score: 0
Accepted
time: 0ms
memory: 28932kb
input:
1
output:
0
result:
ok meet maximum 1
Test #4:
score: 0
Accepted
time: 0ms
memory: 28452kb
input:
3
output:
010
result:
ok meet maximum 5
Test #5:
score: 0
Accepted
time: 6ms
memory: 28428kb
input:
4
output:
1001
result:
ok meet maximum 8
Test #6:
score: 0
Accepted
time: 3ms
memory: 33372kb
input:
6
output:
001110
result:
ok meet maximum 16
Test #7:
score: 0
Accepted
time: 0ms
memory: 33176kb
input:
7
output:
0010110
result:
ok meet maximum 21
Test #8:
score: 0
Accepted
time: 0ms
memory: 32496kb
input:
8
output:
00101110
result:
ok meet maximum 27
Test #9:
score: 0
Accepted
time: 7ms
memory: 32952kb
input:
9
output:
001011100
result:
ok meet maximum 34
Test #10:
score: 0
Accepted
time: 0ms
memory: 30052kb
input:
10
output:
0011101000
result:
ok meet maximum 42
Test #11:
score: 0
Accepted
time: 0ms
memory: 32860kb
input:
11
output:
00011110100
result:
ok meet maximum 50
Test #12:
score: 0
Accepted
time: 7ms
memory: 33760kb
input:
12
output:
000111101000
result:
ok meet maximum 59
Test #13:
score: 0
Accepted
time: 15ms
memory: 50192kb
input:
200000
output:
111111100111111111111110101111111111111100011111111111110110111111111111101001111111111111001011111100000001111000001000000100001111101111110111100001100000110000111100111110011110001010000101000001101011110101111100101000011100000110111111000111110110000010010000110011111011011110101000001011000010...
result:
ok meet maximum 19996962278
Test #14:
score: 0
Accepted
time: 3ms
memory: 33144kb
input:
24
output:
001111101100101000010011
result:
ok meet maximum 240
Test #15:
score: 0
Accepted
time: 0ms
memory: 33520kb
input:
35
output:
00001001101011100011111011001010000
result:
ok meet maximum 526
Test #16:
score: 0
Accepted
time: 0ms
memory: 33704kb
input:
30
output:
001111101100101000010011010111
result:
ok meet maximum 381
Test #17:
score: 0
Accepted
time: 2ms
memory: 32388kb
input:
45
output:
000111111011011100110101011000101001000001001
result:
ok meet maximum 882
Test #18:
score: 0
Accepted
time: 0ms
memory: 32888kb
input:
66
output:
000001001110100011001011110000111110110111001101010110001010010000
result:
ok meet maximum 1953
Test #19:
score: 0
Accepted
time: 6ms
memory: 34028kb
input:
50
output:
00011111101101110011010101100010100100000100111010
result:
ok meet maximum 1097
Test #20:
score: 0
Accepted
time: 0ms
memory: 33552kb
input:
80
output:
00001111111011110011101011100011011010010100110010110000101010001001000000100011
result:
ok meet maximum 2901
Test #21:
score: 0
Accepted
time: 0ms
memory: 34228kb
input:
107
output:
00001111111011001101010110111011110011101011100011011010010100110010110000101010001001000000100011100100111
result:
ok meet maximum 5277
Test #22:
score: 0
Accepted
time: 3ms
memory: 32888kb
input:
81
output:
000011111110111100111010111000110110100101001100101100001010100010010000001000111
result:
ok meet maximum 2976
Test #23:
score: 0
Accepted
time: 0ms
memory: 32612kb
input:
147
output:
111011111001111010111100011101101110100111001011100001101100110101010110100011001001100010110000010101001010000100100010000000111111110110001101001
result:
ok meet maximum 10124
Test #24:
score: 0
Accepted
time: 3ms
memory: 32552kb
input:
255
output:
000001111111101100011010010010110110101100101011101110011001110101000101001101111011111001111010111100011101101110100111001011100001101100110101010110100011001001100010110000010101001010000100100010000000100011110010000111000100111110100000110000101111110
result:
ok meet maximum 31130
Test #25:
score: 0
Accepted
time: 3ms
memory: 32744kb
input:
173
output:
11101111100111101011110001110110111010011100101110000110110011010101011010001100100110001011000001010100101000010010001000000011111111011000110100100101101101011001010111011
result:
ok meet maximum 14115
Test #26:
score: 0
Accepted
time: 0ms
memory: 33448kb
input:
288
output:
111101111110011111010111110001111011011011110100111100101111000011101110110011101010101101010111010001110011011100100111000101110000011011010110110001101010010101001101001011010000110011001010110010001100010011000010110000001010101000101001001010000010010000100010000000011111111101100001
result:
ok meet maximum 39850
Test #27:
score: 0
Accepted
time: 0ms
memory: 33976kb
input:
407
output:
111101111110011111010111110001111011011011110100111100101111000011101110110011101010101101010111010001110011011100100111000101110000011011010110110001101010010101001101001011010000110011001010110010001100010011000010110000001010101000101001001010000010010000100010000000010000111100010001111100100000...
result:
ok meet maximum 80310
Test #28:
score: 0
Accepted
time: 6ms
memory: 32232kb
input:
349
output:
000000001000011110001000111110010000011100001001111110100000011000001011111110000000111111111011111100111110101111100011110110111101001111001011110000111011101100111010101011010101110100011100110111001001110001011100000110110101101100011010100110100101101000011001100101011001000110001001100001011000...
result:
ok meet maximum 58821
Test #29:
score: 0
Accepted
time: 0ms
memory: 32272kb
input:
526
output:
111110111111100111111010111111000111110110111110100111110010111110000111101110111101100111101010111101000111100110111100100111100010111100000111011100111011010111011000111010110111010100111010010111010000111001100111001010111001000111000110111000100111000010111000000110110110100110110010110110000110...
result:
ok meet maximum 134925
Test #30:
score: 0
Accepted
time: 0ms
memory: 32328kb
input:
1018
output:
011010111011000111010110111010100111010010111010000111001100111001010111001000111000110111000100111000010111000000110110110100110110010110110000110101100110101010101101010001101001001101000101101000001100110001100101001100100101100100001100010101100010001100001001100000101100000001010101001010100001...
result:
ok meet maximum 510567
Test #31:
score: 0
Accepted
time: 3ms
memory: 33076kb
input:
1017
output:
011010111011000111010110111010100111010010111010000111001100111001010111001000111000110111000100111000010111000000110110110100110110010110110000110101100110101010101101010001101001001101000101101000001100110001100101001100100101100100001100010101100010001100001001100000101100000001010101001010100001...
result:
ok meet maximum 509558
Test #32:
score: 0
Accepted
time: 0ms
memory: 34336kb
input:
1209
output:
111111011111111001111111010111111100011111101101111110100111111001011111100001111101110111110110011111010101111101000111110011011111001001111100010111110000011110111101110011110110101111011000111101011011110101001111010010111101000011110011101111001100111100101011110010001111000110111100010011110000...
result:
ok meet maximum 721446
Test #33:
score: 0
Accepted
time: 0ms
memory: 33292kb
input:
1632
output:
000000000011111111111011000000110100000100101111101111000011000100010011101110010011000110110100101100101101001101001111001101000111001100100111001111100101000011101100010011001110110101001100101001011101011010001010010011010110010010100110110111100101100001101010001001010111011011100010110001110101...
result:
ok meet maximum 1318299
Test #34:
score: 0
Accepted
time: 3ms
memory: 33728kb
input:
1829
output:
000000000011111111111011000000110100000100101111101111000011000100010011101110010011000110110100101100101101001101001111001101000111001100100111001111100101000011101100010011001110110101001100101001011101011010001010010011010110010010100110110111100101100001101010001001010111011011100010110001110101...
result:
ok meet maximum 1657336
Test #35:
score: 0
Accepted
time: 3ms
memory: 34136kb
input:
3187
output:
000000000001111111111101100000001101000000100101111110111100000110001000010011101111011001100011001100001011100111101001010000101101011110100111000011110010001000011011101111001001100001101101000101100101110100110100011110011001000111001111110010100000111011000010011001111011010100011001011111001111...
result:
ok meet maximum 5049170
Test #36:
score: 0
Accepted
time: 0ms
memory: 33572kb
input:
2138
output:
111111101111110001100000111101000010000101111011110100011000010001001111011111111100111111110101111111100011111110110111111101001111111001011111110000111111011101111110110011111101010111111010001111110011011111100100111111000101111110000011111011110111110111001111101101011111011000111110101101111101...
result:
ok meet maximum 2267222
Test #37:
score: 0
Accepted
time: 3ms
memory: 33972kb
input:
4030
output:
111011111111100111110001010000111101100010001100111011101010011000101001011110101111000011100010001000111011100010011000111011010010011001011011001101001011100101101000110100111110011010000111001100010011100111011001010011001101011011100101011000110101010010010101011011010101011001010101011101010111...
result:
ok meet maximum 8082284
Test #38:
score: 0
Accepted
time: 0ms
memory: 33596kb
input:
6101
output:
111111110111111111100111111000101000001111011000010001100111101110101000110001010001011110101110100001110001100010011110011111111101011111000011100001000100001110111000010011000111101101001000110010110111001101011001110010101010011101010111100010111000011101001000100010110111011101011001100010101110...
result:
ok meet maximum 18549195
Test #39:
score: 0
Accepted
time: 3ms
memory: 34468kb
input:
5917
output:
111111110111111111100111111000101000001111011000010001100111101110101000110001010001011110101110100001110001100010011110011111111101011111000011100001000100001110111000010011000111101101001000110010110111001101011001110010101010011101010111100010111000011101001000100010110111011101011001100010101110...
result:
ok meet maximum 17445655
Test #40:
score: 0
Accepted
time: 3ms
memory: 34084kb
input:
6635
output:
111111110111111111100111111000101000001111011000010001100111101110101000110001010001011110101110100001110001100010011110011111111101011111000011100001000100001110111000010011000111101101001000110010110111001101011001110010101010011101010111100010111000011101001000100010110111011101011001100010101110...
result:
ok meet maximum 21943566
Test #41:
score: 0
Accepted
time: 0ms
memory: 33788kb
input:
9993
output:
111111111011111111111001111000000101000111111101100100000011001101111110011011000001110010100001001110101111011000111000010100100111110101110100000111000110000100111100111101100010100011001110101110111000111000100100100111101101111100001011000001111010100001000010101111011110111000110001100000101111...
result:
ok meet maximum 49821572
Test #42:
score: 0
Accepted
time: 4ms
memory: 34024kb
input:
14474
output:
000000000000010000001111111000001000000011111100000010000011111111000010000000011111000000010000111111111000100000000011110000000010001111111111001000000000011100000000010011111111111010000000000011000000000010111111111111000000000000111111111111101100000000011010000000010010111111110111100000001100...
result:
ok meet maximum 104583873
Test #43:
score: 0
Accepted
time: 3ms
memory: 33392kb
input:
11534
output:
111111111011111110000110000001111101000001000001011111011111010000110000010000100111110111111111110011110000001010001111111011001000000110011011111100110110000011100101000010011101011110110001110000101001001111101011101000001110001100001001111001111011000101000110011101011101110001110001001001001111...
result:
ok meet maximum 66388863
Test #44:
score: 0
Accepted
time: 0ms
memory: 34324kb
input:
19098
output:
111111101111111111110011111111111010111111111110001111111111011011111111110100111111111100101111111111000011111111101110111111111011001111111110101011111111101000111111111001101111111110010011111111100010111111111000001111111101111011111111011100111111110110101111111101100011111111010110111111110101...
result:
ok meet maximum 182141836
Test #45:
score: 0
Accepted
time: 8ms
memory: 33872kb
input:
31872
output:
000000000000001111111111111110110000000000110100000000010010111111111011110000000011000100000001001110111111101100110000001100110000000101110011111110100101000000010110101111111010011100000001111001000000100001101111110111101100000110000101111110011111100000101000001111110110000100000110011110111110...
result:
ok meet maximum 507514777
Test #46:
score: 0
Accepted
time: 3ms
memory: 33544kb
input:
27626
output:
000000000000001000000011111110000001000000111111110000010000000011111100000001000001111111110000100000000011111000000001000011111111110001000000000011110000000001000111111111110010000000000011100000000001001111111111110100000000000011000000000001011111111111110000000000000111111111111111011100000000...
result:
ok meet maximum 381257844
Test #47:
score: 0
Accepted
time: 0ms
memory: 36316kb
input:
43245
output:
111111111110111111110000011000000011111101000000100000010111111011111101000001100000010000010011111101111111111111001111111111110101110000000001110010000000010001101111111101110110000000110001010000001000110101111110111001110000011001010010000100110101101111011001010110001100110101001110011001011110...
result:
ok meet maximum 934503599
Test #48:
score: 0
Accepted
time: 7ms
memory: 35748kb
input:
34491
output:
111111111110111111111111100111111111111010111111111111000111111000001001000001111110111000010000011000111101111100111000110000101001111001111010110001010000101001110101111010110001110000101010010011111010101110100000101110001011111010001111100000110010000100001001101111011110110110001100011001001110...
result:
ok meet maximum 594380060
Test #49:
score: 0
Accepted
time: 0ms
memory: 41104kb
input:
64535
output:
110100101011111110100100011111110100011011111110100010011111110100001011111110100000011111110011111011111110011110011111110011101011111110011100011111110011011011111110011010011111110011001011111110011000011111110010111011111110010110011111110010101011111110010100011111110010011011111110010010011111...
result:
ok meet maximum 2081512994
Test #50:
score: 0
Accepted
time: 9ms
memory: 38304kb
input:
65746
output:
000000000000000011111111111111110111111111111110011111111111110101111111111111000111111111111011011111111111101001111111111110010111111111111000011111111111011101111111111101100111111111110101011111111111010001111111111100110111111111110010011111111111000101111111111100000111111111101111011111111110...
result:
ok meet maximum 2160380385
Test #51:
score: 0
Accepted
time: 11ms
memory: 39484kb
input:
65861
output:
111111111111011111111111111001111111111111010111111111111100011111111111101101111111111110100111111111111001011111111111100001111111111101110111111111110110011111111111010101111111111101000111111111110011011111111111001001111111111100010111111111110000011111111110111101111111111011100111111111101101...
result:
ok meet maximum 2167946005
Test #52:
score: 0
Accepted
time: 9ms
memory: 38732kb
input:
66725
output:
000000000000000011111111111111111011111111111111001111111111111010111111111111100011111111111101101111111111110100111111111111001011111111111100001111111111101110111111111110110011111111111010101111111111101000111111111110011011111111111001001111111111100010111111111110000011111111110111101111111111...
result:
ok meet maximum 2225209765
Test #53:
score: 0
Accepted
time: 11ms
memory: 40080kb
input:
86349
output:
111111111111011111111111111001111110000000101000001111111101100001000000011001111011111110011000110000001110011100000001001010001111111011011001000000110010011011111100110110110000011100100101000010001101101011110111001001110001100011001000111001110011111100011001010000011110011011000010001110010011...
result:
ok meet maximum 3726867681
Test #54:
score: 0
Accepted
time: 6ms
memory: 38192kb
input:
68454
output:
111111111111011111111111111001111111111111010111100000000011100010000000010001110111111110111001100000001100011001111111001110101000000101000101011111101011101110000001110001001000001000111011011111011100010110000110001110100111100111000110100010100100100101110101101101101000101011001001011101010011...
result:
ok meet maximum 2342045211
Test #55:
score: 0
Accepted
time: 3ms
memory: 39520kb
input:
112260
output:
111111111111011111111111111001111110000000101000001111111101100001000000011001111011111110011000110000001110011100000001001010001111111011011001000000110010011011111100110110110000011100100101000010001101101011110111001001110001100011001000111001110011111100011001010000011110011011000010001110010011...
result:
ok meet maximum 6299544960
Test #56:
score: 0
Accepted
time: 8ms
memory: 40256kb
input:
108023
output:
111111111111011111111111111001111110000000101000001111111101100001000000011001111011111110011000110000001110011100000001001010001111111011011001000000110010011011111100110110110000011100100101000010001101101011110111001001110001100011001000111001110011111100011001010000011110011011000010001110010011...
result:
ok meet maximum 5832941098
Test #57:
score: 0
Accepted
time: 8ms
memory: 39460kb
input:
103787
output:
111111111111011111111111111001111110000000101000001111111101100001000000011001111011111110011000110000001110011100000001001010001111111011011001000000110010011011111100110110110000011100100101000010001101101011110111001001110001100011001000111001110011111100011001010000011110011011000010001110010011...
result:
ok meet maximum 5384393176
Test #58:
score: 0
Accepted
time: 9ms
memory: 38756kb
input:
128710
output:
111001010011111111100100101111111110010000111111111000111011111111100011001111111110001010111111111000100011111111100001101111111110000100111111111000001011111111100000001111111101111110111111110111110011111111011110101111111101111000111111110111011011111111011101001111111101110010111111110111000011...
result:
ok meet maximum 8281268235
Test #59:
score: 0
Accepted
time: 13ms
memory: 38860kb
input:
129534
output:
000000000000000010000000011111111000000010000000111111111000000100000000011111110000000010000001111111111000001000000000011111100000000010000011111111111000010000000000011111000000000010000111111111111000100000000000011110000000000010001111111111111001000000000000011100000000000010011111111111111010...
result:
ok meet maximum 8387651991
Test #60:
score: 0
Accepted
time: 9ms
memory: 39484kb
input:
128670
output:
111001010011111111100100101111111110010000111111111000111011111111100011001111111110001010111111111000100011111111100001101111111110000100111111111000001011111111100000001111111101111110111111110111110011111111011110101111111101111000111111110111011011111111011101001111111101110010111111110111000011...
result:
ok meet maximum 8276121255
Test #61:
score: 0
Accepted
time: 11ms
memory: 50468kb
input:
154721
output:
111111111111101111111000000001100000010000000100111111011111110110000011000000110011111001111110011000010100000111001111010111110001100001110000011100111100011111000110001001000011110011101110001000101001100011101110101101001001100010100101101100111010110100101010001010010110101011101011010010111000...
result:
ok meet maximum 11967003302
Test #62:
score: 0
Accepted
time: 3ms
memory: 50536kb
input:
143149
output:
111111111111101111111111111110011111111111111010111111111111110001111111111111011011111111111110100111111111111100101111110000000111100000100000010000111110111111011110000110000011000011110011111001111000101000010100000110101111010111110010100001110000011011111100011111011000001001000011001111101101...
result:
ok meet maximum 10243718420
Test #63:
score: 0
Accepted
time: 16ms
memory: 50048kb
input:
134065
output:
111111111111101111111000000001100000010000000100111111011111110110000011000000110011111001111110011000010100000111001111010111110001100001110000011100111100011111000110001001000011110011101110001000101001100011101110101101001001100010100101101100111010110100101010001010010110101011101011010010111000...
result:
ok meet maximum 8984762318
Test #64:
score: 0
Accepted
time: 20ms
memory: 49920kb
input:
163454
output:
111111111111101111111000000001100000010000000100111111011111110110000011000000110011111001111110011000010100000111001111010111110001100001110000011100111100011111000110001001000011110011101110001000101001100011101110101101001001100010100101101100111010110100101010001010010110101011101011010010111000...
result:
ok meet maximum 13356170345
Test #65:
score: 0
Accepted
time: 20ms
memory: 50412kb
input:
139150
output:
111111111111101111111110000001100000000111111101000000010000000101111111011111110100000011000000010000001001111111011111111111111100111111111111110101111111111111100011111110000001001000000111111101110000010000001100011111011111100111000011000001010011111001111101011000010100000101001111010111110101...
result:
ok meet maximum 9679327553
Test #66:
score: 0
Accepted
time: 15ms
memory: 50064kb
input:
172380
output:
111111111111101111111000000001100000010000000100111111011111110110000011000000110011111001111110011000010100000111001111010111110001100001110000011100111100011111000110001001000011110011101110001000101001100011101110101101001001100010100101101100111010110100101010001010010110101011101011010010111000...
result:
ok meet maximum 14854850208
Test #67:
score: 0
Accepted
time: 15ms
memory: 50180kb
input:
178166
output:
000000000000000001111111111111111101111111111111110011111110000000101000000111111110110000010000000110011111011111110011000011000000111001111001111110001100010100000111100111011000010001010011001111011101011010100011000101001010001011110101101011101000010100111000101111010110001110100001010100100010...
result:
ok meet maximum 15868884317
Test #68:
score: 0
Accepted
time: 12ms
memory: 50964kb
input:
143651
output:
000000000000000001000000001111111110000000100000000011111111000000001000000011111111110000001000000000011111110000000001000000111111111110000010000000000011111100000000001000001111111111110000100000000000011111000000000001000011111111111110001000000000000011110000000000001000111111111111110010000000...
result:
ok meet maximum 10315696937
Test #69:
score: 0
Accepted
time: 17ms
memory: 50376kb
input:
198199
output:
111111100111111111111110101111111111111100011111111111110110111111111111101001111111111111001011111100000001111000001000000100001111101111110111100001100000110000111100111110011110001010000101000001101011110101111100101000011100000110111111000111110110000010010000110011111011011110101000001011000010...
result:
ok meet maximum 19638413795
Test #70:
score: 0
Accepted
time: 18ms
memory: 45264kb
input:
186272
output:
111111111111101111111111111110011111110000000101000000111111110110000010000000110011111011111110011000011000000111001111001111110001100010100000111100111011000010001010011001111011101011010100011000101001010001011110101101011101000010100111000101111010110001110100001010100100010001101010110111011100...
result:
ok meet maximum 17345817782
Test #71:
score: 0
Accepted
time: 16ms
memory: 45740kb
input:
198102
output:
111111100111111111111110101111111111111100011111111111110110111111111111101001111111111111001011111100000001111000001000000100001111101111110111100001100000110000111100111110011110001010000101000001101011110101111100101000011100000110111111000111110110000010010000110011111011011110101000001011000010...
result:
ok meet maximum 19619194797
Test #72:
score: 0
Accepted
time: 0ms
memory: 33548kb
input:
8201
output:
000000000000100000011111100000100000111111100001000000011111000000100001111111100010000000011110000000100011111111100100000000011100000000100111111111101000000000011000000000101111111111100000000000111111111111011000000001101000000010010111111101111000000110001000001001110111110110011000011001100000...
result:
ok meet maximum 33542145
Test #73:
score: 0
Accepted
time: 3ms
memory: 33700kb
input:
8202
output:
000000000000100000011111100000100000111111100001000000011111000000100001111111100010000000011110000000100011111111100100000000011100000000100111111111101000000000011000000000101111111111100000000000111111111111101100000000110100000001001011111110111100000011000100000100111011111011001100001100110000...
result:
ok meet maximum 33550335
Test #74:
score: 0
Accepted
time: 0ms
memory: 33560kb
input:
8203
output:
000000000000100000011111100000100000111111100001000000011111000000100001111111100010000000011110000000100011111111100100000000011100000000100111111111101000000000011000000000101111111111100000000000111111111111101100000000110100000001001011111110111100000011000100000100111011111011001100001100110000...
result:
ok meet maximum 33558526
Test #75:
score: 0
Accepted
time: 0ms
memory: 29068kb
input:
8204
output:
000000000000111111111111101111111111100111111111101011111111110001111111110110111111111010011111111100101111111110000111111110111011111111011001111111101010111111110100011111111001101111111100100111111110001011111111000001111111011110111111101110011111110110101111111011000111111101011011111110101001...
result:
ok meet maximum 33566718
Test #76:
score: 0
Accepted
time: 3ms
memory: 34024kb
input:
8205
output:
000000000000011111111111111011111111111001111111111010111111111100011111111101101111111110100111111111001011111111100001111111101110111111110110011111111010101111111101000111111110011011111111001001111111100010111111110000011111110111101111111011100111111101101011111110110001111111010110111111101010...
result:
ok meet maximum 33574910
Test #77:
score: 0
Accepted
time: 0ms
memory: 34232kb
input:
8206
output:
000000000000011111111111110111111111110011111111110101111111111000111111111011011111111101001111111110010111111111000011111111011101111111101100111111110101011111111010001111111100110111111110010011111111000101111111100000111111101111011111110111001111111011010111111101100011111110101101111111010100...
result:
ok meet maximum 33583103
Test #78:
score: 0
Accepted
time: 0ms
memory: 34712kb
input:
16394
output:
000000000000010000001111111000001000000011111100000010000011111111000010000000011111000000010000111111111000100000000011110000000010001111111111001000000000011100000000010011111111111010000000000011000000000010111111111111000000000000111111111111101100000000011010000000010010111111110111100000001100...
result:
ok meet maximum 134193153
Test #79:
score: 0
Accepted
time: 3ms
memory: 34304kb
input:
16395
output:
000000000000010000001111111000001000000011111100000010000011111111000010000000011111000000010000111111111000100000000011110000000010001111111111001000000000011100000000010011111111111010000000000011000000000010111111111111000000000000111111111111110110000000001101000000001001011111111011110000000110...
result:
ok meet maximum 134209535
Test #80:
score: 0
Accepted
time: 0ms
memory: 33880kb
input:
16396
output:
000000000000010000001111111000001000000011111100000010000011111111000010000000011111000000010000111111111000100000000011110000000010001111111111001000000000011100000000010011111111111010000000000011000000000010111111111111000000000000111111111111110110000000001101000000001001011111111011110000000110...
result:
ok meet maximum 134225918
Test #81:
score: 0
Accepted
time: 4ms
memory: 29996kb
input:
16397
output:
000000000000011111111111111011111111111100111111111110101111111111100011111111110110111111111101001111111111001011111111110000111111111011101111111110110011111111101010111111111010001111111110011011111111100100111111111000101111111110000011111111011110111111110111001111111101101011111111011000111111...
result:
ok meet maximum 134242302
Test #82:
score: 0
Accepted
time: 4ms
memory: 34964kb
input:
16398
output:
000000000000001111111111111110111111111111001111111111101011111111111000111111111101101111111111010011111111110010111111111100001111111110111011111111101100111111111010101111111110100011111111100110111111111001001111111110001011111111100000111111110111101111111101110011111111011010111111110110001111...
result:
ok meet maximum 134258686
Test #83:
score: 0
Accepted
time: 0ms
memory: 35052kb
input:
16399
output:
000000000000001111111111111110111111111111001111111111101011111111111000111111111101101111111111010011111111110010111111111100001111111110111011111111101100111111111010101111111110100011111111100110111111111001001111111110001011111111100000111111110111101111111101110011111111011010111111110110001111...
result:
ok meet maximum 134275071
Test #84:
score: 0
Accepted
time: 0ms
memory: 34128kb
input:
32779
output:
000000000000001000000011111110000001000000111111110000010000000011111100000001000001111111110000100000000011111000000001000011111111110001000000000011110000000001000111111111110010000000000011100000000001001111111111110100000000000011000000000001011111111111110000000000000111111111111110110000000000...
result:
ok meet maximum 536821761
Test #85:
score: 0
Accepted
time: 0ms
memory: 33956kb
input:
32780
output:
000000000000001000000011111110000001000000111111110000010000000011111100000001000001111111110000100000000011111000000001000011111111110001000000000011110000000001000111111111110010000000000011100000000001001111111111110100000000000011000000000001011111111111110000000000000111111111111111011000000000...
result:
ok meet maximum 536854527
Test #86:
score: 0
Accepted
time: 3ms
memory: 35344kb
input:
32781
output:
000000000000001000000011111110000001000000111111110000010000000011111100000001000001111111110000100000000011111000000001000011111111110001000000000011110000000001000111111111110010000000000011100000000001001111111111110100000000000011000000000001011111111111110000000000000111111111111111011000000000...
result:
ok meet maximum 536887294
Test #87:
score: 0
Accepted
time: 6ms
memory: 31064kb
input:
32782
output:
000000000000001111111111111110111111111111100111111111111010111111111111000111111111110110111111111110100111111111110010111111111110000111111111101110111111111101100111111111101010111111111101000111111111100110111111111100100111111111100010111111111100000111111111011110111111111011100111111111011010...
result:
ok meet maximum 536920062
Test #88:
score: 0
Accepted
time: 10ms
memory: 35776kb
input:
32783
output:
000000000000000111111111111111101111111111111001111111111110101111111111110001111111111101101111111111101001111111111100101111111111100001111111111011101111111111011001111111111010101111111111010001111111111001101111111111001001111111111000101111111111000001111111110111101111111110111001111111110110...
result:
ok meet maximum 536952830
Test #89:
score: 0
Accepted
time: 0ms
memory: 35836kb
input:
32784
output:
000000000000000111111111111111011111111111110011111111111101011111111111100011111111111011011111111111010011111111111001011111111111000011111111110111011111111110110011111111110101011111111110100011111111110011011111111110010011111111110001011111111110000011111111101111011111111101110011111111101101...
result:
ok meet maximum 536985599
Test #90:
score: 0
Accepted
time: 0ms
memory: 35888kb
input:
65548
output:
000000000000000100000001111111100000010000000011111110000000100000011111111100000100000000011111100000000100000111111111100001000000000011111000000000100001111111111100010000000000011110000000000100011111111111100100000000000011100000000000100111111111111101000000000000011000000000000101111111111111...
result:
ok meet maximum 2147385345
Test #91:
score: 0
Accepted
time: 6ms
memory: 35856kb
input:
65549
output:
000000000000000100000001111111100000010000000011111110000000100000011111111100000100000000011111100000000100000111111111100001000000000011111000000000100001111111111100010000000000011110000000000100011111111111100100000000000011100000000000100111111111111101000000000000011000000000000101111111111111...
result:
ok meet maximum 2147450879
Test #92:
score: 0
Accepted
time: 0ms
memory: 37004kb
input:
65550
output:
000000000000000100000001111111100000010000000011111110000000100000011111111100000100000000011111100000000100000111111111100001000000000011111000000000100001111111111100010000000000011110000000000100011111111111100100000000000011100000000000100111111111111101000000000000011000000000000101111111111111...
result:
ok meet maximum 2147516414
Test #93:
score: 0
Accepted
time: 7ms
memory: 33112kb
input:
65551
output:
000000000000000111111111111111101111111111111100111111111111101011111111111110001111111111110110111111111111010011111111111100101111111111110000111111111110111011111111111011001111111111101010111111111110100011111111111001101111111111100100111111111110001011111111111000001111111111011110111111111101...
result:
ok meet maximum 2147581950
Test #94:
score: 0
Accepted
time: 13ms
memory: 38596kb
input:
65552
output:
000000000000000011111111111111111011111111111111001111111111111010111111111111100011111111111101101111111111110100111111111111001011111111111100001111111111101110111111111110110011111111111010101111111111101000111111111110011011111111111001001111111111100010111111111110000011111111110111101111111111...
result:
ok meet maximum 2147647486
Test #95:
score: 0
Accepted
time: 3ms
memory: 38644kb
input:
65553
output:
000000000000000011111111111111111011111111111111001111111111111010111111111111100011111111111101101111111111110100111111111111001011111111111100001111111111101110111111111110110011111111111010101111111111101000111111111110011011111111111001001111111111100010111111111110000011111111110111101111111111...
result:
ok meet maximum 2147713023
Test #96:
score: 0
Accepted
time: 7ms
memory: 40180kb
input:
131085
output:
000000000000000010000000011111111000000010000000111111111000000100000000011111110000000010000001111111111000001000000000011111100000000010000011111111111000010000000000011111000000000010000111111111111000100000000000011110000000000010001111111111111001000000000000011100000000000010011111111111111010...
result:
ok meet maximum 8589737985
Test #97:
score: 0
Accepted
time: 5ms
memory: 44464kb
input:
131086
output:
000000000000000010000000011111111000000010000000111111111000000100000000011111110000000010000001111111111000001000000000011111100000000010000011111111111000010000000000011111000000000010000111111111111000100000000000011110000000000010001111111111111001000000000000011100000000000010011111111111111010...
result:
ok meet maximum 8589869055
Test #98:
score: 0
Accepted
time: 7ms
memory: 39556kb
input:
131087
output:
000000000000000010000000011111111000000010000000111111111000000100000000011111110000000010000001111111111000001000000000011111100000000010000011111111111000010000000000011111000000000010000111111111111000100000000000011110000000000010001111111111111001000000000000011100000000000010011111111111111010...
result:
ok meet maximum 8590000126
Test #99:
score: 0
Accepted
time: 9ms
memory: 38832kb
input:
131088
output:
000000000000000011111111111111111011111111111111100111111111111110101111111111111100011111111111110110111111111111101001111111111111001011111111111110000111111111111011101111111111110110011111111111101010111111111111010001111111111110011011111111111100100111111111111000101111111111110000011111111111...
result:
ok meet maximum 8590131198
Test #100:
score: 0
Accepted
time: 16ms
memory: 45788kb
input:
131089
output:
000000000000000001111111111111111110111111111111111001111111111111101011111111111111000111111111111101101111111111111010011111111111110010111111111111100001111111111110111011111111111101100111111111111010101111111111110100011111111111100110111111111111001001111111111110001011111111111100000111111111...
result:
ok meet maximum 8590262270
Test #101:
score: 0
Accepted
time: 18ms
memory: 50820kb
input:
131090
output:
000000000000000001111111111111111101111111111111110011111111111111010111111111111110001111111111111011011111111111110100111111111111100101111111111111000011111111111101110111111111111011001111111111110101011111111111101000111111111111001101111111111110010011111111111100010111111111111000001111111111...
result:
ok meet maximum 8590393343
Test #102:
score: 0
Accepted
time: 3ms
memory: 34572kb
input:
8197
output:
011010010111011010000111011001100111011001010111011001000111011000110111011000100111011000010111011000000111010111010111000111010110110111010110100111010110010111010110000111010101100111010101010101101010101011101010100011101010011011101010010011101010001011101010000011101001110011101001101011101001...
result:
ok meet maximum 33509395
Test #103:
score: 0
Accepted
time: 8ms
memory: 33968kb
input:
16328
output:
011010101011101101010001110110100110111011010010011101101000101110110100000111011001110011101100110101110110011000111011001011011101100101001110110010010111011001000011101100011001110110001010111011000100011101100001101110110000100111011000001011101100000001110101110100111010111001011101011100001110...
result:
ok meet maximum 133114152
Test #104:
score: 0
Accepted
time: 4ms
memory: 35168kb
input:
32608
output:
000000000000001000000011111110000001000000111111110000010000000011111100000001000001111111110000100000000011111000000001000011111111110001000000000011110000000001000111111111110010000000000011100000000001001111111111110100000000000011000000000001011111111111110000000000000111111111111110110000000000...
result:
ok meet maximum 531233481
Test #105:
score: 0
Accepted
time: 0ms
memory: 35804kb
input:
65141
output:
101011010101011101011010100011101011010011011101011010010011101011010001011101011010000011101011001110011101011001101011101011001100011101011001011011101011001010011101011001001011101011001000011101011000110011101011000101011101011000100011101011000011011101011000010011101011000001011101011000000011...
result:
ok meet maximum 2120796035
Test #106:
score: 0
Accepted
time: 0ms
memory: 38780kb
input:
130420
output:
101110100010111110111010000011111011100111101111101110011100111110111001101011111011100110001111101110010110111110111001010011111011100100101111101110010000111110111000111011111011100011001111101110001010111110111000100011111011100001101111101110000100111110111000001011111011100000001111101101111100...
result:
ok meet maximum 8502797880
Test #107:
score: 0
Accepted
time: 3ms
memory: 33200kb
input:
8265
output:
111111111011111111111001111111111010111111111100011111111101101111111110100111111111001011111111100001111111101110111111110110011111111010101111111101000111111110011011111111001001111111100010111111110000011111110111101111111011100111111101101011111110110001111111010110111111101010011111110100101111...
result:
ok meet maximum 34068260
Test #108:
score: 0
Accepted
time: 3ms
memory: 34192kb
input:
16508
output:
111111101111111111110011111111111010111111111110001111111111011011111111110100111111111100101111111111000011111111101110111111111011001111111110101011111111101000111111111001101111111110010011111111100010111111111000001111111101111011111111011100111111110110101111111101100011111111010110111111110101...
result:
ok meet maximum 136067031
Test #109:
score: 0
Accepted
time: 3ms
memory: 36256kb
input:
33008
output:
111111111110111111111111100111111111111010111111111111000111111111110110111111111110100111111111110010111111111110000111111111101110111111111101100111111111101010111111111101000111111111100110111111111100100111111111100010111111111100000111111111011110111111111011100111111111011010111111111011000111...
result:
ok meet maximum 544351055
Test #110:
score: 0
Accepted
time: 8ms
memory: 44368kb
input:
65964
output:
111111111111011111111111111001111111111111010111111111111100011111111111101101111111111110100111111111111001011111111111100001111111111101110111111111110110011111111111010101111111111101000111111111110011011111111111001001111111111100010111111111110000011111111110111101111111111011100111111111101101...
result:
ok meet maximum 2174733396
Test #111:
score: 0
Accepted
time: 7ms
memory: 45204kb
input:
131692
output:
111111111111101111111110000001100000000111111101000000010000000101111111011111110100000011000000010000001001111111011111111111111100111111111111110101111111111111100011111111111110110111111111111101001111111111111001011111111111110000111111111111011101111111111110110011111111111101010111111111111010...
result:
ok meet maximum 8669480792
Test #112:
score: 0
Accepted
time: 3ms
memory: 33488kb
input:
15843
output:
000000000000011111111111111011000000000110100000000100101111111101111000000011000100000010011101111110110011000001100110000001011100111111010010100000010110101111110100111000000111100100000100001101111101111011000011000010111110011110100001010000101111010111101000011100001111110010001000000110111011...
result:
ok meet maximum 125318747
Test #113:
score: 0
Accepted
time: 5ms
memory: 34556kb
input:
31560
output:
111111111011111000000011000010000001001111011111101100011000001100111001111100110010100001110011011000100111001001110110001111100010100100001111010111000100001110001110111100011100110001001001110011101101100101001100100110101100110110010101110010011011100011011011001001011001001101101001100101100100...
result:
ok meet maximum 497623597
Test #114:
score: 0
Accepted
time: 3ms
memory: 36272kb
input:
64241
output:
000000000000000111111111111111101100000000000110100000000001001011111111110111100000000011000100000000100111011111111011001100000001100110000000010111001111111101001010000000010110101111111101001110000000011110010000000100001101111111011110110000001100001010000010000110101111101111001110000110001010...
result:
ok meet maximum 2062587185
Test #115:
score: 0
Accepted
time: 9ms
memory: 39468kb
input:
73307
output:
000000000000000011111111111111111011111111111111001111110000000101000001111111101100001000000011001111011111110011000110000001110011100000001001010001111111011011001000000110010011011111100110110110000011100100101000010001101101011110111001001110001100011001000111001110011111100011001010000011110011...
result:
ok meet maximum 2685953056
Test #116:
score: 0
Accepted
time: 7ms
memory: 39152kb
input:
129593
output:
000000000000000010000000011111111000000010000000111111111000000100000000011111110000000010000001111111111000001000000000011111100000000010000011111111111000010000000000011111000000000010000111111111111000100000000000011110000000000010001111111111111001000000000000011100000000000010011111111111111010...
result:
ok meet maximum 8395295323