QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#719701#9606. PM 大师hos_lyric#20 540ms34608kbC++144.0kb2024-11-07 08:09:572024-11-07 08:09:57

Judging History

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

  • [2024-11-07 08:09:57]
  • 评测
  • 测评结果:20
  • 用时:540ms
  • 内存:34608kb
  • [2024-11-07 08:09:57]
  • 提交

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 <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#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 COLOR(s) ("\x1b[" s "m")


template <class T> void bAdd(vector<T> &bit, int pos, const T &val) {
  const int bitN = bit.size();
  for (int x = pos; x < bitN; x |= x + 1) bit[x] += val;
}
template <class T> T bSum(const vector<T> &bit, int pos) {
  T ret = 0;
  for (int x = pos; x > 0; x &= x - 1) ret += bit[x - 1];
  return ret;
}
template <class T> T bSum(const vector<T> &bit, int pos0, int pos1) {
  return bSum(bit, pos1) - bSum(bit, pos0);
}

// min pos s.t. pred(sum of [0, pos))
//   assume pred(sum of [0, pos)) is non-decreasing
template <class T, class Pred>
int bBinarySearch(const vector<T> &bit, Pred pred) {
  if (pred(T(0))) return 0;
  const int bitLen = bit.size();
  int pos = 0;
  T sum = 0;
  for (int e = 31 - __builtin_clz(bitLen); e >= 0; --e) {
    const int x = (pos | 1 << e) - 1;
    if (x < bitLen && !pred(sum + bit[x])) {
      pos |= 1 << e;
      sum += bit[x];
    }
  }
  return pos + 1;
}


int N, Q;
vector<int> A;
vector<int> X, K, Y;

namespace brute {
vector<int> run() {
  auto as = A;
  vector<int> bs(N);
  vector<int> app(N + 1, -1);
  vector<int> ans(Q, -1);
  for (int q = 0; q < Q; ++q) {
    as[X[q]] = K[q];
    int mex = 0;
    for (int i = 0; i < N; ++i) {
      if (as[i] == -1) {
        for (; app[mex] == q; ++mex) {}
        bs[i] = mex;
      } else {
        bs[i] = as[i];
      }
      if (bs[i] >= 0) {
        app[bs[i]] = q;
      }
    }
    ans[q] = bs[Y[q]];
  }
  return ans;
}
}  // brute

namespace sub2 {
vector<int> run() {
  int I0;
  for (I0 = 0; I0 < N && A[I0] == -2; ++I0) {}
  vector<int> bit(N + 1, 0);
  for (int x = 0; x <= N; ++x) bAdd(bit, x, +1);
  auto as = A;
  vector<int> freq(N + 1, 0);
  vector<int> ans(Q, -1);
  for (int q = 0; q < Q; ++q) {
    {
      int &a = as[X[q]];
      if (a >= 0) if (!--freq[a]) bAdd(bit, a, +1);
      a = K[q];
      if (a >= 0) if (!freq[a]++) bAdd(bit, a, -1);
    }
    if (Y[q] < I0) {
      ans[q] = as[Y[q]];
    } else {
      ans[q] = bBinarySearch(bit, [&](int sum) -> bool {
        return (sum > Y[q] - I0);
      }) - 1;
    }
  }
  return ans;
}
}  // sub2

int main() {
  for (; ~scanf("%d%d", &N, &Q); ) {
    A.resize(N);
    for (int i = 0; i < N; ++i) {
      scanf("%d", &A[i]);
      --A[i];
    }
    X.resize(Q);
    K.resize(Q);
    Y.resize(Q);
    for (int q = 0; q < Q; ++q) {
      scanf("%d%d%d", &X[q], &K[q], &Y[q]);
      --X[q];
      --K[q];
      --Y[q];
    }
    
    bool spe2 = true;
    for (int i = 0; i < N - 1; ++i) spe2 = spe2 && (A[i] <= A[i + 1]);
    
    vector<int> ans;
    if (spe2) {
      ans = sub2::run();
    } else {
      ans = brute::run();
    }
    for (int q = 0; q < Q; ++q) {
      printf("%d\n", ans[q] + 1);
    }
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3812kb

input:

10 10
0 -1 0 0 -1 0 -1 -1 0 -1
7 5 9
7 5 1
10 8 4
7 10 1
8 -1 3
10 6 4
2 2 1
2 9 6
5 8 4
7 -1 9

output:

6
1
3
1
2
3
1
4
3
5

result:

ok 10 lines

Test #2:

score: 10
Accepted
time: 412ms
memory: 4140kb

input:

10000 10000
-1 0 -1 -1 -1 0 -1 0 -1 0 -1 0 0 -1 -1 0 0 -1 0 -1 -1 -1 0 0 -1 -1 0 -1 -1 -1 0 0 0 -1 0 -1 -1 -1 -1 0 -1 -1 0 -1 -1 0 -1 -1 0 0 -1 0 0 0 -1 -1 -1 -1 0 0 0 0 -1 0 -1 -1 0 -1 -1 -1 0 0 -1 0 0 -1 -1 0 0 -1 -1 -1 -1 0 0 0 -1 0 -1 0 0 0 0 -1 0 0 -1 -1 0 -1 -1 -1 0 -1 0 -1 0 0 -1 -1 0 -1 -1 0...

output:

37
1767
2083
1505
2208
3174
1012
3136
4044
2661
802
4772
931
2188
605
732
1473
1221
4070
706
3786
464
300
2857
4852
3026
2965
2102
4096
4859
1841
60
2465
645
4312
2002
4168
3292
2854
2043
194
4748
3298
1687
916
4465
1101
4649
4552
598
3717
3883
2111
1911
2502
2265
2737
2193
4200
3607
4086
3908
2529
...

result:

ok 10000 lines

Test #3:

score: 10
Accepted
time: 134ms
memory: 4084kb

input:

10000 10000
0 0 -1 0 0 -1 0 0 0 0 0 0 0 0 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 ...

output:

6984
1876
1755
3945
3988
8817
1301
9211
6838
70
2044
5300
4026
6870
1879
7611
2604
5187
8292
1796
5087
2635
2369
8040
5721
6993
5554
966
5743
4301
8644
4755
2400
4647
6158
6998
2597
7698
8252
6522
8528
8153
3332
2833
4289
3081
9022
6921
6121
1549
2801
958
9507
2148
7998
4954
8624
7643
22
4162
5666
8...

result:

ok 10000 lines

Test #4:

score: 10
Accepted
time: 143ms
memory: 4080kb

input:

10000 10000
0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 -1 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 ...

output:

549
7364
7058
4716
4807
6918
163
2855
4219
8220
1848
2315
1228
6516
1570
7755
728
911
2810
2028
3977
6371
8418
788
2040
7159
7360
3776
8573
8326
3057
3814
3587
4894
2018
5314
812
5691
5689
7967
4493
7806
1966
5618
6862
3303
1947
6878
7511
6879
5418
5836
8916
5951
4960
1424
1290
4315
873
3208
1774
73...

result:

ok 10000 lines

Test #5:

score: 10
Accepted
time: 205ms
memory: 4372kb

input:

10000 10000
-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 -1 -1 -1 -1 0 0 0 0 0 -1 -1 0 0 0 -1 0 0 0 0 -1 0 0 -1 0 0 0 -1 -1 0 -1 -1 0 -1 -1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 -1 0 -1 0 0 -1 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 -1 0 -1 -1 0 0 0 ...

output:

3638
2094
6615
88
2643
3081
3993
7204
6569
1008
7035
4008
6846
2407
2888
6884
5588
340
3145
3234
3779
2608
6289
1428
2477
3411
161
2203
2128
5677
1759
2106
6596
313
7461
5011
1208
3021
7029
3452
4582
6173
479
4360
224
3681
5249
2351
569
1369
5212
5572
3429
7152
6636
6318
6928
6644
6678
5661
4229
185...

result:

ok 10000 lines

Test #6:

score: 10
Accepted
time: 271ms
memory: 4080kb

input:

10000 10000
-1 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 0 -1 -1 -1 0 -1 0 -1 -1 -1 -1 -1 -1 0 -1 -1 0 -1 -1 0 -1 0 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 0 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 ...

output:

2420
325
2194
1102
1154
1391
12
1517
1948
1801
593
441
975
1902
1078
184
226
587
52
2361
1584
2137
2255
190
1904
193
636
62
1915
1028
1751
612
330
659
1700
1672
1073
756
202
425
766
522
1844
2295
744
37
865
2367
32
1066
948
1026
1162
812
625
1512
161
1394
2372
429
1232
1155
1295
998
1941
1632
1151
1...

result:

ok 10000 lines

Test #7:

score: 10
Accepted
time: 212ms
memory: 4372kb

input:

10000 10000
-1 0 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 -1 0 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0...

output:

219
484
774
725
570
54
54
931
240
552
787
897
322
15
756
440
675
152
337
275
408
856
622
562
494
3
890
858
849
460
141
187
119
271
441
426
550
804
308
823
398
918
244
522
213
785
84
429
428
500
619
179
808
173
853
1011
955
46
375
520
704
416
955
800
661
899
953
533
319
87
1011
172
254
810
842
879
59...

result:

ok 10000 lines

Test #8:

score: 10
Accepted
time: 205ms
memory: 4080kb

input:

10000 10000
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

236
370
232
128
262
311
250
336
164
107
97
183
354
3
346
307
282
350
99
214
350
489
170
373
130
81
221
200
184
275
451
67
60
70
41
472
153
479
288
228
212
332
68
76
338
114
242
116
207
22
234
204
451
213
258
159
34
193
259
122
448
105
131
177
474
490
439
405
170
322
380
360
425
33
414
302
191
161
33...

result:

ok 10000 lines

Subtask #2:

score: 10
Accepted

Test #9:

score: 10
Accepted
time: 500ms
memory: 34604kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

459886
53317
492356
423943
292374
39197
57078
411846
146532
49283
12402
316482
109785
61994
283770
156543
483178
281298
130833
46233
335000
428931
210801
24959
71722
361514
117444
218823
54814
378720
81973
194272
135873
484070
293734
303811
349950
344506
479375
229463
8421
114254
237253
295732
15835...

result:

ok 1000000 lines

Test #10:

score: 10
Accepted
time: 524ms
memory: 34592kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

231864
158988
610606
558023
74606
42402
245012
525664
260911
510218
257983
146399
83879
681860
375125
59670
894882
210723
509929
9256
413137
839173
549143
526070
729809
423388
596082
184674
660967
119639
742727
901832
938252
900078
190461
920677
441621
942117
188500
185870
522884
40015
9817
716146
7...

result:

ok 1000000 lines

Test #11:

score: 10
Accepted
time: 540ms
memory: 34360kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

36874
472618
842917
114716
491408
773508
452063
603860
728342
748513
475705
258696
486435
316427
736929
378854
238269
110066
1161
156017
484791
539880
789570
421405
27960
173470
21339
774513
531030
728993
156647
533307
212440
258827
731424
220524
712655
444910
546596
745273
497179
341745
676112
5092...

result:

ok 1000000 lines

Test #12:

score: 10
Accepted
time: 510ms
memory: 34524kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

668119
431443
15455
296704
240224
645285
127520
95201
89016
184805
731059
712630
396434
292253
553741
212645
355171
214190
127817
191153
701410
89507
340566
287015
187296
35719
746439
375147
88190
102370
390425
435125
502654
399775
608758
98602
171926
271902
511567
384122
726564
28359
4230
471734
12...

result:

ok 1000000 lines

Test #13:

score: 10
Accepted
time: 443ms
memory: 34392kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

122105
239109
25040
14694
216977
99003
181576
195235
117059
231141
152732
140117
42783
77977
226878
131724
129445
6315
84475
200684
240468
74983
112696
224812
7559
33824
18998
187
133123
151253
107837
158008
132668
13180
180187
124564
177382
102508
128808
131293
88975
157536
238149
98474
128162
9293...

result:

ok 1000000 lines

Test #14:

score: 10
Accepted
time: 420ms
memory: 34392kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

47044
6150
94661
59151
4729
2518
23567
71693
42072
50518
22840
39707
35445
82412
27250
50855
39799
64638
21397
39142
82263
66705
54956
24413
54915
20050
12379
30158
7056
56960
48528
81919
34586
47114
79033
79833
35677
74173
90352
31325
75842
4392
42035
27995
87130
20590
19983
78934
8490
46331
18425
...

result:

ok 1000000 lines

Test #15:

score: 10
Accepted
time: 396ms
memory: 34608kb

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

41828
48247
26228
2049
8832
16507
32126
45098
16614
23119
34270
34422
36737
30148
40987
19693
38932
49063
35507
26936
34825
4751
48640
8128
29266
16813
36942
31358
20695
21688
15879
16628
42878
6807
40994
38198
1395
11655
10644
35127
2309
23706
2631
15256
28080
47633
38700
24115
9522
27033
46263
538...

result:

ok 1000000 lines

Subtask #3:

score: 0
Time Limit Exceeded

Test #16:

score: 0
Time Limit Exceeded

input:

1000000 1000000
0 -1 -1 0 -1 -1 0 -1 0 -1 0 0 0 0 -1 -1 -1 0 -1 0 -1 0 -1 -1 0 -1 -1 -1 0 -1 -1 -1 0 -1 0 0 0 -1 -1 -1 -1 0 -1 -1 0 0 -1 -1 0 -1 -1 -1 0 -1 0 -1 0 0 -1 0 -1 -1 -1 -1 -1 -1 -1 0 -1 0 0 -1 0 0 0 0 0 0 0 0 0 -1 0 -1 0 0 0 -1 -1 -1 0 0 0 -1 0 0 0 -1 -1 0 0 0 0 -1 -1 0 0 0 0 -1 0 -1 0 0 0...

output:


result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #23:

score: 0
Time Limit Exceeded

input:

1000000 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:


result:


Subtask #5:

score: 0
Time Limit Exceeded

Test #26:

score: 0
Time Limit Exceeded

input:

1000000 499990
-1 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 -1 0 0 0 -1 0 -1 -1 0 0 0 0 -1 -1 0 -1 -1 -1 0 -1 0 -1 0 -1 0 0 0 0 -1 0 -1 0 0 0 0 0 -1 0 -1 -1 -1 0 -1 -1 0 0 0 0 -1 -1 -1 0 0 0 -1 -1 0 0 -1 0 -1 -1 0 -1 -1 -1 0 0 0 -1 0 0 0 0 -1 0 0 -1 -1 0 -1 0 0 -1 -1 0 0 -1 0 0 0 -1 -1 -1 -1 0 -1 0 -1 -1 -1 0...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%