QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#339086#6140. 矩阵游戏LYT0122100 ✓546ms9120kbC++142.4kb2024-02-26 19:03:162024-02-26 19:03:17

Judging History

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

  • [2024-02-26 19:03:17]
  • 评测
  • 测评结果:100
  • 用时:546ms
  • 内存:9120kb
  • [2024-02-26 19:03:16]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
using namespace std;
const int N=610;
typedef long long int ll;
typedef pair <int,int> PII;
int T,n,m,b[N][N],a[N][N],cnt[N];
bool vis[N];
ll dist[N];
queue <int> q;
vector <PII> g[N];
inline int read()
{
    int x=0,f=1;char c=getchar();
    while(c<'0' ||c>'9') {if(c=='-') f=-1;c=getchar();}
    while(c>='0' && c<='9') {x=x*10+c-48,c=getchar();}
    return x*f;
}
void addedge(int u,int v,int w)
{
    g[u].push_back({v,w});
}
bool spfa()
{
    while(q.empty()==false) q.pop();
    for(int i=1;i<=n+m;i++) dist[i]=cnt[i]=0,vis[i]=true,q.push(i);
    while(q.empty()==false)
    {
        int u=q.front();
        q.pop();
        vis[u]=false;
        for(int i=0;i<g[u].size();i++)
        {
            PII p=g[u][i];
            int v=p.first;
            if(dist[v]>dist[u]+p.second)
            {
                dist[v]=dist[u]+p.second;
                if(vis[v]==false)
                {
                    q.push(v),vis[v]=true,cnt[v]++;
                    if(cnt[v]>n+m+1) return false;
                }
            }
        }
    }
    return true;
}
int main()
{
    T=read();
    while(T--)
    {
        n=read(),m=read();
        for(int i=1;i<=n+m;i++) g[i].clear();
        memset(a,0,sizeof(a));
        for(int i=1;i<=n-1;i++)
            for(int j=1;j<=m-1;j++) b[i][j]=read();
        for(int i=n-1;i>=1;i--)
            for(int j=m-1;j>=1;j--)
                a[i][j]=b[i][j]-a[i][j+1]-a[i+1][j]-a[i+1][j+1];
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++)
            {
                int x=-a[i][j],y=1000000-a[i][j];
                if((i+j)&1) addedge(j+n,i,-x),addedge(i,j+n,y);
                else addedge(j+n,i,y),addedge(i,j+n,-x);
            }
        }
        if(spfa()==false)
        {
            puts("NO");
            continue;
        }
        puts("YES");
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++)
            {
                if((i+j)&1) a[i][j]+=dist[j+n]-dist[i];
                else a[i][j]+=dist[i]-dist[j+n];
            }
        }
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++) printf("%d ",a[i][j]);
            puts("");
        }
    }
    return 0;
}

详细

Test #1:

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

input:

10
3 3
9 21
22 16
3 3
28 30
13 4
3 3
17 10
5 30
3 3
30 27
30 25
3 3
22 19
28 12
3 3
30 27
21 28
3 3
4 25
11 5
3 3
12 24
24 30
3 3
5 4
27 8
3 3
20 29
17 18

output:

YES
0 5 0 
0 4 12 
18 0 0 
YES
0 26 0 
0 2 2 
11 0 0 
YES
12 0 0 
0 5 5 
0 0 20 
YES
0 2 0 
3 25 0 
2 0 0 
YES
0 7 0 
3 12 0 
13 0 0 
YES
9 0 0 
0 21 6 
0 0 1 
YES
0 4 16 
0 0 5 
11 0 0 
YES
0 0 0 
0 12 12 
12 0 6 
YES
0 0 0 
1 4 0 
22 0 4 
YES
0 11 0 
0 9 9 
8 0 0 

result:

ok you are right!!

Test #2:

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

input:

10
3 3
5 18
16 21
3 3
28 30
27 5
3 3
30 12
9 11
3 3
28 20
30 13
3 3
22 27
28 5
3 3
30 29
30 23
3 3
17 13
22 13
3 3
29 24
29 25
3 3
23 12
3 2
3 3
20 30
23 30

output:

YES
0 0 0 
0 5 13 
11 0 3 
YES
0 25 0 
0 3 2 
24 0 0 
YES
20 1 0 
0 9 2 
0 0 0 
YES
0 7 0 
8 13 0 
9 0 0 
YES
0 22 0 
0 0 5 
28 0 0 
YES
0 6 0 
1 23 0 
6 0 0 
YES
0 0 0 
4 13 0 
5 0 0 
YES
0 0 0 
5 24 0 
0 0 1 
YES
10 10 0 
1 2 0 
0 0 0 
YES
0 0 0 
0 20 10 
3 0 0 

result:

ok you are right!!

Test #3:

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

input:

10
3 3
17 22
17 27
3 3
30 24
30 30
3 3
11 16
10 15
3 3
29 18
19 27
3 3
12 2
25 26
3 3
27 28
29 30
3 3
14 11
8 16
3 3
29 27
26 15
3 3
1 21
25 12
3 3
30 28
21 27

output:

YES
0 0 0 
0 17 5 
0 0 5 
YES
0 0 0 
6 24 0 
0 0 6 
YES
0 1 0 
0 10 5 
0 0 0 
YES
10 0 0 
1 18 0 
0 0 9 
YES
0 0 0 
10 2 0 
13 0 24 
YES
0 0 0 
0 27 1 
2 0 2 
YES
6 0 0 
0 8 3 
0 0 5 
YES
0 12 0 
2 15 0 
9 0 0 
YES
0 1 8 
0 0 12 
25 0 0 
YES
8 1 0 
0 21 6 
0 0 0 

result:

ok you are right!!

Test #4:

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

input:

10
3 3
6 30
30 11
3 3
29 28
11 25
3 3
26 26
15 22
3 3
23 30
29 6
3 3
16 8
13 20
3 3
26 30
29 28
3 3
3 24
4 2
3 3
29 30
24 29
3 3
15 12
7 4
3 3
30 26
25 30

output:

YES
0 6 13 
0 0 11 
30 0 0 
YES
15 3 0 
0 11 14 
0 0 0 
YES
7 4 0 
0 15 7 
0 0 0 
YES
0 23 1 
0 0 6 
29 0 0 
YES
3 0 0 
5 8 0 
0 0 12 
YES
0 2 0 
0 24 4 
5 0 0 
YES
0 3 19 
0 0 2 
4 0 0 
YES
4 1 0 
0 24 5 
0 0 0 
YES
0 8 0 
3 4 0 
0 0 0 
YES
5 0 0 
0 25 1 
0 0 4 

result:

ok you are right!!

Test #5:

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

input:

10
10 2
240
8788
3257
6676
9748
4941
1268
2569
7827
10 2
9542
9328
8351
9362
9771
9183
8527
8640
7370
10 2
3144
7704
2054
9901
3567
120
2273
2407
4202
10 2
7337
9013
9119
9547
8526
8071
8475
6682
9273
10 2
746
9791
1891
3204
8908
1495
1353
9406
1176
10 2
9884
6039
4691
9956
8516
9454
9649
8966
9380
...

output:

NO
YES
7048 0 
2494 0 
6834 0 
1517 0 
7845 0 
1926 0 
7257 0 
1270 0 
7370 0 
0 0 
NO
YES
6422 0 
0 915 
8098 0 
0 1021 
8526 0 
0 0 
8071 0 
0 404 
6278 0 
0 2995 
NO
YES
7096 0 
2179 609 
3251 0 
831 609 
8516 0 
0 0 
9454 0 
0 195 
8771 0 
0 609 
NO
YES
8958 0 
0 0 
8441 0 
0 1184 
7886 0 
0 115...

result:

ok you are right!!

Test #6:

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

input:

10
10 2
7221
6762
7271
4154
1804
3226
6434
8357
2359
10 2
8581
5933
9174
9731
9716
9180
8744
9947
6264
10 2
282
9689
7228
960
2522
6806
7516
7002
9829
10 2
9202
8816
8250
9267
8287
8105
9707
8985
9226
10 2
2004
254
7197
7613
9790
5556
3064
6363
6489
10 2
7863
9827
9600
9998
7626
6038
9530
8772
8501
...

output:

NO
YES
7688 0 
893 0 
5040 0 
4134 0 
5597 0 
4119 0 
5061 0 
3683 0 
6264 0 
0 0 
NO
YES
7656 0 
0 1546 
7270 0 
0 980 
8287 0 
0 0 
8105 0 
0 1602 
7383 0 
0 1843 
NO
YES
5264 0 
0 2599 
7228 0 
0 2372 
7626 0 
0 0 
6038 0 
271 3221 
5280 0 
0 3221 
NO
YES
6291 0 
0 1856 
7172 0 
0 0 
9481 0 
0 28...

result:

ok you are right!!

Test #7:

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

input:

10
10 2
2492
6642
8650
4949
7971
7552
5729
6137
3224
10 2
8862
4232
4370
9422
9787
8443
9745
9230
9708
10 2
1073
3311
5736
6108
1985
2880
2596
1260
4678
10 2
9862
9822
8867
4686
9645
7259
7954
9855
9482
10 2
6532
3248
1799
3767
7693
4389
5786
1124
9586
10 2
7667
9393
6828
8642
9482
8512
8366
7067
87...

output:

YES
2492 0 
0 0 
6642 0 
1714 294 
2941 0 
4736 294 
2522 0 
2913 294 
2930 0 
0 294 
YES
8862 0 
0 0 
4232 0 
0 138 
9284 0 
0 503 
7940 0 
0 1805 
7425 0 
0 2283 
NO
YES
8907 0 
0 955 
8867 0 
0 0 
4686 0 
0 4959 
2300 0 
373 5281 
4201 0 
0 5281 
NO
YES
5102 0 
161 2404 
6828 0 
0 0 
8642 0 
0 84...

result:

ok you are right!!

Test #8:

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

input:

10
100 2
407406
741582
966880
693984
175204
991130
183615
326373
131306
366816
697972
180227
398068
835836
746523
999640
178807
545159
437329
536071
721606
306737
181599
455551
733444
231865
77996
588988
897019
804401
528918
524503
349494
623245
534144
344637
25518
791164
100668
547254
630911
346372...

output:

NO
YES
647283 0 
0 102846 
747501 0 
0 134576 
781948 0 
12310 200103 
766133 0 
0 184288 
659865 0 
0 16206 
593438 0 
0 0 
421730 0 
64977 200103 
276696 0 
466236 200103 
318563 0 
258336 200103 
196118 0 
466256 200103 
239005 0 
157825 200103 
466265 0 
251053 200103 
131492 0 
661375 200103 
1...

result:

ok you are right!!

Test #9:

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

input:

10
100 2
514849
121431
445450
996530
912655
547635
39581
89505
975458
843069
273144
700881
59053
289340
848708
32178
700710
194859
273472
213196
384827
341987
482545
308239
413944
599935
848280
843825
979288
195213
209986
440149
934390
768000
882462
200861
119570
174661
871708
511415
426500
576587
5...

output:

NO
YES
695456 0 
0 298080 
498364 0 
0 500209 
361888 0 
0 433407 
479661 0 
0 497781 
238111 0 
184293 577595 
170139 0 
185227 577595 
181915 0 
145164 577595 
184148 0 
163618 577595 
156111 0 
262307 577595 
110472 0 
164547 577595 
243932 0 
0 498709 
439158 0 
0 244278 
640848 0 
0 234542 
349...

result:

ok you are right!!

Test #10:

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

input:

10
100 2
650385
567657
465159
181316
696069
211308
655715
128129
988551
838473
44280
61031
528962
277047
286263
142130
248066
307713
578918
695526
89569
48119
569157
673222
295474
923221
90394
912892
523136
369133
635906
272262
887296
438346
625250
217263
729637
256075
898161
999382
845113
626531
74...

output:

NO
YES
997572 0 
0 0 
831313 0 
0 140282 
842484 0 
0 130157 
481725 0 
0 160423 
809914 0 
0 126258 
313950 0 
0 227108 
721150 0 
0 198312 
629558 0 
33135 290221 
319434 0 
345445 290221 
333253 0 
0 202906 
133199 0 
317355 290221 
229778 0 
438306 290221 
202508 0 
166902 290221 
399237 0 
4757...

result:

ok you are right!!

Test #11:

score: 5
Accepted
time: 525ms
memory: 8624kb

input:

10
300 298
0 0 1 0 1 1 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 0 1 1 1 0 0 0...

output:

NO
YES
1 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0...

result:

ok you are right!!

Test #12:

score: 5
Accepted
time: 514ms
memory: 8780kb

input:

10
297 296
0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 1 1 0 0 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0...

output:

NO
YES
1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 0...

result:

ok you are right!!

Test #13:

score: 5
Accepted
time: 535ms
memory: 8364kb

input:

10
297 299
1 0 1 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 1...

output:

NO
YES
0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0...

result:

ok you are right!!

Test #14:

score: 5
Accepted
time: 522ms
memory: 8708kb

input:

10
298 299
0 1 0 1 1 1 1 1 1 0 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 1 0 1 0 1 0 0 0 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 1 1 0...

output:

NO
YES
0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 1 0 0...

result:

ok you are right!!

Test #15:

score: 5
Accepted
time: 516ms
memory: 8396kb

input:

10
298 296
0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 1 1 1 0 1 0 0 1 0 1 0 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1...

output:

NO
YES
1 0 0 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 0...

result:

ok you are right!!

Test #16:

score: 5
Accepted
time: 529ms
memory: 8388kb

input:

10
295 299
3600561 469227 1519243 508870 2714139 2548515 3416122 1633507 1829918 1551817 3098121 1670950 2106466 1946727 1581396 3426393 1988045 2888135 2146489 1534631 2721599 3729764 456043 293501 882439 3099151 2941143 3610816 549774 1066237 3189705 2413286 2316602 3976215 3845403 862960 241887 2...

output:

NO
YES
56276 351040 916851 362405 200070 286434 730227 749218 978213 504347 80661 430708 310084 273853 13466 309460 686067 579249 663425 165008 785412 319660 829281 968531 718613 553810 334823 340420 460214 12490 70423 814706 673964 224157 887801 905630 691409 253526 576792 199029 668647 450455 8812...

result:

ok you are right!!

Test #17:

score: 5
Accepted
time: 546ms
memory: 8404kb

input:

10
298 297
1203979 2459461 1123626 2165742 593951 2361185 60882 1597698 966249 1407808 2665213 1585110 1730464 732707 2642476 54357 96750 3459440 500455 1509802 2084769 1885656 824649 1394960 3065480 1964072 626742 582644 617926 652074 1646286 250370 1154127 1955950 327344 753408 2005921 2832519 933...

output:

NO
YES
500753 941803 182366 66809 392096 554590 438882 584305 527725 279506 163200 575330 560705 43482 718378 649725 983048 741351 329530 301864 310459 659910 210812 437581 220144 451532 234360 49004 517355 403025 862354 353840 834796 760764 792936 254027 19571 778374 159066 498912 727638 982039 235...

result:

ok you are right!!

Test #18:

score: 5
Accepted
time: 526ms
memory: 8604kb

input:

10
296 296
2917992 3146628 3606537 755096 2325656 3902232 2435726 2851482 3134088 1183312 3680091 2970485 3974463 2456731 3306154 400789 1137399 1266637 1849976 2126197 1039996 2867787 711979 2828033 1651264 3781772 1152035 2861694 2479767 1853717 886722 2972156 4583 903432 3364054 3947134 3871761 3...

output:

NO
YES
918452 338477 533023 229837 0 861531 561419 123050 505313 705569 691943 706067 522357 418644 208900 418987 133539 371211 285802 369204 706052 547038 105036 342524 925584 785075 391084 95212 533448 227555 301048 581838 175288 0 516705 96269 849943 191054 911340 195548 838848 950361 83331 45150...

result:

ok you are right!!

Test #19:

score: 5
Accepted
time: 534ms
memory: 9120kb

input:

10
297 297
13391 712464 2974864 1439202 1447544 1413180 800048 597109 3349875 2034207 1467293 796338 2354278 171222 1066675 2532591 208592 123178 2912280 3309432 3409173 1029236 2315777 2135394 3355241 69077 3113692 2937527 2948148 1151724 1640840 870814 42569 2304251 726055 3017332 2049772 2646010 ...

output:

NO
YES
325134 168801 493582 788628 800604 802704 772651 0 801610 848072 93717 704183 201040 707806 259006 181029 963903 950703 302848 68520 896561 274614 503422 90743 637450 324049 31999 439402 886141 336077 955859 318437 347175 727068 14110 455790 545773 349809 120542 653203 801561 781145 520478 17...

result:

ok you are right!!

Test #20:

score: 5
Accepted
time: 526ms
memory: 8824kb

input:

10
297 295
2251173 2102586 854138 210476 3746962 1050335 357886 1246625 2048656 3914401 2622120 2500826 3210040 3638713 646704 3538951 2675262 2202513 1600647 2451535 120429 782584 3574033 3344068 580591 2179489 3256587 684504 1805546 599720 3155847 2286982 2960267 502472 3365334 1420188 2393737 228...

output:

NO
YES
306012 848462 370460 603624 145062 833799 955387 3772 529912 974838 911992 579925 565843 805218 344710 233239 466730 778021 470943 106406 816861 596268 142980 996697 718553 1000000 778873 370047 377087 779048 636695 647321 466631 562349 256987 20776 595085 133343 374647 364952 323997 714461 2...

result:

ok you are right!!

Extra Test:

score: 0
Extra Test Passed