QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#153890#141. 8 染色nhuang6850 125ms21784kbC++202.7kb2023-08-31 10:07:082023-08-31 10:07:09

Judging History

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

  • [2023-08-31 10:07:09]
  • 评测
  • 测评结果:0
  • 用时:125ms
  • 内存:21784kb
  • [2023-08-31 10:07:08]
  • 提交

Alice

#include "Alice.h"

namespace {
int sample_variable = 0;
void sample_function() {}
} // namespace

std::vector<int> Alice(int N, int M, std::vector<int> U, std::vector<int> V,
                       std::vector<int> C) {
  std::vector<int> deg(N);
  for (int i = 0; i < M; ++i) {
    deg[U[i]]++;
    deg[V[i]]++;
  }
  std::vector<int> &ans = V;
  ans.resize(0);
  for (int i = 0; i < N; ++i) {
    if (deg[i] >= 8) {
      ans.push_back(C[i] >= 4);
      ans.push_back((C[i] / 2) % 2 == 0);
    }
  }
  return ans;
}

Bob

#include "Bob.h"
#include <cassert>
#include <iostream>
#include <queue>

namespace {
int sample_variable = 0;
void sample_function() {}
} // namespace

std::vector<int> Bob(int N, int M, std::vector<int> U, std::vector<int> V,
                     std::vector<int> X) {
  std::vector<std::vector<int>> adj(N);
  for (int i = 0; i < M; ++i) {
    adj[U[i]].push_back(V[i]);
    adj[V[i]].push_back(U[i]);
  }

  std::vector<int> &C = V;
  {
    {
      std::vector<int> &xx = U;
      xx.clear();
      int cnt = 0;
      for (int i = 0; i < N; ++i) {
        if ((int)adj[i].size() >= 8) {
          // i = cnt;
          xx.push_back(X[2 * cnt]);
          xx.push_back(X[2 * cnt + 1]);
          cnt++;
        } else {
          xx.push_back(-1);
          xx.push_back(-1);
        }
      }
      X = xx;
    }
    std::vector<std::vector<int>> bp(N);
    for (int i = 0; i < N; ++i) {
      if ((int)adj[i].size() < 8)
        continue;
      for (int j : adj[i]) {
        if ((int)adj[j].size() < 8)
          continue;
        if (X[2 * i] != X[2 * j] || X[2 * i + 1] != X[2 * j + 1])
          continue;
        bp[i].push_back(j);
      }
    }
    std::vector<int> &vis = U;
    vis.assign(N, 0);
    C.assign(N, -1);

    std::vector<int> q;
    q.reserve(N);
    for (int s = 0; s < N; ++s) {
      if ((int)adj[s].size() >= 8 && !vis[s]) {
        vis[s] = true;
        q.push_back(s);
        int ii = 0;
        int b = X[2 * s] * 4 + X[2 * s + 1] * 2;
        C[s] = b;
        while (ii < (int)q.size()) {
          int node = q[ii++];
          for (int i : bp[node]) {
            if (vis[i])
              continue;
            vis[i] = true;
            C[i] = !(C[node] - b) + b;
            q.push_back(i);
          }
        }
      }
    }
  }
  for (int i = 0; i < N; ++i) {
    if (C[i] == -1) {
      for (int k = 0; k < 8; ++k) {
        bool g = true;
        for (int j : adj[i]) {
          if (C[j] == k) {
            g = false;
            break;
          }
        }
        if (g) {
          C[i] = k;
          break;
        }
      }
    }
  }
  return C;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 31ms
memory: 18860kb

input:

10000 500000
5247 482
4774 3796
5245 9386
8794 2818
1911 3240
6925 6008
6313 1737
8668 4913
7892 5444
6740 2271
2100 53
8527 9605
4009 4765
5293 2683
6552 1326
8877 9929
402 9849
8664 6893
1998 7305
155 9477
9753 8036
448 5438
8535 3111
9493 406
7694 2030
5745 6890
5519 3106
8979 5098
9948 2453
5601...

output:

Success
+000101101100011101010000000101001101100111011010011100010001110000010000100101111010001010000010010011111111000110111001100110110000011100111000000000001000000100111110011011100010011111010100110101000010011000000011000110011110001011111110100101101101101100000011010110111011011100110110101...

input:

10000 500000
5247 482
4774 3796
5245 9386
8794 2818
1911 3240
6925 6008
6313 1737
8668 4913
7892 5444
6740 2271
2100 53
8527 9605
4009 4765
5293 2683
6552 1326
8877 9929
402 9849
8664 6893
1998 7305
155 9477
9753 8036
448 5438
8535 3111
9493 406
7694 2030
5745 6890
5519 3106
8979 5098
9948 2453
5601...

output:

Success
0 2 2 4 6 0 3 6 3 3 1 1 0 2 3 1 6 3 5 3 6 3 4 5 2 7 0 3 1 3 7 1 0 2 1 1 5 3 3 6 4 5 0 5 5 0 1 5 2 1 7 7 6 7 0 2 5 7 4 2 4 3 5 6 1 0 3 6 1 6 5 0 0 0 0 0 4 1 0 2 0 6 6 4 3 4 7 5 0 4 2 6 6 3 3 1 7 2 2 1 0 4 2 5 0 1 1 6 0 3 5 3 7 4 1 5 7 6 7 5 5 3 3 4 7 3 4 7 1 0 1 6 2 3 4 6 5 6 2 6 0 6 3 5 4 5 ...

result:

points 1.0 good solution, L = 20000, used time = 31ms, used memory = 18.418MB

Test #2:

score: 100
Accepted
time: 25ms
memory: 20300kb

input:

10000 500000
7518 5063
8590 2325
5308 8380
9263 493
3037 8973
2315 3595
5131 3046
3615 8187
4184 6821
9473 8440
2051 9451
3493 7997
6946 3768
1257 6216
6217 7150
3198 3246
8404 8559
6268 9720
8300 8365
1310 7609
9791 4488
4502 2446
1709 3235
9868 477
4786 8617
1285 2775
9942 6887
4693 7213
4419 7907...

output:

Success
+100101010011001011001110010001011000011000000001001110000101101010100001110111111011111010110100111001111101011011010100000001101010000101100001111110000011000000000000101001101010010101000010001010000011110101101110110100001011001000001000111100101011101010010000000101101101001100000110010...

input:

10000 500000
7518 5063
8590 2325
5308 8380
9263 493
3037 8973
2315 3595
5131 3046
3615 8187
4184 6821
9473 8440
2051 9451
3493 7997
6946 3768
1257 6216
6217 7150
3198 3246
8404 8559
6268 9720
8300 8365
1310 7609
9791 4488
4502 2446
1709 3235
9868 477
4786 8617
1285 2775
9942 6887
4693 7213
4419 7907...

output:

Success
4 2 3 2 0 6 1 4 6 1 7 4 3 1 2 2 4 1 3 4 0 1 0 3 0 7 4 1 2 3 5 5 4 4 0 2 6 3 6 6 4 6 6 5 5 6 2 1 7 5 2 7 7 3 3 4 6 3 3 1 0 0 3 5 5 4 1 2 3 4 1 3 6 7 5 1 0 6 0 0 0 0 0 0 5 4 2 5 4 4 2 3 3 1 0 5 1 4 5 1 1 6 6 3 3 5 7 5 6 3 0 0 5 6 0 5 1 0 5 0 6 6 0 5 5 7 4 5 5 3 1 1 1 3 2 5 7 2 0 6 1 0 3 4 3 1 ...

result:

points 1.0 good solution, L = 20000, used time = 25ms, used memory = 19.824MB

Test #3:

score: 100
Accepted
time: 24ms
memory: 20364kb

input:

10000 500000
6598 111
4221 7630
8964 9938
910 9967
5591 5260
1340 2280
6651 9500
7256 4704
4535 5235
7903 4673
5914 9380
2904 4203
5673 9268
322 1438
2857 897
4389 5616
1532 2814
9108 9145
5390 2618
1108 7745
858 6493
794 6521
4467 4520
1477 3421
8016 976
5489 6702
3460 3515
3025 6620
5706 4418
7267...

output:

Success
+111011011001011110111010110101101100111100101111101100111001011000011100100001001101110011011010000100101010110110110011101110000001110000110011110000000101110010101100110011000001001000110000001011101010010110000010010111011111011010001010010100100100001000100011100100011000010011001101000...

input:

10000 500000
6598 111
4221 7630
8964 9938
910 9967
5591 5260
1340 2280
6651 9500
7256 4704
4535 5235
7903 4673
5914 9380
2904 4203
5673 9268
322 1438
2857 897
4389 5616
1532 2814
9108 9145
5390 2618
1108 7745
858 6493
794 6521
4467 4520
1477 3421
8016 976
5489 6702
3460 3515
3025 6620
5706 4418
7267...

output:

Success
6 4 6 2 4 3 3 6 5 6 4 4 6 3 2 4 6 0 7 6 0 4 7 6 5 7 0 6 4 3 3 4 1 2 6 1 5 1 3 1 6 2 7 0 7 2 4 4 1 2 1 4 5 5 6 2 5 6 0 7 4 6 5 1 0 2 6 1 0 7 0 6 7 1 0 1 2 3 7 1 4 4 6 1 7 0 6 0 1 3 0 5 0 6 0 1 1 4 7 4 5 4 3 2 4 0 0 5 3 2 7 2 6 6 3 4 4 0 4 4 2 3 1 5 3 1 1 4 1 4 0 6 4 2 0 2 5 0 3 1 7 1 7 2 0 1 ...

result:

points 1.0 good solution, L = 20000, used time = 24ms, used memory = 19.887MB

Test #4:

score: 100
Accepted
time: 24ms
memory: 18840kb

input:

10000 500000
6466 1388
9919 2121
5889 9997
4361 1172
5148 3818
1410 1441
2639 9097
5589 7447
8025 2032
2247 4216
5662 1685
2364 468
2074 2010
4979 6171
6006 9365
8588 3382
904 4605
3120 70
6795 9497
5331 5277
8381 4685
1962 3206
3109 8353
4664 1731
6915 8341
9838 2346
8762 5979
8573 3022
4494 1953
9...

output:

Success
+111010110101010110111110101101111000101011001100100110010000010100000111011001011010101010100011100011110001011111111110100101101101000011001101100011100101111001000110111000011101111101101000101101000100001110111111011100111111101111111000101000100010011010111100111000011011011001111100101...

input:

10000 500000
6466 1388
9919 2121
5889 9997
4361 1172
5148 3818
1410 1441
2639 9097
5589 7447
8025 2032
2247 4216
5662 1685
2364 468
2074 2010
4979 6171
6006 9365
8588 3382
904 4605
3120 70
6795 9497
5331 5277
8381 4685
1962 3206
3109 8353
4664 1731
6915 8341
9838 2346
8762 5979
8573 3022
4494 1953
9...

output:

Success
6 4 5 7 2 3 3 3 4 6 7 5 5 6 3 7 4 0 4 5 6 0 6 1 5 3 4 3 1 1 3 2 1 0 3 7 3 5 3 3 5 5 5 4 4 5 0 6 4 0 6 6 0 3 2 7 6 7 7 4 5 2 3 5 7 3 0 0 6 1 7 3 4 1 7 4 2 3 7 4 3 1 3 4 6 4 0 2 7 3 7 6 2 4 5 1 5 7 2 1 3 0 0 6 5 6 6 7 2 7 0 7 6 6 4 6 7 6 5 0 5 4 0 4 1 5 2 4 5 6 6 1 6 4 1 2 4 6 3 5 3 7 6 0 4 7 ...

result:

points 1.0 good solution, L = 20000, used time = 24ms, used memory = 18.398MB

Test #5:

score: 100
Accepted
time: 35ms
memory: 20108kb

input:

10000 500000
7186 8193
8118 1694
980 4947
2412 2964
9819 591
541 3082
6062 6757
3992 6836
1808 5755
3279 2556
9345 8806
6176 7362
5239 5957
4709 7513
7242 4724
304 9529
5446 6340
12 6601
896 1199
4226 3323
6246 8892
1244 1410
4398 9412
415 1364
1100 7492
1093 144
8848 5690
8484 2503
6805 3612
8027 3...

output:

Success
+010000011111010010100010111101111011000111010001111000011001110011011110101101001110111011011100101100101001011001101000110111101000101011010001011010111010101010110111000100110010001010010011001100010000001111100011000011000101011110110011111110011110001010000100101011000000011111100101110...

input:

10000 500000
7186 8193
8118 1694
980 4947
2412 2964
9819 591
541 3082
6062 6757
3992 6836
1808 5755
3279 2556
9345 8806
6176 7362
5239 5957
4709 7513
7242 4724
304 9529
5446 6340
12 6601
896 1199
4226 3323
6246 8892
1244 1410
4398 9412
415 1364
1100 7492
1093 144
8848 5690
8484 2503
6805 3612
8027 3...

output:

Success
2 0 1 3 6 7 2 0 4 4 0 5 6 6 3 7 5 7 0 3 7 3 1 2 6 5 1 3 5 2 6 1 6 3 6 4 4 6 3 1 7 5 6 4 7 2 7 0 5 6 1 4 5 3 3 4 3 5 4 0 6 2 7 4 5 0 5 4 6 3 1 2 2 5 4 7 5 5 5 4 5 7 2 6 0 2 0 6 0 4 0 5 5 3 1 6 0 6 1 3 1 1 0 7 6 5 1 7 0 0 7 0 2 2 3 6 5 7 0 7 6 6 4 2 7 5 1 4 5 0 3 0 5 4 6 0 1 0 3 6 6 4 2 2 7 2 ...

result:

points 1.0 good solution, L = 20000, used time = 35ms, used memory = 19.637MB

Test #6:

score: 100
Accepted
time: 27ms
memory: 20380kb

input:

10000 500000
6943 4920
9182 3214
3301 1839
6754 5534
4672 1598
8090 2413
3517 4899
6355 870
6121 2115
963 8185
5526 2112
2233 9348
1048 795
3337 2394
1746 400
2127 1029
3522 3484
2246 9981
1842 5517
5507 2114
7176 3873
5270 2788
1278 5922
2204 4628
3562 1087
4317 3802
2867 2583
5412 3471
4616 2870
3...

output:

Success
+110100010111111001100000110010000101011010110000101100111100001011001010111011110011011010001111011011101110011010010101101011111011000010000001000101010011011000111011001101000011100011110001100011001100001011000101101000010010100101001001110000001010011101100101101001100010010110001001111...

input:

10000 500000
6943 4920
9182 3214
3301 1839
6754 5534
4672 1598
8090 2413
3517 4899
6355 870
6121 2115
963 8185
5526 2112
2233 9348
1048 795
3337 2394
1746 400
2127 1029
3522 3484
2246 9981
1842 5517
5507 2114
7176 3873
5270 2788
1278 5922
2204 4628
3562 1087
4317 3802
2867 2583
5412 3471
4616 2870
3...

output:

Success
6 2 0 3 2 6 7 4 3 5 1 0 6 1 5 0 2 3 2 4 5 6 1 0 5 6 1 7 6 0 1 4 7 0 5 5 6 4 7 6 0 7 2 5 5 1 7 6 2 4 7 4 6 4 2 4 4 2 2 3 4 4 7 6 4 6 0 1 5 0 0 3 1 2 3 3 1 7 3 5 1 6 5 6 1 7 3 1 1 6 4 1 6 6 0 3 5 0 7 1 7 1 0 4 7 1 3 2 4 4 1 3 0 4 5 3 2 0 4 3 7 1 1 0 5 4 3 6 2 4 3 3 4 5 3 5 0 5 2 2 4 1 5 2 6 4 ...

result:

points 1.0 good solution, L = 20000, used time = 27ms, used memory = 19.902MB

Test #7:

score: 100
Accepted
time: 30ms
memory: 18784kb

input:

10000 500000
6138 2262
9194 2692
6583 5929
3850 8345
2676 7591
2261 309
2480 6179
1925 160
4094 7137
2968 7475
7692 8381
3906 5881
7604 8845
117 3209
6920 8544
4105 685
1912 2235
2207 7887
1928 8289
4884 4781
7715 8214
9074 9660
8811 1898
1156 2603
9346 1057
8312 9297
976 7335
1409 314
3417 6897
503...

output:

Success
+011010011000111010111000111110111110100010011101011010101110111000010011110100011110101100100010100000101000111101000110111000001111011100010101110001111101011001010100101001111110000011100000000100010010010001100101101000111000111001011000001100100000000100011001011100110000000101000101110...

input:

10000 500000
6138 2262
9194 2692
6583 5929
3850 8345
2676 7591
2261 309
2480 6179
1925 160
4094 7137
2968 7475
7692 8381
3906 5881
7604 8845
117 3209
6920 8544
4105 685
1912 2235
2207 7887
1928 8289
4884 4781
7715 8214
9074 9660
8811 1898
1156 2603
9346 1057
8312 9297
976 7335
1409 314
3417 6897
503...

output:

Success
2 4 5 3 4 0 6 4 4 7 4 1 7 7 4 6 7 5 5 1 4 2 6 3 3 4 5 5 7 5 6 5 1 3 0 7 7 2 1 2 7 4 4 6 0 4 0 4 5 1 1 5 4 0 6 7 2 1 2 5 6 5 1 1 7 7 2 6 0 3 3 2 6 0 2 6 7 3 3 4 2 3 3 0 5 5 3 7 7 4 0 1 7 4 0 0 1 2 1 3 0 4 2 1 2 4 3 2 5 4 1 6 5 1 6 5 3 2 5 0 1 6 1 4 1 0 1 2 0 3 4 3 2 7 0 6 0 1 1 3 2 0 2 3 7 2 ...

result:

points 1.0 good solution, L = 20000, used time = 30ms, used memory = 18.344MB

Test #8:

score: 100
Accepted
time: 31ms
memory: 19844kb

input:

10000 500000
2817 5359
4982 1311
9479 1205
8918 7976
2410 1926
9093 715
4788 9575
4320 6234
1120 5522
4132 6667
942 4401
3066 5372
8421 9107
1579 5256
6368 2485
4572 8670
141 1682
9270 6140
2394 3290
1228 3721
7218 7112
2070 3448
2215 9395
7962 726
9396 5995
7719 2831
669 6275
4348 3155
9832 4311
29...

output:

Success
+101110111101010010111001011110010010011111011001010000111111100001000000110011110101001000010001001010110110100101000110011100100011011011000110000111101001011010011000011001110110000000110011100000100101111010101100011001001101110011001111000010100011010001100111100001111001110010100001001...

input:

10000 500000
2817 5359
4982 1311
9479 1205
8918 7976
2410 1926
9093 715
4788 9575
4320 6234
1120 5522
4132 6667
942 4401
3066 5372
8421 9107
1579 5256
6368 2485
4572 8670
141 1682
9270 6140
2394 3290
1228 3721
7218 7112
2070 3448
2215 9395
7962 726
9396 5995
7719 2831
669 6275
4348 3155
9832 4311
29...

output:

Success
4 6 4 7 7 2 3 0 5 7 4 3 2 6 4 3 1 4 2 7 6 2 4 3 2 0 0 7 7 6 4 1 3 0 1 0 6 0 7 7 2 3 0 4 1 2 0 2 1 4 4 7 2 4 4 2 3 1 3 4 2 7 1 5 0 7 2 4 7 1 3 4 1 3 6 5 5 3 2 5 4 2 5 1 3 4 3 7 3 5 0 1 1 7 1 7 5 1 0 4 2 2 6 5 5 4 7 0 2 5 2 1 7 3 6 0 7 1 6 7 0 0 5 4 0 7 2 1 3 5 2 6 4 0 2 6 4 3 7 0 5 4 1 3 1 6 ...

result:

points 1.0 good solution, L = 20000, used time = 31ms, used memory = 19.379MB

Test #9:

score: 100
Accepted
time: 19ms
memory: 18804kb

input:

10000 500000
2685 2829
2361 1549
50 9693
5669 7915
1814 3703
5707 5436
9196 6969
363 5998
8197 1467
378 499
2128 2342
2446 7127
135 6563
2782 6206
8667 9960
7020 9592
4055 7487
9006 4275
5521 9886
6388 4913
6832 9018
2885 5763
195 1149
2500 8826
6222 5888
8015 5780
6101 4226
8449 2067
5084 5668
9890...

output:

Success
+100010001011011110100000101011010101100001010011001111010010100001000101001000011001010011011011001001011110111011101110111001000110100101011001111001111001111010101001001010001001111011001011100011011101001101111011111101001000001110111111110110000101111010110111110111111101110011101110000...

input:

10000 500000
2685 2829
2361 1549
50 9693
5669 7915
1814 3703
5707 5436
9196 6969
363 5998
8197 1467
378 499
2128 2342
2446 7127
135 6563
2782 6206
8667 9960
7020 9592
4055 7487
9006 4275
5521 9886
6388 4913
6832 9018
2885 5763
195 1149
2500 8826
6222 5888
8015 5780
6101 4226
8449 2067
5084 5668
9890...

output:

Success
4 0 4 0 4 6 2 7 4 4 1 0 4 4 6 3 3 2 4 1 3 3 0 7 1 6 6 2 1 4 4 0 2 0 3 3 1 4 1 3 5 2 3 0 6 2 5 7 1 4 2 3 7 4 7 5 7 5 7 5 7 5 3 0 2 5 4 2 2 2 5 2 6 5 3 6 5 2 7 5 5 5 4 3 1 5 4 1 4 2 7 4 7 0 4 7 4 0 6 3 7 2 1 7 2 7 5 6 7 7 3 0 5 1 1 7 5 6 6 7 6 3 4 1 2 2 7 4 5 6 2 6 6 3 6 7 6 2 7 1 7 5 7 5 1 1 ...

result:

points 1.0 good solution, L = 20000, used time = 19ms, used memory = 18.363MB

Test #10:

score: 100
Accepted
time: 30ms
memory: 18792kb

input:

10000 500000
1900 9349
4594 1507
9413 7625
3696 5644
2114 6222
2528 4380
6787 3444
4410 837
8213 1008
5821 3474
1893 6444
615 7784
7568 7607
8041 3307
1521 1189
4375 4004
4399 8516
6825 8241
8254 4509
9064 2275
8746 8949
4212 9229
2191 5280
7990 7578
3550 7777
4691 8121
1761 9000
1441 7580
9932 9457...

output:

Success
+010000010001001100101000110110001101110000001000000101111100101011100000111101111101101101111111110001111010010111111011110011111001110110000000010011001001000111011100100101110010100100011111110110010000111111011010011000111111111011100111000100000110000010100001110111111011000111110101111...

input:

10000 500000
1900 9349
4594 1507
9413 7625
3696 5644
2114 6222
2528 4380
6787 3444
4410 837
8213 1008
5821 3474
1893 6444
615 7784
7568 7607
8041 3307
1521 1189
4375 4004
4399 8516
6825 8241
8254 4509
9064 2275
8746 8949
4212 9229
2191 5280
7990 7578
3550 7777
4691 8121
1761 9000
1441 7580
9932 9457...

output:

Success
2 0 0 3 1 3 0 6 0 4 5 0 6 2 4 0 7 2 7 0 1 1 5 1 0 3 2 7 6 1 5 4 6 4 1 1 6 7 2 7 7 2 4 6 3 7 7 6 6 1 2 6 4 5 2 3 6 7 4 7 7 0 6 6 5 3 7 2 5 1 0 0 2 0 6 1 5 3 0 2 7 3 7 1 4 3 3 7 0 4 4 2 1 2 6 7 6 3 5 3 0 1 6 6 7 3 4 4 3 5 0 7 7 6 6 4 7 5 2 7 1 2 1 1 2 5 1 1 5 5 0 3 7 2 7 7 4 7 1 3 6 7 3 3 6 6 ...

result:

points 1.0 good solution, L = 20000, used time = 30ms, used memory = 18.352MB

Test #11:

score: 100
Accepted
time: 31ms
memory: 18852kb

input:

10000 500000
5986 3032
8973 6887
8038 7386
1419 1558
3835 3931
3752 2041
5633 4218
956 3504
4674 9929
4817 3050
1688 4978
4655 5555
2499 509
3814 6457
5311 3119
211 1591
6383 292
5526 3337
6053 3497
8701 5128
1276 5092
4056 7622
8127 7717
8242 1065
4837 584
6807 6131
4301 1554
4998 3449
478 6070
516...

output:

Success
+101110101111001010101111100101001110100111010001011100100110010101100100001000100101000011001100001101101000110100111001001100100011011001001110000010010010000101100011101100111101011001101000100100001010100110011010110000111011000111100101011101101011001110001010000011011010101110011000001...

input:

10000 500000
5986 3032
8973 6887
8038 7386
1419 1558
3835 3931
3752 2041
5633 4218
956 3504
4674 9929
4817 3050
1688 4978
4655 5555
2499 509
3814 6457
5311 3119
211 1591
6383 292
5526 3337
6053 3497
8701 5128
1276 5092
4056 7622
8127 7717
8242 1065
4837 584
6807 6131
4301 1554
4998 3449
478 6070
516...

output:

Success
4 6 5 5 7 6 0 5 5 5 7 6 4 2 2 0 6 4 4 3 7 2 1 2 3 6 1 4 3 4 2 2 3 4 2 1 1 5 0 5 3 3 0 0 7 1 7 0 1 6 2 5 4 1 6 2 1 6 4 2 1 7 1 4 1 6 3 4 2 0 7 5 1 1 5 2 1 5 0 2 2 4 1 6 4 6 0 7 6 3 2 4 3 5 5 0 4 2 0 0 4 5 4 2 5 3 5 5 6 0 1 6 5 6 1 2 7 4 2 3 3 7 3 4 5 7 1 7 5 0 5 5 0 1 7 2 4 5 4 6 4 3 4 1 1 7 ...

result:

points 1.0 good solution, L = 20000, used time = 31ms, used memory = 18.410MB

Test #12:

score: 100
Accepted
time: 29ms
memory: 18792kb

input:

10000 500000
2883 8829
5326 6829
6638 9427
2409 3333
795 1609
8874 7288
8900 3553
1997 823
7294 8768
8249 1323
4200 2127
2290 4576
506 7132
506 7701
4546 7533
5520 3013
9997 2321
6636 169
8110 6894
9881 1625
665 2376
7712 587
7954 1504
149 995
1539 3945
9914 4954
9194 5272
5941 4552
4133 1272
6719 6...

output:

Success
+100011100011111111010100001010001000001001100011111111111100110000010000010010001110101011001000011101100111100000110000010010110011000001001001000011110101001110111100110110110000100011110011110000100001001111100000000101111111100011110010110001001100101111111010100100110110101000100011110...

input:

10000 500000
2883 8829
5326 6829
6638 9427
2409 3333
795 1609
8874 7288
8900 3553
1997 823
7294 8768
8249 1323
4200 2127
2290 4576
506 7132
506 7701
4546 7533
5520 3013
9997 2321
6636 169
8110 6894
9881 1625
665 2376
7712 587
7954 1504
149 995
1539 3945
9914 4954
9194 5272
5941 4552
4133 1272
6719 6...

output:

Success
4 0 6 4 0 7 7 7 6 2 2 0 1 5 5 0 4 0 0 5 3 4 1 7 6 7 6 7 7 0 6 1 1 2 0 0 3 1 5 1 7 5 4 4 6 0 4 1 2 6 3 4 3 6 4 1 1 7 0 0 3 1 4 6 0 7 1 0 3 0 5 3 0 1 7 6 3 2 1 6 4 7 6 0 7 3 4 6 0 0 4 1 6 6 0 6 7 0 1 4 1 2 0 7 6 4 0 1 0 2 2 6 7 7 5 0 6 6 1 4 7 1 3 0 6 1 4 6 6 7 4 5 4 2 0 6 2 5 5 5 0 5 0 7 7 2 ...

result:

points 1.0 good solution, L = 20000, used time = 29ms, used memory = 18.352MB

Test #13:

score: 100
Accepted
time: 23ms
memory: 18792kb

input:

10000 500000
8721 8101
2565 4627
154 4990
407 5940
8731 1099
129 4366
8538 235
4447 5347
7922 7009
5599 3102
6513 7734
2275 5220
8264 8162
8567 547
2404 9928
1836 8684
8578 936
1035 9369
1848 909
5048 4255
9026 2813
6555 7872
7194 1215
1296 770
8384 6517
5919 1513
9806 3192
813 3814
1763 9542
686 12...

output:

Success
+110011010001110110111001001011101000001111110000110110101100110100100101100110100010000111100101010001001011111101010000111110111101110000111110010011111000000011011011000100001110010000010001101011100000001011000111110001110100101011100001101001100101010110100111101001010111111111110010010...

input:

10000 500000
8721 8101
2565 4627
154 4990
407 5940
8731 1099
129 4366
8538 235
4447 5347
7922 7009
5599 3102
6513 7734
2275 5220
8264 8162
8567 547
2404 9928
1836 8684
8578 936
1035 9369
1848 909
5048 4255
9026 2813
6555 7872
7194 1215
1296 770
8384 6517
5919 1513
9806 3192
813 3814
1763 9542
686 12...

output:

Success
6 0 7 2 0 2 7 2 4 6 5 3 0 4 7 4 5 1 0 6 6 6 0 1 7 2 4 5 7 0 6 2 0 4 2 2 5 2 4 5 0 5 1 3 6 4 3 2 2 1 3 0 4 6 7 7 2 3 0 0 7 6 5 7 6 3 7 1 1 7 7 5 3 1 6 7 4 0 0 0 7 3 4 7 1 2 1 0 6 5 2 0 1 3 0 2 5 4 6 4 0 0 1 4 7 1 2 6 7 0 2 6 2 1 5 5 6 4 0 3 4 4 3 4 3 3 2 3 4 4 2 7 4 4 3 2 3 7 7 7 6 7 0 4 2 0 ...

result:

points 1.0 good solution, L = 20000, used time = 23ms, used memory = 18.352MB

Test #14:

score: 100
Accepted
time: 120ms
memory: 20352kb

input:

10000 500000
9041 3823
1848 6846
9027 6301
1904 1693
9270 1368
8314 4614
7640 429
29 4018
4316 7536
2389 9279
483 3911
6998 525
1313 9790
3115 3456
434 7211
140 3721
8531 2790
9791 2308
3496 4624
7655 4152
1722 3161
8502 621
440 6656
7545 893
6947 5798
1951 8905
1340 8593
6106 6647
5774 3973
1296 57...

output:

Success
+010010000101000001011101010101010101010101010001111100010101010101010101100100011101110101110001010101011111000101010100010000110101000100010101011101011101110001100101010100010101010101000001010101010001110011010101010101000101000111010100010101010100010111010101010101000100011100010000000...

input:

10000 500000
9041 3823
1848 6846
9027 6301
1904 1693
9270 1368
8314 4614
7640 429
29 4018
4316 7536
2389 9279
483 3911
6998 525
1313 9790
3115 3456
434 7211
140 3721
8531 2790
9791 2308
3496 4624
7655 4152
1722 3161
8502 621
440 6656
7545 893
6947 5798
1951 8905
1340 8593
6106 6647
5774 3973
1296 57...

output:

Success
2 0 4 1 2 3 1 0 2 2 6 3 2 2 3 3 3 2 2 2 2 2 0 2 6 6 0 3 2 3 3 2 2 3 2 3 4 3 1 3 6 2 6 3 2 7 0 3 2 3 2 2 6 7 1 2 2 2 2 1 2 1 1 7 2 2 1 3 0 3 3 2 3 6 3 2 7 2 7 1 3 4 3 2 3 2 0 3 3 2 2 2 3 1 1 3 2 2 3 2 1 3 6 1 7 3 3 2 2 2 2 0 3 2 1 2 7 3 2 0 3 2 3 2 2 0 2 2 7 3 2 2 3 2 3 1 2 1 2 7 0 2 0 1 1 1 ...

result:

points 1.0 good solution, L = 20000, used time = 120ms, used memory = 19.875MB

Test #15:

score: 100
Accepted
time: 117ms
memory: 20184kb

input:

10000 500000
2076 4469
2748 275
4773 7861
8788 6833
1593 4356
6872 2011
9439 385
3065 1869
8365 9400
8971 5450
8909 2522
9556 2478
5200 7649
7169 5211
9529 3308
6459 1838
7 4095
8218 651
6224 4725
5358 3512
116 2563
1627 8549
2498 2095
412 8757
1469 9495
308 544
7097 7294
4554 8724
7144 4476
1885 90...

output:

Success
+110100010000010000110001010100011101011101010101010101000101000110010100010001010001110011000100010100001101000100000111000100010101010101010001010101000100001000010100010101010001010101010111110101010000010001011101010111010100110101011101010010000101010100010000010101000100000101010101000...

input:

10000 500000
2076 4469
2748 275
4773 7861
8788 6833
1593 4356
6872 2011
9439 385
3065 1869
8365 9400
8971 5450
8909 2522
9556 2478
5200 7649
7169 5211
9529 3308
6459 1838
7 4095
8218 651
6224 4725
5358 3512
116 2563
1627 8549
2498 2095
412 8757
1469 9495
308 544
7097 7294
4554 8724
7144 4476
1885 90...

output:

Success
6 2 0 2 1 1 2 0 1 6 0 2 3 3 0 2 6 3 3 7 3 2 3 3 3 3 2 1 2 3 1 2 4 2 2 1 3 1 2 2 1 3 6 0 6 0 2 0 2 2 0 0 6 2 0 2 0 0 3 6 0 3 0 3 2 2 3 2 3 2 0 3 2 3 3 0 3 1 0 4 0 2 3 1 2 2 3 3 1 2 3 3 3 2 3 6 6 3 3 3 0 0 3 0 2 3 7 3 3 3 6 2 3 0 6 3 3 2 7 3 3 0 4 1 2 3 2 3 1 2 1 0 3 3 2 1 2 1 1 3 3 2 3 3 0 1 ...

result:

points 1.0 good solution, L = 20000, used time = 117ms, used memory = 19.711MB

Test #16:

score: 100
Accepted
time: 118ms
memory: 20120kb

input:

10000 500000
1043 3406
6409 6304
5189 3865
6416 4478
2252 8997
6261 4754
9166 1392
4422 3963
8553 2892
2671 4689
7622 1027
1162 5136
7198 3086
1048 4319
957 4133
2566 8309
115 691
8223 4269
7611 1386
7418 3575
5226 5457
2062 8322
8968 6541
4985 2623
7104 9187
7675 6949
6201 6051
3197 6892
7022 7284
...

output:

Success
+011101000011000101110101010101000101110001011111000000000111010101010101010000101101010101010110000000110101000101001111010101011001000101010101110101011101011101010101010000010101010101001101010101110101010101000101110100010100010000010101000101010001010101100110010101011101001001010001010...

input:

10000 500000
1043 3406
6409 6304
5189 3865
6416 4478
2252 8997
6261 4754
9166 1392
4422 3963
8553 2892
2671 4689
7622 1027
1162 5136
7198 3086
1048 4319
957 4133
2566 8309
115 691
8223 4269
7611 1386
7418 3575
5226 5457
2062 8322
8968 6541
4985 2623
7104 9187
7675 6949
6201 6051
3197 6892
7022 7284
...

output:

Success
2 6 2 0 1 7 1 3 3 7 2 3 3 3 3 1 3 3 6 0 3 3 6 7 0 1 0 1 3 7 3 3 3 3 2 3 3 1 0 4 6 3 3 2 3 2 3 4 0 0 0 6 2 3 1 3 2 0 7 6 3 2 3 3 4 2 1 3 3 2 3 2 6 2 3 3 6 3 3 6 3 2 3 3 2 1 0 2 2 3 3 2 3 1 6 2 2 3 2 7 3 3 2 2 3 0 2 2 6 3 1 3 3 0 2 0 1 3 3 3 0 2 3 3 1 3 3 3 2 4 2 4 3 2 3 2 7 3 1 4 3 2 0 2 2 1 ...

result:

points 1.0 good solution, L = 20000, used time = 118ms, used memory = 19.648MB

Test #17:

score: 100
Accepted
time: 125ms
memory: 20176kb

input:

10000 500000
4359 4322
6811 4060
8156 4226
9902 2763
2560 7000
1678 2942
8134 7133
6853 8644
2043 5838
6448 618
8359 9657
8714 5300
5118 7680
7859 457
7327 6264
4466 137
4763 6290
797 9393
8776 931
3242 614
7264 7473
8410 6091
1993 2978
537 5332
7994 3074
4884 7298
7053 7170
4777 1044
7330 5134
6984...

output:

Success
+110100011101010101000101010001010101010011111001010100010101110001000001010101000101010100010101010000010101110101010101010101000101010101010101010100010101010101010001010101010101000101110001010100000101001001110001000101000101000101000101010111000101011101010111010101010111110001010100010...

input:

10000 500000
4359 4322
6811 4060
8156 4226
9902 2763
2560 7000
1678 2942
8134 7133
6853 8644
2043 5838
6448 618
8359 9657
8714 5300
5118 7680
7859 457
7327 6264
4466 137
4763 6290
797 9393
8776 931
3242 614
7264 7473
8410 6091
1993 2978
537 5332
7994 3074
4884 7298
7053 7170
4777 1044
7330 5134
6984...

output:

Success
6 2 0 3 6 2 3 3 3 1 3 3 2 0 2 3 2 3 2 1 6 6 4 2 3 3 0 2 2 2 6 1 3 0 1 2 3 3 3 1 2 3 3 3 1 2 3 2 3 1 1 3 3 2 7 2 3 3 3 2 2 2 3 0 3 2 2 2 3 3 2 3 2 3 1 2 3 3 3 3 3 2 0 2 2 3 2 3 3 3 1 2 2 7 0 3 2 3 1 1 3 3 1 4 2 7 1 2 1 3 2 1 2 3 0 2 2 1 3 3 2 2 6 0 3 2 3 6 3 3 2 7 2 3 2 2 3 6 6 0 3 2 3 1 2 2 ...

result:

points 1.0 good solution, L = 20000, used time = 125ms, used memory = 19.703MB

Test #18:

score: 100
Accepted
time: 122ms
memory: 21496kb

input:

10000 500000
8171 6920
4645 9088
7859 9794
6099 9832
2828 2325
4220 3718
4314 9526
367 8575
9699 4262
2849 872
5195 7533
4168 6616
329 8989
1423 4753
1616 5200
5210 344
4055 8333
7792 7499
9739 8471
9284 9548
1922 4774
7469 7448
5514 715
1582 2519
1204 5745
9772 4381
1946 9154
8523 6503
6046 2177
95...

output:

Success
+100001011110000001110110000001010000010101010001010111000101001101000101010101010100111101010001010100011101011101000001000101010101001101000101010100000101010111110101010100010101010001110001010101000111010000000101010000010101010010000101110110010101010101010101110100111100000100010100100...

input:

10000 500000
8171 6920
4645 9088
7859 9794
6099 9832
2828 2325
4220 3718
4314 9526
367 8575
9699 4262
2849 872
5195 7533
4168 6616
329 8989
1423 4753
1616 5200
5210 344
4055 8333
7792 7499
9739 8471
9284 9548
1922 4774
7469 7448
5514 715
1582 2519
1204 5745
9772 4381
1946 9154
8523 6503
6046 2177
95...

output:

Success
4 0 2 2 6 4 0 1 2 6 2 4 1 1 3 3 1 1 2 3 2 3 1 3 3 3 6 1 2 2 0 7 2 1 2 2 2 2 3 3 2 0 7 7 2 2 0 2 3 2 1 2 6 3 3 6 3 0 1 3 1 3 3 3 2 2 0 6 2 0 2 2 2 3 1 1 3 2 2 3 6 6 2 2 3 3 1 2 2 2 3 1 3 6 0 3 3 3 2 0 2 6 2 0 1 0 2 3 2 1 1 2 2 3 2 1 4 0 2 2 6 2 4 2 2 3 3 2 2 3 2 2 6 2 1 6 6 0 0 3 1 2 3 0 4 3 ...

result:

points 1.0 good solution, L = 20000, used time = 122ms, used memory = 20.992MB

Test #19:

score: 100
Accepted
time: 69ms
memory: 21696kb

input:

10000 500000
1506 1399
1461 6010
3251 4825
8635 3481
3664 6115
434 1513
2836 3502
3204 4682
6099 9911
9488 2958
4868 9802
114 4999
2636 4746
623 5950
649 4924
9939 9478
8682 1929
9840 8888
9815 4678
8137 925
1485 940
4193 2198
3668 9098
6269 2829
5171 8226
4689 4891
405 7384
6611 4079
6354 4679
7358...

output:

Success
+010101010101010100010101000000011101010100010101010101010101010101010101010101010101010101010101010101001101010101000101010001010101110101010101010001010100010100010101011001010101010101010101010101010101010101010001010001010001010101000101010101010101010001010100010101000101010101110001010...

input:

10000 500000
1506 1399
1461 6010
3251 4825
8635 3481
3664 6115
434 1513
2836 3502
3204 4682
6099 9911
9488 2958
4868 9802
114 4999
2636 4746
623 5950
649 4924
9939 9478
8682 1929
9840 8888
9815 4678
8137 925
1485 940
4193 2198
3668 9098
6269 2829
5171 8226
4689 4891
405 7384
6611 4079
6354 4679
7358...

output:

Success
2 2 3 2 2 3 3 3 0 3 2 3 0 1 1 3 6 2 2 2 1 2 2 3 3 2 2 3 2 2 2 3 3 3 3 2 3 2 2 3 2 3 2 2 2 2 2 2 2 2 2 0 6 2 2 2 2 0 2 2 3 0 2 2 2 2 6 2 2 3 2 2 2 1 2 2 2 0 2 3 0 3 2 2 2 4 3 2 2 2 3 3 2 2 2 2 2 2 2 2 2 2 2 3 2 3 0 2 2 0 3 2 0 2 3 2 2 0 3 3 2 2 3 2 2 2 2 0 2 2 2 0 3 3 2 0 2 2 2 3 3 7 1 2 2 2 ...

result:

points 1.0 good solution, L = 20000, used time = 69ms, used memory = 21.188MB

Test #20:

score: 100
Accepted
time: 82ms
memory: 21784kb

input:

10000 500000
7384 3010
7204 1416
52 3339
1842 4312
5327 185
3909 3636
5667 5157
177 2216
5726 6698
4243 7427
18 1711
182 1441
4813 9107
9087 7099
783 3363
1489 75
9469 4596
6656 5579
9878 7527
4769 6854
7268 7143
8190 4909
5549 4656
4948 3333
5449 4968
330 909
7158 5054
2452 3963
2657 3704
8672 6950...

output:

Success
+000100010101010101010101010001010101000101010101010101000101000101010101010101010101010101010001010100010001010101010001010101010101010101010101010001000101010101010101110101010101000101000111010101010101010101010001011101010101010101010001010101010101000101010001010101010101010101000100000...

input:

10000 500000
7384 3010
7204 1416
52 3339
1842 4312
5327 185
3909 3636
5667 5157
177 2216
5726 6698
4243 7427
18 1711
182 1441
4813 9107
9087 7099
783 3363
1489 75
9469 4596
6656 5579
9878 7527
4769 6854
7268 7143
8190 4909
5549 4656
4948 3333
5449 4968
330 909
7158 5054
2452 3963
2657 3704
8672 6950...

output:

Success
0 2 1 2 2 2 2 2 3 2 2 2 2 1 3 3 2 3 1 2 2 3 3 2 2 2 2 1 2 3 1 3 2 2 2 2 3 2 3 2 3 2 2 2 2 2 1 2 2 2 1 2 1 2 3 3 2 2 0 2 3 2 2 2 2 3 2 2 3 2 3 2 2 1 3 1 2 3 3 2 2 3 3 3 6 2 2 2 2 2 0 3 3 1 2 6 2 3 2 2 2 3 3 2 2 2 0 2 2 6 2 3 3 2 2 2 2 2 0 2 3 2 2 3 3 2 1 3 2 2 0 3 3 3 2 2 3 3 2 2 3 1 3 0 1 3 ...

result:

points 1.0 good solution, L = 20000, used time = 82ms, used memory = 21.273MB

Test #21:

score: 0
Stage 2: Program Bob Time Limit Exceeded

input:

100000 500000
441 1891
1484 1540
5616 7718
12455 9161
1134 74520
2599 82
2195 15256
1449 3390
68 18
498 9251
22146 36954
941 31590
2955 5059
18317 36813
5353 90934
11858 46792
564 6310
1004 7159
1586 3109
3471 22630
5810 51344
249 5144
11576 1465
21183 39579
81700 33228
241 7580
30507 68664
482 9510...

output:

Success
+010101010101000101010101010101000101010101010101000001110000010101010010010101010101010101010111000101010101010101010101010101010101000100010101010101010101010101010100010101010101010101010101010101110101000100010101010101010001010101010100011101110111010101010101010100010101010101010001010...

input:

100000 500000
441 1891
1484 1540
5616 7718
12455 9161
1134 74520
2599 82
2195 15256
1449 3390
68 18
498 9251
22146 36954
941 31590
2955 5059
18317 36813
5353 90934
11858 46792
564 6310
1004 7159
1586 3109
3471 22630
5810 51344
249 5144
11576 1465
21183 39579
81700 33228
241 7580
30507 68664
482 9510...

output:

Unauthorized output

result: