QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#664724#7155. Padel Prize PursuitWarinchai_s#36 259ms101556kbC++141.1kb2024-10-21 21:58:452024-10-21 21:58:45

Judging History

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

  • [2024-10-21 21:58:45]
  • 评测
  • 测评结果:36
  • 用时:259ms
  • 内存:101556kb
  • [2024-10-21 21:58:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int mx=0;
int ans[200005];
vector<pair<int,int>>medals[200005];
int most[200005];
int id[200005];
int prv[200005];
map<int,int>mp[200005];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m;cin>>n>>m;
    //cerr<<"work\n";
    for(int i=0;i<m;i++){
        int a,b;cin>>a>>b;
        for(auto [x,y]:medals[b]){
            mp[x][b]+=i-y;
            int tans=mp[x][b];
            if(tans>most[x])most[x]=tans,id[x]=b;
            else if(tans==most[x])id[x]=min(id[x],b);
        }
        for(auto x:medals[b])medals[a].push_back({x.first,i});
        medals[b].clear();
        medals[a].push_back({i,i});
        prv[a]=i;
    }
    for(int i=0;i<n;i++){
        int b=i;
        for(auto [x,y]:medals[b]){
            mp[x][b]+=m-y;
            if(mp[x][b]>most[x])most[x]=mp[x][b],id[x]=b;
            else if(mp[x][b]==most[x])id[x]=min(id[x],b);
        }
    }
    for(int i=0;i<m;i++){
        ans[id[i]]++;
    }
    for(int i=0;i<n;i++){
        cout<<ans[i]<<" ";
    }

}
/*
3 4
0 1
2 0
1 2
2 1

3 4
0 1
2 1
1 0
2 1
*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Time Limit Exceeded

Test #1:

score: 0
Time Limit Exceeded

input:

2 200000
0 1
1 0
1 0
1 0
0 1
1 0
0 1
1 0
1 0
0 1
0 1
1 0
0 1
0 1
1 0
0 1
1 0
0 1
0 1
0 1
1 0
0 1
0 1
1 0
1 0
0 1
1 0
1 0
1 0
1 0
0 1
1 0
0 1
0 1
0 1
0 1
0 1
0 1
1 0
0 1
1 0
0 1
1 0
0 1
0 1
1 0
1 0
1 0
0 1
1 0
1 0
1 0
0 1
1 0
1 0
0 1
0 1
0 1
1 0
0 1
1 0
1 0
1 0
1 0
0 1
0 1
1 0
1 0
0 1
0 1
0 1
1 0
0 1...

output:


result:


Subtask #2:

score: 16
Accepted

Test #5:

score: 16
Accepted
time: 0ms
memory: 20204kb

input:

2000 2000
741 1153
839 1048
1159 445
196 1042
404 1319
638 766
1373 621
736 705
1579 1696
454 1566
1794 474
993 858
424 380
1971 210
1729 861
1450 1275
986 535
964 431
1371 1176
658 378
708 1669
1049 1236
832 533
16 450
675 1324
1680 1598
1936 885
579 307
987 1497
996 1589
1087 843
1303 222
105 1692...

output:

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

result:

ok single line: '0 2 0 4 1 0 5 0 2 2 1 0 0 1 0 ... 0 2 4 0 1 3 2 1 0 2 1 2 2 3 0 '

Test #6:

score: 16
Accepted
time: 0ms
memory: 20324kb

input:

2000 2000
363 1715
1907 76
1670 1939
1548 339
615 1019
232 2
291 680
303 792
697 1835
1575 1724
51 679
459 1241
229 1779
1809 1262
1181 1177
1799 1184
1356 1268
1823 206
1714 576
710 1294
1932 1561
51 679
1276 684
51 679
196 374
1257 154
524 605
1366 763
522 886
357 1873
1491 1178
1798 892
1203 549
...

output:

0 0 1 0 13 0 0 1 0 3 0 0 1 4 0 1 0 0 3 0 0 0 0 0 0 0 0 0 1 0 2 0 0 0 0 0 1 1 2 1 2 0 4 0 0 0 0 4 0 0 2 5 0 0 0 0 6 0 1 2 0 1 6 0 0 0 0 0 0 1 1 0 0 1 2 6 17 0 1 1 0 0 0 0 1 0 3 0 0 8 0 1 0 2 0 0 0 3 2 0 5 0 0 2 1 1 1 2 0 0 0 0 1 0 2 0 0 1 18 0 0 0 2 0 3 1 0 0 1 0 0 1 4 0 1 0 2 0 1 0 0 1 2 1 0 0 1 0 1...

result:

ok single line: '0 0 1 0 13 0 0 1 0 3 0 0 1 4 0...0 2 0 0 0 14 0 2 1 0 0 0 0 0 1 '

Test #7:

score: 16
Accepted
time: 0ms
memory: 20884kb

input:

2000 2000
162 1885
239 1454
1359 1385
418 582
1589 1593
1213 1513
1336 91
1414 121
1766 313
1589 1294
1454 1369
1139 1177
1177 1178
1432 1580
1448 94
1730 480
1369 1781
1712 386
1894 639
1454 1356
1244 924
582 852
1366 145
1384 1832
1005 61
325 776
816 221
1667 1236
1336 1607
745 1978
1596 1677
641 ...

output:

0 2 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 3 4 0 9 0 0 0 0 3 0 0 0 0 2 0 2 0 0 2 0 3 0 0 0 1 0 0 0 0 3 0 8 0 0 0 0 0 0 0 1 0 0 0 0 2 0 2 0 2 0 0 0 0 0 3 0 0 5 1 0 0 0 0 0 0 0 3 0 0 6 8 0 0 0 0 0 0 0 0 0 0 1 0 0 4 0 5 0 0 5 0 0 0 0 2 0 0 0 0 0 0 5 9 0 0 2 0 0 0 0 0 0 0 ...

result:

ok single line: '0 2 1 0 0 0 0 0 1 0 0 0 0 0 0 ... 0 0 0 0 3 0 0 0 5 0 0 0 0 3 0 '

Test #8:

score: 16
Accepted
time: 6ms
memory: 22532kb

input:

2000 2000
220 455
455 800
220 1689
1689 260
1689 1920
455 30
1689 866
1920 419
260 706
800 323
323 1985
220 1046
800 1459
220 1767
1459 525
706 541
419 1766
1689 27
866 1554
1767 1577
1767 1706
1766 79
323 941
79 1313
525 70
1920 242
455 676
1459 287
1313 766
260 658
419 406
706 1964
1985 18
1689 94...

output:

0 0 0 0 0 0 0 0 0 0 6 1 0 0 17 0 0 0 6 0 0 0 0 0 0 0 0 11 12 0 1 0 0 6 2 0 2 0 1 0 0 0 23 0 0 6 0 0 0 0 15 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 6 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 0 0 0 2 0 0 1 0 4 0 0 0 1 0 0 0 3 6 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 6 1 0 0 17...3 0 0 2 0 1 3 0 17 0 0 0 0 0 0 '

Test #9:

score: 16
Accepted
time: 5ms
memory: 20188kb

input:

2000 2000
1810 1068
1810 1639
1810 1155
1810 1439
1810 519
1810 1012
1810 1607
1810 1994
1810 590
1810 136
1810 1385
1810 103
1810 1491
1810 1587
1810 137
1810 1166
1810 1843
1810 519
1810 42
1810 1825
1810 1768
1810 1787
1810 1491
1810 743
1810 1998
1810 1850
1810 1680
1810 480
1810 986
1810 368
18...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #10:

score: 16
Accepted
time: 6ms
memory: 20864kb

input:

2000 2000
786 392
392 1361
1361 311
311 1162
1162 394
394 786
786 1162
1162 394
394 786
786 311
311 786
786 394
394 1361
394 1162
1162 311
311 1162
1162 392
392 1162
1162 394
394 786
786 392
392 1361
1361 311
311 1361
1361 311
1361 394
394 1361
1361 786
786 311
311 392
392 1361
1361 1162
1162 394
39...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #11:

score: 16
Accepted
time: 11ms
memory: 26272kb

input:

2000 2000
790 1305
790 1607
1607 738
738 136
136 338
338 1963
1963 733
733 1368
1368 1267
1267 762
762 1802
1802 1100
1100 1488
1488 1028
1028 368
368 911
911 1100
1100 762
762 1377
1377 907
907 1290
1377 733
733 790
790 247
247 1383
1383 102
102 1859
1859 626
626 1231
1231 1597
1597 1164
1164 178
1...

output:

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 28 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 16 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #12:

score: 16
Accepted
time: 5ms
memory: 18296kb

input:

2000 2000
1021 1003
1021 1841
1841 1143
1021 1143
1143 1841
1021 704
704 1841
1021 1333
1021 1003
1021 704
704 1841
1021 1143
1143 1841
1143 704
1143 1333
1333 704
704 1841
1333 1003
1143 1333
1143 704
1021 599
1021 1841
1021 599
1021 1841
1841 704
1841 1003
1841 599
599 1333
599 1333
599 1333
1021 ...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #13:

score: 16
Accepted
time: 2ms
memory: 20400kb

input:

2000 2000
1584 1944
853 1300
193 1550
5 1709
1366 853
43 300
737 1662
1160 1292
1959 1325
1498 875
1532 949
1132 545
1486 815
445 1550
839 802
345 113
579 655
1108 141
1140 1968
1332 1153
1992 537
1921 1329
1325 1959
292 363
1642 1958
934 1694
512 1063
205 1916
1940 1333
1105 1320
56 292
1910 292
13...

output:

0 0 0 0 0 7 0 0 0 1 5 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 49 0 0 0 0 1 0 0 0 0 0 1 0 0 0 2 0 2 0 0 0 1 0 1 1 0 0 2 0 1 5 5 0 1 0 0 0 0 2 1 1 0 0 0 0 0 0 1 1 5 0 1 0 1 0 0 0 1 0 0 2 1 0 0 0 0 0 0 3 0 0 2 0 3 0 0 1 4 0 4 0 1 0 0 1 0 0 2 1 31 1 2 0 0 0 0 2 0 1 0 0 0 0 0 14 1 0 0 2 4 0 0 0 0 0 0 0 1 0 1 1 1 0...

result:

ok single line: '0 0 0 0 0 7 0 0 0 1 5 0 0 0 0 ... 0 0 3 0 0 0 0 2 0 0 0 0 0 0 4 '

Test #14:

score: 16
Accepted
time: 0ms
memory: 20360kb

input:

2000 2000
1799 144
1033 145
1875 1701
1408 1423
333 197
1417 493
145 1359
839 1273
542 1546
1308 1344
1410 77
1025 1377
1417 426
855 212
495 1251
905 611
1539 1350
1325 680
1295 1754
144 450
417 1616
287 1284
1739 997
51 726
262 734
614 86
313 1849
77 1946
151 222
551 624
1420 912
1501 489
1600 667
...

output:

0 0 0 2 0 2 0 0 0 0 0 0 0 3 6 0 0 17 0 0 7 0 0 0 0 0 1 0 1 1 0 11 0 2 0 0 0 0 0 0 0 1 0 2 0 0 0 0 0 4 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 5 0 0 0 0 0 3 0 0 0 0 0 0 1 5 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 7 1 0 2 0 2 0 2 0 0 0 0 0 0 0 3 0 0 0 0 0 4 1 1 1 0 0 9 0 0 0 4 0 3 0 0 0 5 4 0 0 0 0 0 4 5 4 0 0 ...

result:

ok single line: '0 0 0 2 0 2 0 0 0 0 0 0 0 3 6 ...0 1 4 1 1 5 4 0 14 0 2 0 0 1 0 '

Test #15:

score: 16
Accepted
time: 4ms
memory: 20812kb

input:

2000 2000
1367 457
1367 1853
1367 459
459 178
459 863
863 457
459 743
743 1853
1853 459
1367 743
743 459
459 1853
743 178
178 863
863 1853
178 457
457 863
178 457
457 459
178 457
457 1853
457 178
178 1853
743 457
457 459
457 743
743 1853
1853 459
1367 459
459 743
459 457
457 1853
459 743
743 863
459...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #16:

score: 16
Accepted
time: 0ms
memory: 20860kb

input:

2000 2000
236 944
944 1282
236 658
658 1524
658 1048
1524 1946
1048 1274
236 458
1946 1258
1946 834
458 867
236 1572
1946 1624
867 369
1048 1883
944 277
944 97
658 661
1258 298
658 1860
97 263
944 136
1946 1270
1572 885
298 453
277 1216
277 791
661 1259
1216 294
834 173
298 1430
294 1220
1048 935
12...

output:

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

result:

ok single line: '0 0 0 0 0 0 3 0 3 0 1 0 0 1 0 ...2 2 1 0 0 3 3 0 0 0 1 3 20 0 2 '

Test #17:

score: 16
Accepted
time: 0ms
memory: 20252kb

input:

2000 2000
466 347
1906 1039
168 676
760 1433
168 1086
466 1787
168 470
1319 852
168 1458
1677 1028
760 727
1682 1448
727 1554
1514 1979
1787 824
1319 28
347 839
168 672
672 1295
672 1946
824 725
28 963
1787 864
839 542
1554 651
1039 1965
1677 1212
1787 1720
470 830
168 586
542 1218
727 478
839 313
3...

output:

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

result:

ok single line: '1 0 2 0 0 0 1 0 1 5 2 0 0 0 0 ... 0 0 1 3 2 0 3 1 2 0 0 0 3 1 2 '

Test #18:

score: 16
Accepted
time: 0ms
memory: 20112kb

input:

3 4
0 1
2 1
1 0
2 1

output:

1 1 2 

result:

ok single line: '1 1 2 '

Test #19:

score: 16
Accepted
time: 0ms
memory: 17956kb

input:

3 7
0 1
0 2
2 0
0 1
1 0
2 0
0 2

output:

2 2 3 

result:

ok single line: '2 2 3 '

Test #20:

score: 16
Accepted
time: 2ms
memory: 20104kb

input:

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

output:

5 0 1 1 1 2 

result:

ok single line: '5 0 1 1 1 2 '

Subtask #3:

score: 0
Time Limit Exceeded

Test #21:

score: 0
Time Limit Exceeded

input:

2 200000
0 1
1 0
1 0
1 0
0 1
1 0
0 1
1 0
1 0
0 1
0 1
1 0
0 1
0 1
1 0
0 1
1 0
0 1
0 1
0 1
1 0
0 1
0 1
1 0
1 0
0 1
1 0
1 0
1 0
1 0
0 1
1 0
0 1
0 1
0 1
0 1
0 1
0 1
1 0
0 1
1 0
0 1
1 0
0 1
0 1
1 0
1 0
1 0
0 1
1 0
1 0
1 0
0 1
1 0
1 0
0 1
0 1
0 1
1 0
0 1
1 0
1 0
1 0
1 0
0 1
0 1
1 0
1 0
0 1
0 1
0 1
1 0
0 1...

output:


result:


Subtask #4:

score: 20
Accepted

Test #31:

score: 20
Accepted
time: 83ms
memory: 35272kb

input:

200000 200000
33870 101688
1598 78943
23260 47952
84769 196360
104405 172552
58448 113260
76500 80767
95836 53662
58671 55746
167974 83639
176177 32272
45361 115076
152875 160216
33361 176768
162031 181989
134541 80064
21681 167447
96707 196846
16036 34620
166990 179451
45201 65888
89903 93145
13742...

output:

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

result:

ok single line: '0 2 0 1 1 0 0 0 1 0 0 1 0 1 1 ... 0 0 0 0 0 3 0 1 0 2 2 0 0 2 0 '

Test #32:

score: 20
Accepted
time: 72ms
memory: 34868kb

input:

120000 200000
47028 97371
10694 30969
37884 97965
79789 57716
72114 19105
63568 75984
24671 22171
7017 36090
113544 17450
87835 67175
98652 109356
82068 98582
62905 72641
107351 10586
4777 47491
72693 22072
62301 85225
99719 48561
12025 89424
48351 29694
53249 8089
94857 39686
98016 49821
46469 2610...

output:

0 0 0 1 0 0 0 0 0 1 3 0 3 0 0 0 0 0 2 0 0 0 0 1 1 1 2 0 0 0 0 0 0 0 0 2 3 0 0 0 0 0 0 0 0 0 0 1 1 2 0 4 0 0 0 2 0 1 0 0 0 0 0 0 0 2 0 3 0 7 0 1 2 0 0 1 0 3 0 0 2 0 9 1 0 4 5 0 3 0 0 0 2 0 0 5 3 3 0 4 0 6 3 0 0 1 4 0 0 2 0 0 1 4 0 0 0 8 0 0 1 0 1 6 2 1 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 8 0 1 0 0 20 2 0...

result:

ok single line: '0 0 0 1 0 0 0 0 0 1 3 0 3 0 0 ... 0 1 2 0 0 0 0 4 1 0 1 4 1 1 1 '

Test #33:

score: 20
Accepted
time: 84ms
memory: 38676kb

input:

200000 200000
31345 191302
105122 84281
197303 115635
143667 863
60760 45666
79772 76452
191041 73107
169366 8678
889 114053
60521 141421
80318 1903
81751 46219
94602 57976
31746 191688
112169 129497
4282 190436
169886 133842
198775 945
69236 182997
101836 120305
58522 139048
134100 50445
30760 4164...

output:

0 1 0 1 0 0 0 0 0 3 1 0 1 0 0 1 0 1 14 1 4 0 2 2 0 0 2 1 1 1 0 0 0 0 1 1 0 2 0 1 1 0 0 0 0 0 1 0 1 1 1 1 3 0 1 1 0 0 0 0 0 0 5 3 1 3 0 1 1 1 3 2 1 1 3 0 0 3 1 0 0 0 0 1 0 0 1 1 2 1 0 0 0 5 0 0 1 0 0 1 1 1 1 2 0 0 0 1 1 1 0 4 1 0 3 0 0 2 1 1 0 0 1 3 1 4 1 3 1 1 0 0 0 3 0 0 1 1 5 2 1 2 0 2 0 3 0 0 1 1...

result:

ok single line: '0 1 0 1 0 0 0 0 0 3 1 0 1 0 0 ... 0 3 1 0 0 1 1 0 3 0 1 2 0 1 1 '

Test #34:

score: 20
Accepted
time: 92ms
memory: 39540kb

input:

200000 200000
161817 65043
5422 95142
92131 84269
22546 112499
69690 123565
190912 4047
48023 148291
26840 122049
179311 29337
163863 114795
77506 12874
8949 157995
66528 8013
82151 66623
194183 138996
22898 12534
198152 18644
16074 33112
133078 11997
80729 144593
121126 123467
15341 185242
121209 4...

output:

0 0 0 0 0 0 0 1 10 1 0 0 0 0 0 0 0 2 1 0 0 0 3 0 0 1 0 0 0 2 0 1 0 0 0 0 0 0 2 0 1 0 3 0 0 1 0 0 0 1 0 1 0 5 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 1 0 0 0 5 1 0 0 1 1 0 0 0 0 4 0 0 0 0 0 0 36 1 0 2 0 1 0 3 2 0 3 4 0 0 7 1 0 0 0 0 0 0 0 0 5 0 0 0 2 0 0 0 0 0 0 1 5...

result:

ok single line: '0 0 0 0 0 0 0 1 10 1 0 0 0 0 0... 0 0 0 0 1 0 0 2 0 0 1 2 0 0 0 '

Test #35:

score: 20
Accepted
time: 79ms
memory: 44100kb

input:

200000 200000
22653 10255
56556 116378
81515 188677
196661 165
29738 193520
149106 33931
191747 164089
10434 112474
102928 112276
65179 74364
98630 175363
39616 73875
131414 55785
183883 47374
137543 155292
92804 108178
33436 76558
165496 103873
44118 5903
173109 154076
125448 88957
74766 64160
1196...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 98 0 0 0 0 0 0 0 0 0 0 0 0 6 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 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 52 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 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 159 0 0 0...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 10 0... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #36:

score: 20
Accepted
time: 97ms
memory: 40056kb

input:

200000 200000
38012 150950
125594 70713
174568 49083
34048 36932
1343 15995
182544 195433
107420 114083
192284 19050
52998 124520
165507 151026
126535 177178
83208 102273
137414 128702
3393 14235
350 163583
192457 152958
123692 148250
57653 48785
182794 92695
174066 76882
184041 179390
33737 184078
...

output:

2 0 0 0 0 0 1 0 1 1 1 1 0 1 1 6 1 3 3 0 1 1 0 2 1 0 2 0 1 1 1 0 2 1 0 1 0 2 0 3 0 0 13 1 0 1 1 1 0 1 0 3 1 1 1 0 0 2 1 0 0 11 1 0 1 0 3 1 0 3 0 1 0 0 0 2 2 0 1 1 0 0 1 3 0 0 3 0 7 3 1 1 1 1 0 0 0 1 0 1 0 0 0 0 0 0 2 1 0 0 1 0 0 0 1 1 4 3 1 12 0 0 0 0 1 1 4 0 2 1 1 1 0 3 1 0 0 1 2 0 2 0 2 3 1 0 0 1 0...

result:

ok single line: '2 0 0 0 0 0 1 0 1 1 1 1 0 1 1 ... 4 0 0 0 0 0 3 1 1 3 0 1 2 0 1 '

Test #37:

score: 20
Accepted
time: 143ms
memory: 46408kb

input:

200000 200000
65268 28589
186519 98228
3133 81974
199702 32400
112616 158298
97369 32630
163440 5933
2099 111717
115487 178721
66497 184621
188784 117077
156976 161776
41858 120734
41049 106374
157327 37210
170706 90900
193030 103284
108419 130593
30198 157593
45486 158778
157246 10417
112957 74789
...

output:

2 0 0 0 3 0 1 3 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 2 0 0 1 1 1 1 0 0 2 0 0 0 3 0 0 0 0 0 1 0 0 6 0 0 0 2 0 0 0 0 0 0 0 3 0 0 0 0 24 1 0 2 2 1 0 0 0 5 2 1 0 0 1 0 16 0 0 0 0 0 1 0 0 0 1 1 1 0 10 0 0 0 0 0 1 1 1 4 0 4 1 2 0 2 0 1 1 0 0 0 0 1 0 0 8 2 3 0 0 0 0 0 0 0 1 1 5 0 2 1 3 1...

result:

ok single line: '2 0 0 0 3 0 1 3 0 0 0 0 0 0 0 ... 0 0 0 2 0 1 0 1 3 6 0 0 1 0 1 '

Test #38:

score: 20
Accepted
time: 83ms
memory: 37196kb

input:

200000 200000
46149 165360
50988 182943
69590 199169
135207 168973
143392 28735
21962 174608
102578 124463
20577 149389
84918 69868
165657 109892
176257 171365
35637 99031
90266 8331
197180 86293
109399 194349
173129 82460
173332 34424
155029 162731
191490 50095
158695 125550
45809 106170
121013 184...

output:

1 0 0 1 1 0 1 1 0 2 0 0 1 1 0 0 3 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 1 7 1 1 1 2 3 0 1 0 1 1 3 1 0 1 3 2 2 0 3 3 0 1 1 1 0 1 2 0 1 1 1 0 0 1 1 1 1 1 2 4 0 1 1 2 1 1 1 3 0 0 2 2 1 1 0 0 1 0 0 0 3 1 0 1 1 1 0 0 1 1 1 1 3 1 3 0 0 2 0 1 2 0 3 0 1 0 2 2 1 1 0 1 1 1 1 0 1 3 1 1 3 0 1 1 1 3 0 1 0 2 1 1 0 1 0 1 ...

result:

ok single line: '1 0 0 1 1 0 1 1 0 2 0 0 1 1 0 ... 3 1 0 0 0 0 1 1 3 1 1 0 1 3 1 '

Test #39:

score: 20
Accepted
time: 259ms
memory: 101556kb

input:

200000 200000
150663 138574
162545 23730
102659 49433
28627 105650
54618 118941
62082 59213
103668 20457
115658 87367
117634 85369
7174 80230
156487 86083
28155 196145
98972 119628
127821 156281
98285 134668
36078 123797
140266 118221
57495 172360
163757 38765
40657 38765
5434 168437
83739 49787
747...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #40:

score: 20
Accepted
time: 84ms
memory: 39612kb

input:

200000 200000
69584 124920
23019 88345
46775 46872
60081 104283
54276 63974
79639 173666
24958 106210
132628 150099
5240 193653
185157 163134
170247 5746
26683 79306
175079 124450
97262 63460
32268 100353
52031 16848
8057 38354
138601 125211
81344 160155
51051 3549
88947 14035
165251 111970
59934 77...

output:

1 0 0 3 0 0 1 0 0 3 1 0 0 0 7 0 4 1 0 0 1 0 0 0 0 0 3 0 0 1 9 0 2 1 0 0 2 0 1 1 10 1 0 0 0 0 1 0 1 1 3 0 0 0 3 0 0 3 3 0 2 0 2 1 0 0 1 0 1 0 1 0 0 0 1 0 0 0 1 1 1 0 2 2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 1 0 0 1 4 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 3 0 1 0 0 1 0 1 2 0 3 0 0 3 0 5 0 0 0 3 2...

result:

ok single line: '1 0 0 3 0 0 1 0 0 3 1 0 0 0 7 ... 3 3 1 0 1 0 2 1 1 0 2 1 2 0 0 '

Test #41:

score: 20
Accepted
time: 100ms
memory: 46064kb

input:

200000 200000
152701 63906
7265 70804
196416 158367
123978 158827
191508 29784
113861 185154
126313 139011
132812 193829
102675 53184
72766 143750
94166 183727
138170 80452
163799 51972
77387 95341
59265 151029
39141 166251
139277 160569
185387 181856
193455 47519
133160 193325
105789 4697
94088 161...

output:

0 0 0 0 0 0 0 0 0 8 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 0 0 0 0 0 27 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 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7...

result:

ok single line: '0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 ...0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 '

Test #42:

score: 20
Accepted
time: 85ms
memory: 56108kb

input:

200000 200000
166472 26705
147957 76560
60550 89597
196064 119320
85639 86901
60732 70809
85639 70160
189424 86901
166368 2770
152226 91254
185846 192947
193136 149849
192947 26589
3725 45428
91254 63442
15430 177149
71555 133981
86901 177149
177149 69875
38473 26589
177058 150747
173750 48271
89597...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #43:

score: 20
Accepted
time: 40ms
memory: 33876kb

input:

200000 200000
142716 177973
142716 177973
33682 177973
142716 33682
142716 177973
142716 33682
142716 33682
142716 177973
142716 33682
177973 33682
142716 177973
177973 33682
142716 177973
142716 33682
142716 33682
142716 33682
33682 177973
33682 177973
142716 177973
142716 33682
142716 177973
14271...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Test #44:

score: 20
Accepted
time: 62ms
memory: 41828kb

input:

200000 200000
102764 85969
120299 85969
102764 161503
120299 120078
102764 120299
85969 168358
102764 120299
120299 161503
120299 169879
120299 120078
102764 168358
169879 120078
85969 95726
168358 119138
120299 85969
102764 161503
135792 95726
120299 120078
95726 119138
95726 161503
168358 120078
9...

output:

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '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 '

Subtask #5:

score: 0
Time Limit Exceeded

Test #45:

score: 0
Time Limit Exceeded

input:

200000 199999
38963 164177
50862 38963
161216 50862
40786 161216
101295 40786
95756 101295
172936 95756
194407 172936
106240 194407
155843 106240
82989 155843
46308 82989
35380 46308
180666 35380
62373 180666
100648 62373
22679 100648
23941 22679
57908 23941
195841 57908
30559 195841
123952 30559
68...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

0%