QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#117405#30. Political Developmentxiaossr#4 3ms6692kbC++171.6kb2023-07-01 05:23:202024-05-31 18:45:12

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 4
Accepted

Test #1:

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

input:

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

output:

2

result:

ok single line: '2'

Test #2:

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

input:

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

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 3ms
memory: 6476kb

input:

5000 2
1 1791
1 4343
2 2031 1630
1 286
2 4788 1978
3 847 2364 4193
2 88 1614
1 3321
1 1441
1 1098
1 1547
1 318
1 4939
1 697
3 1335 3973 2092
1 3700
1 3959
1 4582
2 2907 3324
1 364
1 4868
1 1406
4 1827 3291 2215 4513
2 1303 2448
3 3699 2272 775
4 3113 1333 2670 1991
2 2450 3615
4 3825 2008 1100 2938
...

output:

2

result:

ok single line: '2'

Test #4:

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

input:

5000 2
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460
1 1460...

output:

2

result:

ok single line: '2'

Test #5:

score: 0
Accepted
time: 3ms
memory: 6388kb

input:

5000 2
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782
1 1782...

output:

2

result:

ok single line: '2'

Test #6:

score: 0
Accepted
time: 3ms
memory: 6388kb

input:

5000 2
1 1692
1 3670
1 3770
1 2722
1 2554
1 4972
1 3203
1 1406
1 62
1 2411
1 4472
1 3565
1 1465
1 4734
1 3229
1 707
1 4925
1 597
1 3764
1 1406
1 778
1 2086
1 1696
1 2956
1 707
1 1406
1 3604
1 597
1 1275
1 3203
1 707
1 4577
1 997
1 3604
1 1747
1 860
1 3565
1 3693
1 164
1 818
1 3693
1 4790
1 86
1 3969...

output:

2

result:

ok single line: '2'

Test #7:

score: 0
Accepted
time: 3ms
memory: 6684kb

input:

5000 2
1 1495
1 4736
1 2861
72 2890 4002 3751 2434 4908 3707 1698 4275 2507 2625 1942 1452 1309 2552 4 3667 4794 289 309 3334 2996 3208 1001 2408 707 3200 4272 3343 4465 4748 1352 48 2894 4367 3534 4594 4433 4265 3168 2324 2681 4909 1986 501 2958 784 4138 409 2837 4999 3840 3654 327 3620 4399 319 33...

output:

2

result:

ok single line: '2'

Test #8:

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

input:

5000 2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

1

result:

ok single line: '1'

Test #9:

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

input:

1 1
0

output:

1

result:

ok single line: '1'

Test #10:

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

input:

5000 2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

2

result:

ok single line: '2'

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #11:

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

input:

5000 2
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154
1 1154...

output:

2

result:

ok single line: '2'

Test #12:

score: 0
Accepted
time: 3ms
memory: 6692kb

input:

5000 3
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423
1 1423...

output:

2

result:

ok single line: '2'

Test #13:

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

input:

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

output:

2

result:

ok single line: '2'

Test #14:

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

input:

5000 3
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937
1 2937...

output:

2

result:

ok single line: '2'

Test #15:

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

input:

5 3
0
2 2 3
2 3 1
2 2 1
0

output:

3

result:

ok single line: '3'

Test #16:

score: 0
Accepted
time: 3ms
memory: 6460kb

input:

5000 3
1 2124
1 3797
1 4553
1 4508
1 1597
1 1937
1 4085
1 72
1 1579
1 4933
1 4085
1 4553
1 1759
1 3797
1 1579
1 2531
1 4297
1 814
1 3729
1 4070
1 1606
1 1251
1 920
1 1365
1 3586
1 2124
1 827
1 4132
1 4645
1 3586
1 3945
1 72
1 4933
1 1759
1 1365
1 3729
1 1759
1 2531
1 2715
1 1817
1 494
1 1937
1 3489
...

output:

2

result:

ok single line: '2'

Test #17:

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

input:

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

output:

3

result:

ok single line: '3'

Test #18:

score: 0
Accepted
time: 3ms
memory: 6328kb

input:

5000 3
1 1692
1 3670
1 3770
1 2722
1 2554
1 4972
1 3203
1 1406
1 62
1 2411
1 4472
1 3565
1 1465
1 4734
1 3229
1 707
1 4925
1 597
1 3764
1 1406
1 778
1 2086
1 1696
1 2956
1 707
1 1406
1 3604
1 597
1 1275
1 3203
1 707
1 4577
1 997
1 3604
1 1747
1 860
1 3565
1 3693
1 164
1 818
1 3693
1 4790
1 86
1 3969...

output:

2

result:

ok single line: '2'

Test #19:

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

input:

5000 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
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

1

result:

ok single line: '1'

Test #20:

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

input:

5000 3
1 4978
1 838
1 2090
1 2059
1 3473
1 3392
1 3776
1 4073
1 1498
1 1831
1 3645
1 323
1 3789
1 3555
1 2658
1 3953
1 167
1 1424
1 1944
1 1748
1 3592
1 1697
1 3034
1 4369
1 834
1 3873
1 3964
1 2160
1 4030
1 3652
1 1931
1 3657
1 1500
1 1193
1 3550
1 3287
1 1339
1 2943
1 4697
1 1390
1 4134
1 3322
1 4...

output:

3

result:

ok single line: '3'

Test #21:

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

input:

5000 3
1 4920
1 3824
1 1763
1 785
1 1613
1 2253
1 3343
1 34
1 905
1 2732
1 2112
1 1644
1 3772
1 4254
1 1143
1 2579
1 3267
1 3263
1 3699
1 2181
1 936
1 867
1 2614
1 865
1 2998
1 901
1 2044
1 2335
1 1665
1 2048
1 571
1 2400
1 1961
1 4537
1 7
1 4327
1 2380
1 1730
1 1232
1 4381
1 154
1 2571
1 807
1 3934...

output:

3

result:

ok single line: '3'

Test #22:

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

input:

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

output:

2

result:

ok single line: '2'

Test #23:

score: -12
Wrong Answer
time: 3ms
memory: 6500kb

input:

5000 3
2 11 4552
2 2485 1399
2 3747 2906
3 3702 2655 2871
1 3902
2 3893 4591
1 3574
1 123
2 3269 1354
1 1201
2 662 831
7 3302 2808 4537 0 3789 2902 2028
5 3598 2273 4345 4790 2111
2 2604 3829
2 3358 2711
5 2831 3507 2723 3472 929
3 4417 1555 4746
2 640 4809
2 1518 4570
1 4562
4 3081 1145 3030 4813
3...

output:

2

result:

wrong answer 1st lines differ - expected: '3', found: '2'

Subtask #3:

score: 0
Time Limit Exceeded

Test #44:

score: 23
Accepted
time: 1ms
memory: 6252kb

input:

5000 4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

1

result:

ok single line: '1'

Test #45:

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

input:

20 6
5 16 14 9 18 1
4 15 19 0 7
5 15 8 17 5 12
5 15 16 12 6 13
5 12 18 10 5 9
5 16 4 6 2 8
5 3 16 5 18 8
5 13 17 19 11 1
5 6 2 5 18 10
5 15 4 0 12 11
5 4 14 8 13 17
4 15 9 13 7
5 3 4 14 2 9
5 3 10 19 7 11
5 12 10 17 19 0
5 3 9 1 2 11
5 3 6 0 19 5
5 14 2 18 10 7
5 4 6 8 17 0
5 16 14 13 1 7

output:

3

result:

ok single line: '3'

Test #46:

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

input:

20 6
5 1 8 16 14 9
5 0 12 13 3 7
5 15 18 16 10 17
5 1 10 18 8 12
5 15 6 19 17 11
5 11 7 14 19 17
5 10 12 17 4 18
5 1 11 12 14 5
5 3 0 17 14 13
3 18 0 19
5 15 3 6 16 2
5 4 13 5 7 12
5 1 3 6 11 7
5 15 1 11 8 16
5 8 7 5 16 0
5 18 13 10 4 2
5 13 2 10 14 0
5 6 4 8 5 2
5 15 3 6 9 2
3 4 5 9

output:

3

result:

ok single line: '3'

Test #47:

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

input:

13 5
2 11 12
2 11 2
3 7 6 1
2 11 6
2 11 7
2 11 10
3 2 7 3
3 2 6 4
3 10 12 9
2 11 8
3 8 12 5
6 5 9 0 1 4 3
3 10 8 0

output:

3

result:

ok single line: '3'

Test #48:

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

input:

20 6
5 2 17 13 6 14
5 8 7 5 16 3
5 4 19 14 0 18
4 1 12 11 14
5 10 9 11 14 2
5 8 7 1 16 17
4 10 19 0 13
5 8 5 1 16 9
5 7 5 1 16 12
5 7 15 4 10 19
5 4 13 9 6 18
5 15 4 13 3 19
5 8 15 17 18 3
5 15 10 11 0 6
5 4 2 0 3 18
5 13 9 12 18 11
5 8 7 5 1 17
5 5 16 12 0 19
5 15 12 10 2 14
5 9 2 11 17 6

output:

5

result:

ok single line: '5'

Test #49:

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

input:

20 6
5 7 18 5 3 11
5 7 14 19 16 9
5 13 8 12 4 10
5 7 18 5 0 6
5 13 17 2 6 10
5 7 18 3 0 17
4 3 11 4 10
5 18 5 3 0 1
5 15 14 9 12 2
5 8 19 15 11 1
5 13 12 2 4 6
5 0 14 9 6 15
5 18 8 16 10 2
5 14 17 4 2 10
5 13 8 1 11 19
4 8 16 9 11
5 12 19 15 1 17
5 5 13 19 16 4
5 7 5 3 0 12
5 14 17 9 16 1

output:

5

result:

ok single line: '5'

Test #50:

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

input:

20 6
5 1 3 11 8 19
5 0 3 11 8 18
5 3 14 9 6 17
5 0 1 11 8 2
4 9 16 12 17
5 14 6 10 7 19
5 15 10 5 7 2
5 14 6 13 5 12
5 0 1 3 11 18
5 14 10 4 19 2
5 9 6 5 15 16
5 0 1 3 8 19
5 13 7 16 17 4
5 19 7 18 12 15
5 7 5 2 18 9
5 6 13 16 10 17
5 12 15 18 4 10
4 2 12 15 4
5 1 8 14 13 16
5 0 11 9 13 5

output:

5

result:

ok single line: '5'

Test #51:

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

input:

20 6
5 1 3 11 19 18
5 0 3 11 2 8
5 1 8 14 6 7
5 0 1 11 19 18
4 14 16 12 17
5 11 9 15 10 7
5 10 2 17 13 19
5 11 9 2 13 5
5 1 2 18 9 10
5 8 14 10 5 7
5 8 9 6 5 15
5 0 1 3 7 5
4 13 16 17 4
5 6 18 12 19 7
5 4 9 19 2 15
5 14 5 16 10 17
5 12 15 18 4 17
5 6 15 16 12 4
5 0 3 8 13 16
5 0 3 14 6 13

output:

4

result:

ok single line: '4'

Test #52:

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

input:

20 6
5 15 16 7 13 2
5 15 9 6 11 7
4 19 0 10 5
5 19 8 17 18 10
5 6 19 17 14 18
5 18 13 16 12 2
5 15 9 11 1 4
5 1 8 14 0 16
5 19 3 7 17 10
5 15 6 11 1 10
5 9 8 12 2 3
5 15 9 6 1 13
4 14 10 16 5
5 11 14 0 5 16
5 4 7 18 13 12
5 9 6 11 1 0
5 0 13 5 7 12
5 19 8 4 18 3
5 17 14 5 4 3
5 2 8 3 17 4

output:

5

result:

ok single line: '5'

Test #53:

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

input:

20 6
5 6 15 9 5 10
5 16 10 15 2 4
5 13 1 11 8 15
5 17 9 19 18 5
5 6 1 11 8 15
4 12 9 0 3
5 16 13 12 0 4
4 17 19 14 18
5 12 10 2 4 9
5 11 8 3 0 5
5 1 8 17 0 14
5 15 4 14 2 9
5 16 13 6 5 8
5 16 6 12 14 2
5 13 11 18 10 7
5 1 11 2 4 0
5 13 6 12 19 1
5 7 18 10 19 3
5 17 19 14 3 7
5 16 17 18 3 7

output:

4

result:

ok single line: '4'

Test #54:

score: -23
Time Limit Exceeded

input:

50000 10
9 32960 26666 36698 27825 19469 40251 7694 43050 49699
9 28680 11214 13759 31209 6922 20079 42730 11997 443
9 4366 42847 15773 31538 6839 18130 22993 45787 37886
9 29348 35251 38031 35020 29149 1972 33352 38984 8565
9 115 2566 8766 22339 44559 33816 38982 39958 14757
9 25095 44878 9405 3414...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #2:

0%

Subtask #5:

score: 0
Skipped

Dependency #2:

0%