QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#469426#8892. Power GridLynkcat#13 1656ms7944kbC++201.8kb2024-07-09 19:07:112024-07-09 19:07:14

Judging History

This is the latest submission verdict.

  • [2024-07-09 19:07:14]
  • Judged
  • Verdict: 13
  • Time: 1656ms
  • Memory: 7944kb
  • [2024-07-09 19:07:11]
  • Submitted

answer

#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) ((int)((x).size()))
#define int ll
// #define N 
using namespace std;
const int N=1005;
int n,m;
int ans[N][N],b[N],a[N];
int c[N][N];
map<int,int>f[N];
int dl;
void dfs(int k,int sm)
{
    if (f[k].count(sm)) return;

    if (k==n)
    {
        if (sm!=0&&(n==m||sm%(n-m)!=0)) return;

        int o=0;
        if (sm!=0) o=sm/(n-m);
        for (int i=0;i<m;i++) a[i]-=o;
        for (int i=0;i<n;i++) b[i]-=o;

        for (int i=1;i<m;i++) ans[0][i]=a[i],b[0]-=a[i];
        for (int i=0;i<n;i++)
        {
            ans[i][0]=b[i];
        }
        for (int i=0;i<n;i++)
        {
            for (int j=0;j<m;j++) cout<<ans[i][j]<<" ";
            cout<<'\n';
        }
        fflush(stdout);
        exit(0);
    }
    for (int i=-m*dl;i<=m*dl;i++)
    {
        b[k]=i;
        bool bl=1;
        for (int j=0;j<m;j++)
        {
            if (abs(b[k]-a[j])!=c[k][j])
            {
                bl=0;
                break;
            }
        }
        if (bl) dfs(k+1,sm+i);
    }
    f[k][sm]=1;
}
mt19937_64 rnd(time(0));
void BellaKira()
{
    cin>>n>>m;
    for (int i=0;i<n;i++)
        for (int j=0;j<m;j++)
            cin>>c[i][j],dl=max(dl,c[i][j]);
    while (1)
    {
        for (int i=0;i<m;i++)
        {
            a[i]=c[0][i];
            if (rnd()%2) a[i]=-a[i];
        }
        int sm=0;
        for (int i=0;i<m;i++) sm-=a[i];
        dfs(1,sm);
        for (int i=1;i<n;i++) f[i].clear();
    }
}
signed main()
{
	IOS;
	cin.tie(0);
	int T=1;
	while (T--)
	{
		BellaKira();
	}
}

详细

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 1ms
memory: 5748kb

input:

1 1
0

output:

0 

result:

ok correct

Test #2:

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

input:

1 1
0

output:

0 

result:

ok correct

Test #3:

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

input:

1 2
1 1

output:

-1 1 

result:

ok correct

Test #4:

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

input:

3 1
0
3
1

output:

2 
-1 
1 

result:

ok correct

Test #5:

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

input:

2 2
1 1
1 1

output:

-1 1 
0 0 

result:

ok correct

Test #6:

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

input:

3 3
2 1 1
2 1 1
0 1 3

output:

0 -1 1 
0 0 0 
-2 0 0 

result:

ok correct

Test #7:

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

input:

3 3
0 1 0
2 1 2
1 2 1

output:

-1 1 0 
2 0 0 
-1 0 0 

result:

ok correct

Test #8:

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

input:

3 3
0 0 2
2 2 0
0 0 2

output:

-2 0 2 
2 0 0 
0 0 0 

result:

ok correct

Test #9:

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

input:

3 3
3 1 2
3 1 2
3 1 2

output:

-3 1 2 
0 0 0 
0 0 0 

result:

ok correct

Test #10:

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

input:

3 3
3 3 3
0 0 0
3 3 3

output:

6 -3 -3 
-3 0 0 
-6 0 0 

result:

ok correct

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #11:

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

input:

1 6
1 0 3 1 3 0

output:

-1 0 -3 1 3 0 

result:

ok correct

Test #12:

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

input:

6 1
2
1
1
1
5
0

output:

0 
-1 
-1 
-1 
3 
-2 

result:

ok correct

Test #13:

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

input:

6 6
3 1 0 3 4 0
1 1 2 1 2 2
1 1 2 1 2 2
1 3 4 1 0 4
1 1 2 1 2 2
2 0 1 2 3 1

output:

8 -1 0 -3 -4 0 
-2 0 0 0 0 0 
-2 0 0 0 0 0 
-4 0 0 0 0 0 
-2 0 0 0 0 0 
-1 0 0 0 0 0 

result:

ok correct

Test #14:

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

input:

6 6
2 4 4 0 2 2
5 1 1 3 1 1
4 2 2 2 0 0
2 4 4 0 2 2
6 0 0 4 2 2
3 3 3 1 1 1

output:

12 -4 -4 0 -2 -2 
-3 0 0 0 0 0 
-2 0 0 0 0 0 
0 0 0 0 0 0 
-4 0 0 0 0 0 
-1 0 0 0 0 0 

result:

ok correct

Test #15:

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

input:

6 6
1 0 4 5 3 2
4 5 1 0 2 3
3 4 0 1 1 2
2 3 1 2 0 1
1 2 2 3 1 0
0 1 3 4 2 1

output:

-14 0 4 5 3 2 
5 0 0 0 0 0 
4 0 0 0 0 0 
3 0 0 0 0 0 
2 0 0 0 0 0 
1 0 0 0 0 0 

result:

ok correct

Test #16:

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

input:

6 6
6 4 2 4 1 3
6 4 2 4 1 3
6 4 2 4 1 3
6 4 2 4 1 3
6 4 2 4 1 3
6 4 2 4 1 3

output:

6 -4 -2 -4 1 3 
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 

result:

ok correct

Test #17:

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

input:

6 3
6 3 3
6 3 3
6 3 3
6 3 3
6 3 3
6 3 3

output:

-6 3 3 
0 0 0 
0 0 0 
0 0 0 
0 0 0 
0 0 0 

result:

ok correct

Test #18:

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

input:

6 3
1 1 1
2 2 2
5 5 5
6 6 6
6 6 6
2 2 2

output:

-1 2 2 
0 0 0 
7 0 0 
-4 0 0 
-4 0 0 
4 0 0 

result:

ok correct

Test #19:

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

input:

3 6
6 5 5 5 5 5
6 5 5 5 5 5
6 5 5 5 5 5

output:

-3 2 2 2 -8 2 
-3 0 0 0 0 0 
-3 0 0 0 0 0 

result:

ok correct

Test #20:

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

input:

6 3
5 5 5
5 5 5
6 6 6
5 5 5
5 5 5
5 5 5

output:

-2 7 7 
2 0 0 
1 0 0 
2 0 0 
2 0 0 
2 0 0 

result:

ok correct

Test #21:

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

input:

6 4
1 6 2 3
1 6 2 3
1 6 2 3
1 6 2 3
1 6 2 3
1 6 2 3

output:

-9 8 4 -1 
2 0 0 0 
2 0 0 0 
2 0 0 0 
2 0 0 0 
2 0 0 0 

result:

ok correct

Test #22:

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

input:

6 6
2 2 1 4 1 1
2 2 1 4 1 1
3 3 0 3 0 2
2 2 1 4 1 1
2 2 1 4 1 1
2 2 1 4 1 1

output:

3 2 -1 -4 -1 1 
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 

result:

ok correct

Subtask #3:

score: 0
Time Limit Exceeded

Test #23:

score: 11
Accepted
time: 1ms
memory: 5740kb

input:

1 1
0

output:

0 

result:

ok correct

Test #24:

score: 0
Accepted
time: 0ms
memory: 5744kb

input:

1 10
230 289 918 752 224 184 573 217 398 715

output:

374 -145 -774 -608 -80 328 717 361 542 -571 

result:

ok correct

Test #25:

score: 0
Accepted
time: 12ms
memory: 5884kb

input:

1 1000
298 440 513 326 225 36 897 92 347 346 919 370 28 957 593 332 736 960 346 969 329 893 380 523 104 345 860 451 290 958 164 386 508 786 605 778 453 500 376 670 86 283 844 408 282 541 479 827 9 558 473 251 184 694 920 905 1000 515 846 506 741 403 552 869 37 667 377 350 711 304 509 471 164 901 487...

output:

306 -432 -505 334 233 44 -889 100 355 354 -911 378 36 965 601 -324 -728 -952 -338 977 -321 -885 388 -515 -96 -337 -852 459 298 966 172 -378 516 -778 613 786 -445 508 384 -662 94 291 852 -400 -274 549 -471 835 17 566 481 -243 192 -686 -912 -897 1008 523 -838 514 749 -395 -544 877 45 -659 385 358 -703...

result:

ok correct

Test #26:

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

input:

1 1000
684 573 532 550 99 296 284 671 559 397 215 977 399 460 710 152 111 966 525 184 613 982 274 805 541 238 258 357 884 969 343 700 55 610 351 470 212 842 908 911 752 593 257 396 343 937 253 395 452 718 513 754 990 149 853 895 783 329 20 728 119 602 15 202 475 49 578 427 27 349 547 225 223 209 197...

output:

-698 -587 -546 -564 85 282 -298 657 545 -411 -229 963 385 446 -724 138 -125 952 511 170 -627 -996 -288 791 527 -252 244 343 -898 955 -357 686 41 -624 337 456 -226 828 894 897 738 -607 -271 -410 329 -951 239 -409 438 704 499 740 -1004 135 -867 881 -797 -343 6 714 -133 -616 -29 -216 -489 35 -592 413 1...

result:

ok correct

Test #27:

score: 0
Accepted
time: 0ms
memory: 5752kb

input:

1 1000
379 888 365 408 845 405 394 954 362 367 421 913 426 418 401 422 389 890 393 898 924 405 916 408 378 419 393 372 398 863 363 903 408 872 403 372 368 383 400 401 849 878 386 923 863 410 884 387 905 388 929 390 338 416 385 388 420 371 930 411 391 923 389 952 388 385 387 936 931 384 867 889 390 8...

output:

383 -884 369 -404 849 409 398 -950 -358 371 425 -909 430 422 -397 -418 393 894 -389 -894 -920 -401 -912 412 -374 -415 397 -368 -394 -859 -359 -899 412 -868 -399 -368 -364 387 -396 -397 -845 -874 -382 -919 867 -406 888 -383 909 -384 -925 -386 342 420 -381 -384 -416 375 -926 -407 -387 927 393 956 392 ...

result:

ok correct

Test #28:

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

input:

1 1000
1 0 0 3 1 0 0 0 0 0 0 2 1 1 0 0 1 0 1 0 0 0 2 3 0 0 2 0 3 2 2 1 1 0 2 0 1 2 1 0 0 1 0 1 0 0 1 1 2 2 1 0 0 0 1 3 2 3 1 1 0 1 2 1 1 0 2 1 1 2 1 2 1 4 1 2 0 2 2 1 0 1 2 4 1 0 1 1 2 0 4 1 1 0 0 0 0 1 1 0 0 1 0 0 2 1 1 2 1 0 4 1 2 2 0 1 0 0 0 1 2 3 0 0 1 2 0 2 2 0 1 2 0 2 1 1 2 0 2 0 0 0 0 1 0 1 1...

output:

0 -1 -1 2 -2 -1 -1 -1 -1 -1 -1 1 0 -2 -1 -1 -2 -1 0 -1 -1 -1 1 2 -1 -1 -3 -1 2 -3 1 0 -2 -1 1 -1 0 -3 -2 -1 -1 -2 -1 -2 -1 -1 0 -2 -3 -3 -2 -1 -1 -1 -2 2 1 -4 -2 -2 -1 -2 1 -2 -2 -1 1 0 -2 1 -2 1 -2 -5 -2 1 -1 -3 1 0 -1 0 1 3 -2 -1 -2 0 -3 -1 -5 -2 0 -1 -1 -1 -1 -2 0 -1 -1 -2 -1 -1 1 0 0 1 -2 -1 -5 ...

result:

ok correct

Test #29:

score: -11
Time Limit Exceeded

input:

1 766
1 0 1 0 1 2 0 3 0 0 1 2 0 1 0 2 0 1 1 4 1 3 0 0 2 2 2 2 1 1 1 2 1 2 0 1 2 1 2 0 4 0 1 0 0 0 0 0 1 2 0 0 1 2 2 4 1 1 1 2 0 1 3 2 1 0 0 0 0 1 0 1 0 1 2 2 3 0 3 1 0 0 1 1 0 1 4 3 1 2 0 3 0 1 1 2 1 2 1 1 2 0 1 0 0 2 1 1 2 0 2 0 0 1 1 3 1 0 1 2 1 0 0 3 2 0 0 2 2 0 0 1 0 1 1 1 2 0 2 3 1 1 1 3 0 0 2 ...

output:


result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #30:

score: 6
Accepted
time: 1ms
memory: 5860kb

input:

2 2
0 0
0 0

output:

0 0 
0 0 

result:

ok correct

Test #31:

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

input:

2 2
7 7
7 7

output:

7 -7 
-14 0 

result:

ok correct

Test #32:

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

input:

2 4
7 7 7 7
7 7 7 7

output:

7 0 0 0 
-7 0 0 0 

result:

ok correct

Test #33:

score: 0
Accepted
time: 0ms
memory: 5956kb

input:

20 40
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 ...

output:

-224 -72 -72 -72 88 -72 -72 88 -72 88 -72 88 -72 88 88 88 88 88 88 -72 88 -72 88 -72 88 -72 88 -72 -72 -72 88 -72 -72 88 88 -72 -72 88 -72 88 
8 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 
8 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 ...

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 5808kb

input:

20 40
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ...

output:

-28 -9 -9 -9 11 -9 -9 11 -9 11 -9 11 -9 11 11 11 11 11 11 -9 11 -9 11 -9 11 -9 11 -9 -9 -9 11 -9 -9 11 11 -9 -9 11 -9 11 
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 
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 
1 0 0 0 0 0 0 0 ...

result:

ok correct

Test #35:

score: -6
Time Limit Exceeded

input:

1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...

output:


result:


Subtask #5:

score: 0
Time Limit Exceeded

Test #46:

score: 15
Accepted
time: 1ms
memory: 5876kb

input:

2 4
253 431 207 483
243 65 289 13

output:

243 8 232 -44 
-57 0 0 0 

result:

ok correct

Test #47:

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

input:

2 4
188 566 555 176
471 283 272 459

output:

-471 329 318 -413 
46 0 0 0 

result:

ok correct

Test #48:

score: 0
Accepted
time: 0ms
memory: 5884kb

input:

5 6
39 93 668 330 117 610
13 145 720 382 65 662
417 285 290 48 495 232
210 78 497 159 288 439
813 681 106 444 891 164

output:

488 181 -394 -56 391 -336 
326 0 0 0 0 0 
-104 0 0 0 0 0 
103 0 0 0 0 0 
-500 0 0 0 0 0 

result:

ok correct

Test #49:

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

input:

4 7
330 140 57 520 147 685 359
70 540 457 120 547 285 41
168 638 555 22 645 187 139
425 45 38 615 52 780 454

output:

-25 389 306 -271 396 -436 -110 
-151 0 0 0 0 0 0 
-249 0 0 0 0 0 0 
344 0 0 0 0 0 0 

result:

ok correct

Test #50:

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

input:

10 10
853 399 803 868 626 195 356 314 232 136
409 45 359 424 182 249 88 130 212 308
134 320 84 149 93 524 363 405 487 583
60 394 10 75 167 598 437 479 561 657
50 404 0 65 177 608 447 489 571 667
828 374 778 843 601 170 331 289 207 111
457 3 407 472 230 201 40 82 164 260
34 420 16 49 193 624 463 505 ...

output:

-3929 399 803 868 626 195 356 314 232 136 
444 0 0 0 0 0 0 0 0 0 
719 0 0 0 0 0 0 0 0 0 
793 0 0 0 0 0 0 0 0 0 
803 0 0 0 0 0 0 0 0 0 
25 0 0 0 0 0 0 0 0 0 
396 0 0 0 0 0 0 0 0 0 
819 0 0 0 0 0 0 0 0 0 
323 0 0 0 0 0 0 0 0 0 
460 0 0 0 0 0 0 0 0 0 

result:

ok correct

Test #51:

score: 0
Accepted
time: 68ms
memory: 5908kb

input:

10 10
376 557 253 418 586 309 363 261 20 193
343 524 220 385 553 276 330 228 53 160
322 141 445 280 112 389 335 437 718 505
123 58 246 81 87 190 136 238 519 306
39 142 162 3 171 106 52 154 435 222
6 175 129 36 204 73 19 121 402 189
297 478 174 339 507 230 284 182 99 114
441 260 564 399 231 508 454 5...

output:

-2920 557 253 418 586 309 363 261 -20 193 
33 0 0 0 0 0 0 0 0 0 
698 0 0 0 0 0 0 0 0 0 
499 0 0 0 0 0 0 0 0 0 
415 0 0 0 0 0 0 0 0 0 
382 0 0 0 0 0 0 0 0 0 
79 0 0 0 0 0 0 0 0 0 
817 0 0 0 0 0 0 0 0 0 
346 0 0 0 0 0 0 0 0 0 
27 0 0 0 0 0 0 0 0 0 

result:

ok correct

Test #52:

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

input:

10 10
608 306 681 555 168 504 161 276 342 308
236 66 309 183 204 132 211 96 30 64
589 287 662 536 149 485 142 257 323 289
70 372 3 123 510 174 517 402 336 370
160 462 87 213 600 264 607 492 426 460
178 124 251 125 262 74 269 154 88 122
458 156 531 405 18 354 11 126 192 158
61 241 134 8 379 43 386 27...

output:

-3301 306 681 555 168 504 161 276 342 308 
372 0 0 0 0 0 0 0 0 0 
19 0 0 0 0 0 0 0 0 0 
678 0 0 0 0 0 0 0 0 0 
768 0 0 0 0 0 0 0 0 0 
430 0 0 0 0 0 0 0 0 0 
150 0 0 0 0 0 0 0 0 0 
547 0 0 0 0 0 0 0 0 0 
719 0 0 0 0 0 0 0 0 0 
226 0 0 0 0 0 0 0 0 0 

result:

ok correct

Test #53:

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

input:

2 4
1 2 3 4
5 6 7 8

output:

-5 5 4 3 
11 0 0 0 

result:

ok correct

Test #54:

score: 0
Accepted
time: 1656ms
memory: 5816kb

input:

10 20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
10...

output:

-1789 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 
131 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
171 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
191 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
211 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
231 0 0 0 0...

result:

ok correct

Test #55:

score: -15
Time Limit Exceeded

input:

21 42
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

output:


result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #58:

score: 0
Time Limit Exceeded

input:

1000 1000
1 0 0 1 0 1 0 1 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 0 1 1 0 1 1 0 1 1 1 0 0 1 1 0 0 0 1 1 0 1 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 1 1 0 1 1 ...

output:


result:


Subtask #7:

score: 0
Time Limit Exceeded

Test #68:

score: 15
Accepted
time: 1ms
memory: 5752kb

input:

2 2
5 52
52 5

output:

-52 52 
57 0 

result:

ok correct

Test #69:

score: -15
Time Limit Exceeded

input:

1000 1000
640 423 797 825 85 491 146 594 713 894 923 193 511 700 556 269 32 177 29 16 394 971 754 194 930 404 686 794 19 267 410 880 859 52 477 347 94 826 638 132 385 628 642 795 332 98 606 377 681 330 731 339 157 855 875 836 450 46 225 661 138 909 917 873 371 223 152 19 44 67 792 3 466 740 151 681 ...

output:


result:


Subtask #8:

score: 0
Time Limit Exceeded

Dependency #2:

100%
Accepted

Test #83:

score: 0
Time Limit Exceeded

input:

100 100
14 50 6 9 35 31 9 1 40 31 30 17 58 53 33 43 19 37 41 35 20 51 29 44 20 19 4 4 59 29 56 50 37 38 49 59 41 1 37 10 19 41 2 4 29 20 13 7 25 25 54 31 38 14 22 3 35 37 22 49 35 29 1 24 23 7 38 9 41 33 55 19 19 17 8 55 59 9 29 8 40 36 21 3 12 24 59 59 2 14 59 59 0 15 19 37 2 9 3 20
60 4 40 55 81 1...

output:


result:


Subtask #9:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%