QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#118102#5434. Binary Substringshos_lyricAC ✓8ms4828kbC++144.0kb2023-07-03 03:41:552023-07-03 03:41:57

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-03 03:41:57]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:4828kb
  • [2023-07-03 03:41:55]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }


#define negate negate__

string shift(const string &s, const string &suf) {
  const int len = s.size();
  const string ss = s + s;
  const int pos = ss.find(suf);
  const int cut = (pos + (int)suf.size()) % len;
  return s.substr(cut) + s.substr(0, cut);
}
string partialSum(const string &s) {
  string ret;
  int sum = 0;
  for (const char c : s) {
    sum ^= (c - '0');
    ret += (char)('0' + sum);
  }
  return ret;
}
string negate(const string &s) {
  string ret;
  for (const char c : s) {
    ret += (char)(c ^ '0' ^ '1');
  }
  return ret;
}
string otimes(int k, string s, string t) {
  { const int pos = (s + s).find(string(k, '0')); assert(~pos); s = s.substr(pos) + s.substr(0, pos); }
  { const int pos = (t + t).find(string(k, '0')); assert(~pos); t = t.substr(pos) + t.substr(0, pos); }
  { const int pos = (s + s).find(string(k, '1')); assert(~pos); s.insert(s.begin() + pos, '1'); }
  { const int pos = (s + s).find(string(k, '0')); assert(~pos); s.erase(s.begin() + pos); }
  { const int pos = (t + t).find(string(k, '0')); assert(~pos); t.insert(t.begin() + pos, '0'); }
  { const int pos = (t + t).find(string(k, '1')); assert(~pos); t.erase(t.begin() + pos); }
  return s + t;
}

constexpr int K = 18;
string S[K + 1];

int main() {
  // https://www.mimuw.edu.pl/~rytter/MYPAPERS/paper.pdf
  {
    S[1] = "01";
    S[2] = "0011";
    string x = "0011";
    string y = "0011";
    for (int i = 2; ; ++i) {
// if(i<=5)cerr<<x<<" "<<y<<endl;
      S[i + 1] = otimes(i, x, y);
// if(i<=5)cerr<<"S["<<i+1<<"] = "<<S[i+1]<<endl;
      if (i + 1 == K) break;
      x = shift(x, string(i, '1'));
      string x1 = partialSum(x);
      string x2 = negate(x1);
      x = x1 + shift(x2, x1.substr((int)x1.size() - i));
      y = shift(y, string(i, '1'));
      string y1 = partialSum(y);
      string y2 = negate(y1);
      y = y1 + shift(y2, y1.substr((int)y1.size() - i));
      y = negate(y);
 }
  }
  for (int k = 1; k <= K; ++k) {
    assert((int)S[k].size() == 1 << k);
    const string pre = S[k].substr(0, k - 1);
    S[k] += pre;
  }
#ifdef LOCAL
  for (int k = 1; k <= K; ++k) {
    {
      set<string> ss;
      for (int i = 0; i + k <= (int)S[k].size(); ++i) {
        ss.insert(S[k].substr(i, k));
      }
      assert((int)ss.size() == 1 << k);
    }
    if (k >= 2) {
      const int n = (int)S[k - 1].size() + 1;
      set<string> ss;
      for (int i = 0; i + (k - 1) <= n; ++i) {
        ss.insert(S[k].substr(i, k - 1));
      }
// cerr<<k<<" "<<S[k]<<" "<<n<<"; ";pv(ss.begin(),ss.end());
      assert((int)ss.size() == 1 << (k - 1));
    }
  }
#endif
  
  int N;
  for (; ~scanf("%d", &N); ) {
    string ans;
    for (int k = 1; ; ++k) {
      if (N <= (int)S[k].size()) {
        ans = S[k].substr(0, N);
        break;
      }
    }
    puts(ans.c_str());
  }
  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 8ms
memory: 4688kb

input:

2

output:

01

result:

ok meet maximum 3

Test #2:

score: 0
Accepted
time: 8ms
memory: 4748kb

input:

5

output:

00110

result:

ok meet maximum 12

Test #3:

score: 0
Accepted
time: 7ms
memory: 4764kb

input:

1

output:

0

result:

ok meet maximum 1

Test #4:

score: 0
Accepted
time: 4ms
memory: 4740kb

input:

3

output:

001

result:

ok meet maximum 5

Test #5:

score: 0
Accepted
time: 7ms
memory: 4744kb

input:

4

output:

0011

result:

ok meet maximum 8

Test #6:

score: 0
Accepted
time: 7ms
memory: 4684kb

input:

6

output:

011100

result:

ok meet maximum 16

Test #7:

score: 0
Accepted
time: 4ms
memory: 4744kb

input:

7

output:

0111000

result:

ok meet maximum 21

Test #8:

score: 0
Accepted
time: 4ms
memory: 4740kb

input:

8

output:

01110001

result:

ok meet maximum 27

Test #9:

score: 0
Accepted
time: 7ms
memory: 4740kb

input:

9

output:

011100010

result:

ok meet maximum 34

Test #10:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

10

output:

0111000101

result:

ok meet maximum 42

Test #11:

score: 0
Accepted
time: 7ms
memory: 4740kb

input:

11

output:

00101111000

result:

ok meet maximum 50

Test #12:

score: 0
Accepted
time: 4ms
memory: 4680kb

input:

12

output:

001011110000

result:

ok meet maximum 59

Test #13:

score: 0
Accepted
time: 7ms
memory: 4788kb

input:

200000

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 19996962278

Test #14:

score: 0
Accepted
time: 7ms
memory: 4760kb

input:

24

output:

000110101111100100000101

result:

ok meet maximum 240

Test #15:

score: 0
Accepted
time: 3ms
memory: 4752kb

input:

35

output:

00011010111110010000010100111011000

result:

ok meet maximum 526

Test #16:

score: 0
Accepted
time: 7ms
memory: 4792kb

input:

30

output:

000110101111100100000101001110

result:

ok meet maximum 381

Test #17:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

45

output:

000010011010001111110110010101110000001100010

result:

ok meet maximum 882

Test #18:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

66

output:

000010011010001111110110010101110000001100010110111100111010100100

result:

ok meet maximum 1953

Test #19:

score: 0
Accepted
time: 7ms
memory: 4824kb

input:

50

output:

00001001101000111111011001010111000000110001011011

result:

ok meet maximum 1097

Test #20:

score: 0
Accepted
time: 7ms
memory: 4780kb

input:

80

output:

00000111011000010100100011001011111110001001111010101101110011010000000100001101

result:

ok meet maximum 2901

Test #21:

score: 0
Accepted
time: 7ms
memory: 4788kb

input:

107

output:

00000111011000010100100011001011111110001001111010101101110011010000000100001101101011101001100011111011110

result:

ok meet maximum 5277

Test #22:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

81

output:

000001110110000101001000110010111111100010011110101011011100110100000001000011011

result:

ok meet maximum 2976

Test #23:

score: 0
Accepted
time: 8ms
memory: 4748kb

input:

147

output:

000000101101111100111000010001101010000111010110011011010001001111111101001000001100011110111001010101111000101001100100101110110000000011111011011

result:

ok meet maximum 10124

Test #24:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

255

output:

000000101101111100111000010001101010000111010110011011010001001111111101001000001100011110111001010101111000101001100100101110110000000011111011011001011000100001010110101110001100111100100010111111000001001001101001110111101010100101000111001100001101110

result:

ok meet maximum 31130

Test #25:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

173

output:

00000010110111110011100001000110101000011101011001101101000100111111110100100000110001111011100101010111100010100110010010111011000000001111101101100101100010000101011010111

result:

ok meet maximum 14115

Test #26:

score: 0
Accepted
time: 7ms
memory: 4748kb

input:

288

output:

000000011011010100010111110000100110000010110010001001001111000101010011100000010000101001011100110010100001100010001110010110111111111001001010111010000011110110011111010011011101101100001110101010110001111110111101011010001100110101111001110111000110100100000000010101101101110010000111

result:

ok meet maximum 39850

Test #27:

score: 0
Accepted
time: 7ms
memory: 4720kb

input:

407

output:

000000011011010100010111110000100110000010110010001001001111000101010011100000010000101001011100110010100001100010001110010110111111111001001010111010000011110110011111010011011101101100001110101010110001111110111101011010001100110101111001110111000110100100000000010101101101110010000111110011011001...

result:

ok meet maximum 80310

Test #28:

score: 0
Accepted
time: 4ms
memory: 4696kb

input:

349

output:

000000011011010100010111110000100110000010110010001001001111000101010011100000010000101001011100110010100001100010001110010110111111111001001010111010000011110110011111010011011101101100001110101010110001111110111101011010001100110101111001110111000110100100000000010101101101110010000111110011011001...

result:

ok meet maximum 58821

Test #29:

score: 0
Accepted
time: 5ms
memory: 4740kb

input:

526

output:

000000001001001100001101010000011101111110010001111000111010111100110001011111110000011000110100010001100000100001111010001101101010100011100110100111111010110111010100111011010010010000010110011001000010101001010011011000010001001101011101001011110110001111111111011011001111001010111110001000000110...

result:

ok meet maximum 134925

Test #30:

score: 0
Accepted
time: 7ms
memory: 4748kb

input:

1018

output:

000000001001001100001101010000011101111110010001111000111010111100110001011111110000011000110100010001100000100001111010001101101010100011100110100111111010110111010100111011010010010000010110011001000010101001010011011000010001001101011101001011110110001111111111011011001111001010111110001000000110...

result:

ok meet maximum 510567

Test #31:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

1017

output:

000000001001001100001101010000011101111110010001111000111010111100110001011111110000011000110100010001100000100001111010001101101010100011100110100111111010110111010100111011010010010000010110011001000010101001010011011000010001001101011101001011110110001111111111011011001111001010111110001000000110...

result:

ok meet maximum 509558

Test #32:

score: 0
Accepted
time: 8ms
memory: 4744kb

input:

1209

output:

000000000111000100000100110000001011010101110000101000010110010100010000110101010000001000010011110000100000011111010110000100100110011110100010011101010110010010110011101001001110001111110010001000111110011000110001001000001111000100110100111001010010000101010100100100010100011001010111100000001001...

result:

ok meet maximum 721446

Test #33:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

1632

output:

000000000111000100000100110000001011010101110000101000010110010100010000110101010000001000010011110000100000011111010110000100100110011110100010011101010110010010110011101001001110001111110010001000111110011000110001001000001111000100110100111001010010000101010100100100010100011001010111100000001001...

result:

ok meet maximum 1318299

Test #34:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

1829

output:

000000000111000100000100110000001011010101110000101000010110010100010000110101010000001000010011110000100000011111010110000100100110011110100010011101010110010010110011101001001110001111110010001000111110011000110001001000001111000100110100111001010010000101010100100100010100011001010111100000001001...

result:

ok meet maximum 1657336

Test #35:

score: 0
Accepted
time: 7ms
memory: 4680kb

input:

3187

output:

000000000010111100000011101111111001001100101111100111110010001100001111101100110000000111110001010000011111110101001101111100011101110101100001110100110010001110010001011000111010000101010001111000010101110111101111000111111010111100010011101000110001111100110011100011110011110111001101011111111000...

result:

ok meet maximum 5049170

Test #36:

score: 0
Accepted
time: 7ms
memory: 4792kb

input:

2138

output:

000000000010111100000011101111111001001100101111100111110010001100001111101100110000000111110001010000011111110101001101111100011101110101100001110100110010001110010001011000111010000101010001111000010101110111101111000111111010111100010011101000110001111100110011100011110011110111001101011111111000...

result:

ok meet maximum 2267222

Test #37:

score: 0
Accepted
time: 4ms
memory: 4684kb

input:

4030

output:

000000000010111100000011101111111001001100101111100111110010001100001111101100110000000111110001010000011111110101001101111100011101110101100001110100110010001110010001011000111010000101010001111000010101110111101111000111111010111100010011101000110001111100110011100011110011110111001101011111111000...

result:

ok meet maximum 8082284

Test #38:

score: 0
Accepted
time: 8ms
memory: 4760kb

input:

6101

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 18549195

Test #39:

score: 0
Accepted
time: 3ms
memory: 4788kb

input:

5917

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 17445655

Test #40:

score: 0
Accepted
time: 7ms
memory: 4744kb

input:

6635

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 21943566

Test #41:

score: 0
Accepted
time: 7ms
memory: 4780kb

input:

9993

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 49821572

Test #42:

score: 0
Accepted
time: 2ms
memory: 4736kb

input:

14474

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 104583873

Test #43:

score: 0
Accepted
time: 7ms
memory: 4748kb

input:

11534

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 66388863

Test #44:

score: 0
Accepted
time: 6ms
memory: 4680kb

input:

19098

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 182141836

Test #45:

score: 0
Accepted
time: 4ms
memory: 4788kb

input:

31872

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 507514777

Test #46:

score: 0
Accepted
time: 7ms
memory: 4688kb

input:

27626

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 381257844

Test #47:

score: 0
Accepted
time: 7ms
memory: 4768kb

input:

43245

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 934503599

Test #48:

score: 0
Accepted
time: 4ms
memory: 4828kb

input:

34491

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 594380060

Test #49:

score: 0
Accepted
time: 7ms
memory: 4688kb

input:

64535

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2081512994

Test #50:

score: 0
Accepted
time: 5ms
memory: 4744kb

input:

65746

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2160380385

Test #51:

score: 0
Accepted
time: 4ms
memory: 4760kb

input:

65861

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2167946005

Test #52:

score: 0
Accepted
time: 8ms
memory: 4736kb

input:

66725

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2225209765

Test #53:

score: 0
Accepted
time: 8ms
memory: 4744kb

input:

86349

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 3726867681

Test #54:

score: 0
Accepted
time: 8ms
memory: 4680kb

input:

68454

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2342045211

Test #55:

score: 0
Accepted
time: 8ms
memory: 4824kb

input:

112260

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 6299544960

Test #56:

score: 0
Accepted
time: 8ms
memory: 4724kb

input:

108023

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 5832941098

Test #57:

score: 0
Accepted
time: 3ms
memory: 4744kb

input:

103787

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 5384393176

Test #58:

score: 0
Accepted
time: 7ms
memory: 4764kb

input:

128710

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8281268235

Test #59:

score: 0
Accepted
time: 7ms
memory: 4768kb

input:

129534

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8387651991

Test #60:

score: 0
Accepted
time: 4ms
memory: 4684kb

input:

128670

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8276121255

Test #61:

score: 0
Accepted
time: 7ms
memory: 4740kb

input:

154721

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 11967003302

Test #62:

score: 0
Accepted
time: 7ms
memory: 4684kb

input:

143149

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 10243718420

Test #63:

score: 0
Accepted
time: 5ms
memory: 4760kb

input:

134065

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 8984762318

Test #64:

score: 0
Accepted
time: 4ms
memory: 4764kb

input:

163454

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 13356170345

Test #65:

score: 0
Accepted
time: 5ms
memory: 4744kb

input:

139150

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 9679327553

Test #66:

score: 0
Accepted
time: 4ms
memory: 4760kb

input:

172380

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 14854850208

Test #67:

score: 0
Accepted
time: 5ms
memory: 4684kb

input:

178166

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 15868884317

Test #68:

score: 0
Accepted
time: 4ms
memory: 4788kb

input:

143651

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 10315696937

Test #69:

score: 0
Accepted
time: 8ms
memory: 4784kb

input:

198199

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 19638413795

Test #70:

score: 0
Accepted
time: 8ms
memory: 4748kb

input:

186272

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 17345817782

Test #71:

score: 0
Accepted
time: 4ms
memory: 4680kb

input:

198102

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 19619194797

Test #72:

score: 0
Accepted
time: 3ms
memory: 4744kb

input:

8201

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 33542145

Test #73:

score: 0
Accepted
time: 7ms
memory: 4688kb

input:

8202

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 33550335

Test #74:

score: 0
Accepted
time: 7ms
memory: 4748kb

input:

8203

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 33558526

Test #75:

score: 0
Accepted
time: 7ms
memory: 4736kb

input:

8204

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 33566718

Test #76:

score: 0
Accepted
time: 8ms
memory: 4744kb

input:

8205

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 33574910

Test #77:

score: 0
Accepted
time: 2ms
memory: 4784kb

input:

8206

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 33583103

Test #78:

score: 0
Accepted
time: 8ms
memory: 4692kb

input:

16394

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 134193153

Test #79:

score: 0
Accepted
time: 8ms
memory: 4688kb

input:

16395

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 134209535

Test #80:

score: 0
Accepted
time: 4ms
memory: 4684kb

input:

16396

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 134225918

Test #81:

score: 0
Accepted
time: 8ms
memory: 4684kb

input:

16397

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 134242302

Test #82:

score: 0
Accepted
time: 6ms
memory: 4708kb

input:

16398

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 134258686

Test #83:

score: 0
Accepted
time: 8ms
memory: 4712kb

input:

16399

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 134275071

Test #84:

score: 0
Accepted
time: 7ms
memory: 4744kb

input:

32779

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 536821761

Test #85:

score: 0
Accepted
time: 7ms
memory: 4736kb

input:

32780

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 536854527

Test #86:

score: 0
Accepted
time: 7ms
memory: 4684kb

input:

32781

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 536887294

Test #87:

score: 0
Accepted
time: 8ms
memory: 4748kb

input:

32782

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 536920062

Test #88:

score: 0
Accepted
time: 7ms
memory: 4788kb

input:

32783

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 536952830

Test #89:

score: 0
Accepted
time: 7ms
memory: 4788kb

input:

32784

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 536985599

Test #90:

score: 0
Accepted
time: 8ms
memory: 4684kb

input:

65548

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2147385345

Test #91:

score: 0
Accepted
time: 6ms
memory: 4748kb

input:

65549

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2147450879

Test #92:

score: 0
Accepted
time: 7ms
memory: 4692kb

input:

65550

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2147516414

Test #93:

score: 0
Accepted
time: 4ms
memory: 4748kb

input:

65551

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2147581950

Test #94:

score: 0
Accepted
time: 7ms
memory: 4744kb

input:

65552

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2147647486

Test #95:

score: 0
Accepted
time: 7ms
memory: 4736kb

input:

65553

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2147713023

Test #96:

score: 0
Accepted
time: 3ms
memory: 4692kb

input:

131085

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8589737985

Test #97:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

131086

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8589869055

Test #98:

score: 0
Accepted
time: 3ms
memory: 4760kb

input:

131087

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8590000126

Test #99:

score: 0
Accepted
time: 7ms
memory: 4736kb

input:

131088

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8590131198

Test #100:

score: 0
Accepted
time: 8ms
memory: 4748kb

input:

131089

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 8590262270

Test #101:

score: 0
Accepted
time: 8ms
memory: 4784kb

input:

131090

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 8590393343

Test #102:

score: 0
Accepted
time: 3ms
memory: 4716kb

input:

8197

output:

000000000001101011111110100101010111000100011010100010101110000100000101011011101111111101010000110000001010101100111011010100001011010011011111010011101110000101110000110111101001111100110000101000001100101101011010111101010110010100001110100111101111010100010001011110101110101101000100110101010111...

result:

ok meet maximum 33509395

Test #103:

score: 0
Accepted
time: 4ms
memory: 4712kb

input:

16328

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 133114152

Test #104:

score: 0
Accepted
time: 8ms
memory: 4744kb

input:

32608

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 531233481

Test #105:

score: 0
Accepted
time: 4ms
memory: 4684kb

input:

65141

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2120796035

Test #106:

score: 0
Accepted
time: 4ms
memory: 4788kb

input:

130420

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8502797880

Test #107:

score: 0
Accepted
time: 7ms
memory: 4716kb

input:

8265

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 34068260

Test #108:

score: 0
Accepted
time: 7ms
memory: 4788kb

input:

16508

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 136067031

Test #109:

score: 0
Accepted
time: 1ms
memory: 4732kb

input:

33008

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 544351055

Test #110:

score: 0
Accepted
time: 3ms
memory: 4744kb

input:

65964

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2174733396

Test #111:

score: 0
Accepted
time: 7ms
memory: 4784kb

input:

131692

output:

000000000000000010010011100111101101111100000000100100010111001011011101111011001001001110010101101000011110011111101111100101011010001100001011111011010111001011011111000010111110011011000010110101001011000010011010110010011010100010111011111001101100100110101010010101111110010000101110110101100101...

result:

ok meet maximum 8669480792

Test #112:

score: 0
Accepted
time: 7ms
memory: 4744kb

input:

15843

output:

000000000000100110101010011100110010111100001001100001100101111100000011001001011010101011001111101111111001100100010110110011111001001110110101001110100101111100101111101101011000101011101111100111111011100100110110010100110010001100000101100010100101001100001111001010011010011011000011101100110010...

result:

ok meet maximum 125318747

Test #113:

score: 0
Accepted
time: 7ms
memory: 4720kb

input:

31560

output:

000000000000011101100110001011101110010100000111011111011100101011111110111000110110011001000101011010101000100011110010010001010111000101101100111010011100101011100101011011001000011001011010100010101001011100010010001100010001111011111100100001100011000100000101000110001001110110111110100100010001...

result:

ok meet maximum 497623597

Test #114:

score: 0
Accepted
time: 5ms
memory: 4748kb

input:

64241

output:

000000000000001011011101111001011010001100000010110101001011100110101010010111101101110111000011001001100111100001010001110000110010111100100100010110001011100110100011001001000111110111001001100001100111001011110001111011110000101001010100011111011110111100000011000010000111010010010101100011110000...

result:

ok meet maximum 2062587185

Test #115:

score: 0
Accepted
time: 7ms
memory: 4708kb

input:

73307

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 2685953056

Test #116:

score: 0
Accepted
time: 7ms
memory: 4752kb

input:

129593

output:

000000000000000110110100101000110110000100000001101100111001011101100110001101011011010010111110111000100010100000110000101111101110010100011100001101111001011101100001000111000010101101000111011111011101000110101111010110101111100111001100001010110101101011111110111110000010110001110011011110101111...

result:

ok meet maximum 8395295323