QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#560203#9240. Mosaicchenxinyang2006#29 186ms63632kbC++204.0kb2024-09-12 14:18:292024-09-12 14:18:30

Judging History

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

  • [2024-09-12 14:18:30]
  • 评测
  • 测评结果:29
  • 用时:186ms
  • 内存:63632kb
  • [2024-09-12 14:18:29]
  • 提交

answer

#include "mosaic.h"
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;

template <class T>
void chkmax(T &x,T y){
    if(x < y) x = y;
}

template <class T>
void chkmin(T &x,T y){
    if(x > y) x = y;
}

inline int popcnt(int x){
    return __builtin_popcount(x);
}

inline int ctz(int x){
    return __builtin_ctz(x);
}
int n,m;

struct solver{
    int a[200005];
    ll ssum[200005],sum[200005],qwq[200005];
    void init(){
        rep(i,1,n) sum[i] = sum[i - 1] + a[i];
        rep(i,1,n) ssum[i] = ssum[i - 1] + a[i] * i;
        rep(i,1,n){
            qwq[i] = a[i];
            if(i >= 2) qwq[i] += qwq[i - 2];
        }
    }
    int eval(int x,int y){
        ll answer = 0;
        int p = max(1,x - (2 * y - 1));
        chkmin(p,x + 1);
        
        if(p <= x){
            answer += (x + 2) * (sum[x] - sum[p - 1]) - (ssum[x] - ssum[p - 1]);
            answer -= qwq[x - 1];
            if(p % 2 != x % 2){
                if(p >= 2) answer += qwq[p - 2];
            }else{
                answer += qwq[p - 1];
            }
//            rep(i,p,x) if(a[i] && i % 2 != x % 2) answer--;
            answer /= 2;
        }
        answer += sum[p - 1] * y;
        return answer;
    }
}P[2],Q[2];
vector <int> a[200005],b[200005],c[200005];
ll getsum(int x,int y){
    if(!x || !y) return 0;
//    int up;
    ll answer = b[x][min(y,2)] + c[min(x,2)][y];
/*    rep(i,1,n){
        up = min(n,2);
        if(i <= 2) up = n;
        rep(j,1,up){
            if(i > x || j > y) continue;
            if(!a[i][j]) continue;
            answer++;
        }
    }*/
    rep(p,3,4) if(p <= y) answer += P[p - 3].eval(x,(y - p) / 2 + 1);
    rep(p,3,4) if(p <= x) answer += Q[p - 3].eval(y,(x - p) / 2 + 1);
    rep(p,3,4){
        rep(q,3,4){
            if(p > x || q > y) continue;
            if(!a[p][q]) continue;
            answer -= min((x - p) / 2,(y - q) / 2) + 1;
        }
    }
    return answer;
}

vector<ll> mosaic(vector<int> X, vector<int> Y,vector<int> U, std::vector<int> D,vector<int> L,vector<int> R) {
    n = SZ(X);m = SZ(U);
    rep(i,0,m - 1){
        U[i]++;D[i]++;L[i]++;R[i]++;    
    }
    rep(i,1,max(4,n)){
        if(i <= 4) a[i].resize(n + 1);
        else a[i].resize(5);
    }
    rep(i,1,n){
        a[1][i] = X[i - 1];
        a[i][1] = Y[i - 1];
    }
    rep(i,2,n){
        int up = 4;
        if(i <= 4) up = n;
        rep(j,2,up){
            if(!a[i - 1][j] && !a[i][j - 1]) a[i][j] = 1;
            else a[i][j] = 0;
        }
    }
    rep(i,0,n) b[i].resize(3);
    rep(p,0,2) c[p].resize(n + 1);
    rep(i,1,n){
        b[i][1] = a[i][1];
        b[i][2] = a[i][2];
        if(i >= 3){
            c[1][i] = a[1][i];
            c[2][i] = a[2][i];            
        }
    }
//    cerr << "qwq\n";
    rep(i,1,n){
        rep(j,1,2) b[i][j] += b[i][j - 1];
    }
    rep(i,1,n){
        rep(j,1,2) b[i][j] += b[i - 1][j];
    }    
    rep(i,1,2){
        rep(j,1,n) c[i][j] += c[i][j - 1];
    }
    rep(i,1,2){
        rep(j,1,n) c[i][j] += c[i - 1][j];
    }      

    rep(i,3,n){
        P[0].a[i] = a[i][3];
        P[1].a[i] = a[i][4];
        Q[0].a[i] = a[3][i];
        Q[1].a[i] = a[4][i];
    }
    rep(p,0,1){
        P[p].init();
        Q[p].init();
    }

    vector <ll> ans(m);
    rep(i,0,m - 1){
        ans[i] = getsum(D[i],R[i]) - getsum(U[i] - 1,R[i]) - getsum(D[i],L[i] - 1) + getsum(U[i] - 1,L[i] - 1);
    }
    return ans;
}
/*
g++ mosaic.cpp grader2.cpp -o grader.exe -Wall -Wshadow -O2 -std=c++14
*/

详细

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 2ms
memory: 10064kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
0
0
10
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

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
0
0
0
0
0
0
0
0
0

result:

ok 

Test #2:

score: 5
Accepted
time: 2ms
memory: 8168kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1
1
1
10
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

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
1
1
1
1
1
1
1
1
1

result:

ok 

Test #3:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 0
10
1 1 0 1
1 1 0 1
0 0 0 0
0 1 0 1
0 1 0 1
1 1 0 0
0 1 0 1
0 1 1 1
1 1 0 1
0 0 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
1
1
2
2
0
2
1
1
1

result:

ok 

Test #4:

score: 5
Accepted
time: 1ms
memory: 7980kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 0
10
0 1 1 1
0 1 0 1
0 1 0 0
1 1 0 1
0 1 0 1
0 1 0 0
1 1 1 1
0 0 0 1
0 1 0 0
1 1 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
2
1
1
2
1
1
1
1
0

result:

ok 

Test #5:

score: 5
Accepted
time: 2ms
memory: 10028kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 1
0 0
10
0 1 0 0
0 0 0 1
0 1 0 0
0 0 0 0
1 1 1 1
0 1 0 0
0 0 0 1
0 1 0 1
0 1 0 1
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
0
0
0
0
1
1
1
1

result:

ok 

Test #6:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 1
1 0
10
0 0 0 1
0 0 0 1
1 1 0 1
0 1 0 1
0 1 0 0
0 1 1 1
1 1 0 1
0 0 1 1
0 1 0 0
0 1 0 0

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
0
2
1
1
0
1
1
1

result:

ok 

Test #7:

score: 5
Accepted
time: 2ms
memory: 7960kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 0
0 1
10
0 0 0 0
0 1 0 1
0 1 0 1
0 1 0 1
0 1 1 1
0 0 1 1
0 0 0 1
0 1 0 0
1 1 0 1
1 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
1
1
0
0
0
1
1
1

result:

ok 

Test #8:

score: 5
Accepted
time: 2ms
memory: 9940kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 0
1 1
10
0 1 0 0
1 1 0 1
0 0 0 1
1 1 1 1
1 1 0 0
0 1 1 1
0 1 0 0
0 0 1 1
1 1 0 1
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
1
1
0
1
0
2
0
1
2

result:

ok 

Test #9:

score: 5
Accepted
time: 2ms
memory: 7908kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
0 1
0 1
10
0 1 0 1
0 1 0 1
1 1 1 1
0 1 0 1
0 0 1 1
0 1 0 1
0 1 1 1
0 0 0 0
0 1 0 0
0 1 0 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
0
2
1
2
1
0
1
2

result:

ok 

Test #10:

score: 5
Accepted
time: 2ms
memory: 7904kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
2
1 1
1 1
10
0 0 0 1
0 1 0 0
0 1 0 0
0 1 0 1
0 0 0 0
0 1 0 1
0 1 0 1
0 1 1 1
0 1 0 1
1 1 1 1

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2
2
2
3
1
3
3
1
3
0

result:

ok 

Subtask #2:

score: 7
Accepted

Dependency #1:

100%
Accepted

Test #11:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199
0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 0 1...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1078
5062
897
428
10378
1260
1733
4327
697
1864
34
430
709
5682
5295
625
39
10
196
416
3048
87
4065
49
1368
1220
80
1440
1083
5053
5561
2680
56
2539
1107
57
3705
1996
327
2789
432
1542
571
1643
756
5253
1931
1934
245
3545
2026
4364
935
1506
1992
1815
75
9847
1279
...

result:

ok 

Test #12:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200
1 1 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 0 1 1 1 0 0 1 1...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
3769
339
45
1631
13942
12533
2707
3153
945
4842
2223
5488
1671
2091
557
4839
3455
3211
2621
5391
7299
2789
757
2455
2546
713
9014
2772
1901
3239
1974
2740
6109
1088
5177
958
240
296
2539
517
1889
1345
1467
4590
1944
7950
2623
7550
3121
3184
2851
1237
1233
4601
356...

result:

ok 

Test #13:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200
0 0 1 1 0 1 1 0 1 1 1 0 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 0 0 1 1 0 1 0 1 0 0 1 0 0 0 0 1 0 1 1 0 1 0 0 0 1 0 1 1 0 0 0 1 1 1 1 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
399
1631
42
3980
131
6488
1333
596
2143
10675
396
3779
8731
4904
883
4840
5180
8077
1241
5867
323
11414
158
11432
6296
3329
8996
1795
1219
4201
1308
4965
89
4184
5672
13700
1008
8644
6885
3282
2118
2533
5752
738
64
1456
6079
7179
9318
10003
1762
5081
2469
3192
247...

result:

ok 

Test #14:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200
1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1772
8342
7792
8906
6572
8559
11629
9114
11352
2252
4844
11182
9524
8174
12471
13142
12557
8370
5294
10699
2601
10538
10432
4778
7121
9615
8315
10534
7944
6386
14210
1448
9460
5293
6503
15236
10545
13422
6012
9768
4170
12675
12870
6104
5791
11519
10269
10816
12527...

result:

ok 

Test #15:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
91
0 0 0 1 1 1 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0
0 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
328
660
9
31
11
164
253
57
87
1187
47
21
203
350
1136
378
2539
607
241
387
218
1633
355
1980
94
1739
184
308
264
338
775
1368
70
242
592
72
78
56
144
556
191
1762
24
1074
399
626
635
2281
280
15
38
613
479
82
114
702
2112
1082
553
446
49
1819
164
240
288
49
326
18...

result:

ok 

Test #16:

score: 7
Accepted
time: 2ms
memory: 16416kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
92
1 1 1 1 1 0 1 0 0 1 1 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 1 1 1
1 1 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1
19
12
15
25
0
1
1
11
18
8
38
1
13
23
30
3
2
34
6
5
3
3
19
27
16
15
2
2
24
1
3
34
4
13
2
34
4
22
16
6
20
23
35
17
7
25
14
9
23
40
13
23
5
24
17
7
0
1
19
6
17
33
15
31
14
20
36
17
19
25
5
26
3
21
9
2
11
39
38
1
9
6
6
11
2
3
21
15
0
13
11
2
11
4
4
0
2
34
37
4
2
9
1...

result:

ok 

Test #17:

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

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
93
0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1
0 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 1 1 0 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
14
11
11
6
6
0
8
11
18
28
15
1
0
6
27
12
18
14
7
3
32
13
40
1
21
15
2
24
7
4
20
14
14
6
5
3
9
32
6
5
20
13
3
22
42
21
19
31
21
11
1
11
10
6
22
19
7
16
12
2
9
21
17
9
13
16
41
25
31
36
17
3
10
13
0
3
12
24
18
5
9
30
33
0
40
16
40
14
3
3
21
8
1
38
25
25
1
30
43
24
3...

result:

ok 

Subtask #3:

score: 7
Accepted

Test #18:

score: 7
Accepted
time: 77ms
memory: 63632kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 0 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
1314
79312
13238
63518
27135
86532
21129
53105
14461
13920
65981
66950
13385
23885
37091
56646
69855
64947
74166
41759
50738
1366
65318
58452
24337
58380
29379
59258
39016
4990
60529
23351
60370
12835
25686
8151
17007
56172
10913
7224
30221
73673
55593
33643
44070...

result:

ok 

Test #19:

score: 7
Accepted
time: 92ms
memory: 63516kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 1 0 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 1 1 1 1 1 1 0 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
97288
84412
98958
98546
95894
91536
99791
94852
96879
98784
94005
99030
95916
90829
96593
96545
90518
95251
93882
95122
94925
96009
98788
98866
95996
97263
95422
95733
96576
97730
98106
96939
94030
94576
94019
92982
96921
95715
96639
93579
97372
97983
95123
95211
...

result:

ok 

Test #20:

score: 7
Accepted
time: 78ms
memory: 63564kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
1 0 0 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
63186
59869
80378
71302
94439
63006
84372
99459
21243
54879
86436
65742
94261
35276
55849
93734
72881
49090
34951
93280
90257
58145
84070
58055
95069
56733
82475
51301
59357
39555
95572
87255
37523
68017
80309
52815
95469
29140
85700
46052
56013
71305
90947
7434
6...

result:

ok 

Test #21:

score: 7
Accepted
time: 76ms
memory: 63540kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
200000
1 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 1 1 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 1 0 1 0 1 1 1 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
99156
96398
98499
93058
98359
93547
93120
98997
99065
97926
99050
95046
96687
98137
97249
97530
96983
98126
89892
94397
98111
96471
95754
99320
97511
95029
96780
93937
97095
97566
97024
99338
97729
99722
97152
98216
95895
97942
98980
99845
96992
97397
99255
97894
...

result:

ok 

Test #22:

score: 7
Accepted
time: 64ms
memory: 44376kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
100000
0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
34862
31357
15637
16893
7670
123
17919
20936
7467
18723
34082
1835
18668
23866
630
26206
40304
6217
25617
18490
11507
39163
5570
16345
4695
30449
15992
13307
5315
5393
8864
29876
34139
3227
28910
11628
2250
38538
12586
299
1066
8238
40627
7418
7600
3123
18111
9012...

result:

ok 

Subtask #4:

score: 10
Accepted

Dependency #2:

100%
Accepted

Test #23:

score: 10
Accepted
time: 70ms
memory: 26328kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
4999
0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
2278926
2517585
309065
4439658
1312823
821454
21990
581613
1026882
3363680
19119
1634704
1051362
411650
3744121
1673259
47991
3124029
4777205
1572654
346149
756243
667860
189909
46711
2233488
2152180
1532708
2864350
362090
1318591
588226
1603317
289790
2613561
424...

result:

ok 

Test #24:

score: 10
Accepted
time: 68ms
memory: 24320kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
5000
0 0 1 1 1 1 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
8718592
6487692
5327896
6806369
3889797
6922431
4076090
6071121
1384604
7292223
4542346
3143893
6961152
1655273
5760268
6103898
6286591
6595898
5501571
4623965
4442169
9536381
3685258
3467391
7297530
5793665
2615556
7070456
3647815
4767368
5199720
5672600
3536405
...

result:

ok 

Test #25:

score: 10
Accepted
time: 64ms
memory: 26356kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
5000
1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 0 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
9795619
8280458
9814435
10089381
9428670
9774896
9185142
8799125
10155539
8654541
10565960
9712016
10182331
9782562
10426219
10073906
10570209
9883019
10673106
9723716
7911680
9537211
7947455
9294499
10039646
10128953
8082449
8718285
9752407
8363640
8867665
971349...

result:

ok 

Test #26:

score: 10
Accepted
time: 64ms
memory: 24276kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
5000
0 1 0 1 1 0 1 0 1 0 0 0 1 1 1 1 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 1 0 1 1 0 1 0 0 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
8176794
3805736
7843206
6223419
3974233
6804027
3139743
754456
4100610
6320426
412152
3003839
4724998
5115503
3852043
5640917
2092454
5117076
6370288
4167729
5394619
8494838
1749439
7179842
4738995
8175556
6415667
3066949
1854704
4701147
6447006
3231105
862292
632...

result:

ok 

Test #27:

score: 10
Accepted
time: 58ms
memory: 26328kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
5000
0 0 0 0 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
3209247
6331506
3594742
3473116
4578375
9096686
1911947
6479981
2665381
6381371
3738557
5887688
2826827
7210287
1408532
8283195
3803855
3673089
3346344
6107496
3463520
585746
8333850
4213642
3841860
2282635
3760397
9086350
825886
8518064
1338167
463047
7019383
508...

result:

ok 

Test #28:

score: 10
Accepted
time: 68ms
memory: 23808kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1967
0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 0 1 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
72924
2184
18058
858965
141401
14446
228152
18369
27571
116533
37944
34839
192300
391628
1015
69309
595
19610
53778
99278
5598
316920
108444
628498
128019
2454
20516
93143
122215
101083
47074
573393
210210
25067
108050
7665
751098
288235
63231
534143
1285
558114
1...

result:

ok 

Test #29:

score: 10
Accepted
time: 72ms
memory: 25828kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1968
1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 1 0 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
366
733
592
170
317
96
6
57
503
27
406
146
205
37
272
243
530
245
540
118
346
459
795
382
466
732
560
663
127
554
237
566
134
133
675
514
352
315
73
186
583
282
412
37
320
658
374
538
42
299
408
644
362
313
142
181
415
389
753
1
149
673
808
272
344
237
600
516
435...

result:

ok 

Test #30:

score: 10
Accepted
time: 67ms
memory: 21784kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
1969
1 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 1 0 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 1 0 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
8
251
66
428
625
796
587
11
743
573
565
187
16
46
449
333
354
515
67
107
142
572
299
498
137
862
25
524
542
546
461
267
679
75
531
825
377
368
367
377
1
856
343
215
24
51
410
112
117
357
636
13
82
481
380
177
151
551
386
832
5
807
781
757
152
194
768
678
685
2
792...

result:

ok 

Subtask #5:

score: 0
Wrong Answer

Test #31:

score: 8
Accepted
time: 55ms
memory: 23308kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
10
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
200000
1 7 0 4
3 4 3 4
3 6 2 5
4 5 6 7
5 7 2 8
0 6 4 7
0 5 6 7
1 3 9 9
6 9 1 7
2 9 4 6
4 4 6 7
0 1 8 8
7 7 0 3
0 4 1 7
2 2 0 9
3 9 4 6
3 9 0 9
1 8 4 6
4 5 5 7
0 6 2 3
2 3 0 6
1 9 8 8
2 4 3 4
3 6 2 9
3 9 2 7
1 3 0 3
0 8 2 4
3...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
14
2
8
2
10
12
5
2
14
12
1
0
2
14
4
10
32
12
3
6
6
4
3
16
21
5
12
6
7
11
12
3
7
3
6
15
6
4
6
8
15
24
2
5
11
8
16
3
4
12
4
9
23
1
2
5
6
4
1
4
4
3
6
4
18
32
10
2
7
7
5
12
11
7
4
4
10
6
4
16
8
13
8
3
3
8
21
1
2
3
6
14
21
14
9
2
3
2
4
16
20
7
3
5
3
15
16
8
36
7
6
7
9
...

result:

ok 

Test #32:

score: 0
Wrong Answer
time: 186ms
memory: 63360kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
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 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 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 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
-9059744640
11342208210
652362120
-5017034096
-1360232587
-8699227531
-10261784904
1267958106
904477638
1997350413
-10167638709
1362860576
163899948
797037988
656632144
-2998821977
3071773904
-8411439059
-3739823272
-9014127578
1554651170
-6792031864
374751575
131...

result:

wrong answer 3rd lines differ - on the 1st token, expected: '8120124544', found: '-9059744640'

Subtask #6:

score: 0
Wrong Answer

Test #42:

score: 0
Wrong Answer
time: 158ms
memory: 63492kb

input:

njJ9Z7VxxKGR6SUcJMgdzy3qMz4JZ1Tq
199999
0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 ...

output:

Wm5rkGNobnYjFI7TIY17RAm6FAQ2LlO9
OK
0
1
0
1
0
1
0
0
1
1
1
1
0
1
0
1
1
1
0
0
1
1
1
0
0
1
0
0
0
1
0
0
1
0
1
0
1
1
1
1
1
0
1
0
0
0
0
1
1
0
1
0
0
0
1
0
0
0
0
1
0
1
0
0
0
0
1
0
0
0
0
1
0
1
0
1
0
0
0
1
0
0
1
0
0
0
0
0
1
0
1
0
0
1
0
1
1
0
1
1
1
1
1
0
0
1
0
0
1
0
0
1
0
0
0
0
0
1
1
1
0
1
1
1
0
1
0
1
0
1
0
1
...

result:

wrong answer 10585th lines differ - on the 1st token, expected: '1', found: '-4294967295'

Subtask #7:

score: 0
Skipped

Dependency #3:

100%
Accepted

Dependency #6:

0%

Subtask #8:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

0%