QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#447413#68. Designated Citiesegypt_ioi2024_05#23 239ms27496kbC++171.6kb2024-06-18 14:06:592024-06-18 14:06:59

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 6
Accepted

Test #1:

score: 6
Accepted
time: 0ms
memory: 27152kb

input:

2
1 2 781089648 283888890
2
1
2

output:

283888890
0

result:

ok 2 lines

Test #2:

score: 6
Accepted
time: 4ms
memory: 27104kb

input:

16
6 10 160848335 124052868
7 1 241203243 110601447
14 6 290972019 163072373
11 15 938517011 154373610
12 1 138651641 741445657
7 8 60218933 280830068
16 15 203079209 633547400
11 7 199606763 919756826
14 12 266702877 916493997
15 13 905937802 481991969
2 10 234605456 722866810
3 5 366455156 4966982...

output:

6311369523
2092762454
966156735
60218933
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #3:

score: 6
Accepted
time: 0ms
memory: 27068kb

input:

16
3 4 204022014 914663555
9 10 11007340 458844696
2 7 605164817 895349276
14 11 434326485 550918606
14 7 712866927 489761842
6 1 356406033 534499656
16 8 942553720 855217399
5 10 865707145 586883622
6 13 108330979 234031340
15 8 769531307 948036095
3 16 358448538 363203546
5 2 419315988 76297418
12...

output:

7413430560
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #4:

score: 6
Accepted
time: 3ms
memory: 27100kb

input:

16
4 5 1000000000 1000000000
10 5 1000000000 1000000000
8 5 1000000000 1000000000
11 13 999999646 999999646
15 16 999998089 999998089
7 5 929 929
14 7 898 898
16 9 159 159
6 12 603 603
9 2 999997930 999997930
3 6 999999242 999999242
5 12 155 155
16 14 84 84
14 1 999998173 999998173
12 13 199 199
16
...

output:

7999996107
5999996107
4999996107
3999996107
2999996107
1999996262
999998089
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #5:

score: 6
Accepted
time: 4ms
memory: 27092kb

input:

16
11 14 14368758 85219578
14 16 643747916 252121045
9 14 727413140 523990811
2 15 521253466 147320442
7 13 866289084 908489699
12 6 320730514 344516785
10 9 516379646 496493179
15 8 776569142 612383860
8 3 734861011 149748310
1 5 815040382 677607019
2 12 50609677 301797586
5 14 716517909 635543949
...

output:

7189308203
2211904770
1191420780
456559769
85219578
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #6:

score: 6
Accepted
time: 3ms
memory: 27064kb

input:

16
13 9 720744296 759388601
13 5 458441737 833011123
1 16 698474192 71086181
3 8 861918984 114516836
15 10 278084894 710666762
4 8 287405359 250250967
1 6 741642264 735381406
2 15 792787000 825787518
6 12 261754526 230466084
13 7 938274540 78969406
12 10 202958723 294264294
12 4 98252269 169605483
3...

output:

5844026168
2690903861
1848894892
1128150596
458441737
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #7:

score: 6
Accepted
time: 0ms
memory: 27076kb

input:

16
1 7 765638022 679756044
10 6 759069284 453967337
5 7 726239258 178402766
4 15 242761737 318885919
1 15 723511609 915383888
9 8 553064704 380886548
12 13 822971769 782770910
6 8 525975561 603298402
11 6 724594701 141189620
13 2 8408668 628943880
12 10 299406310 356329223
5 14 795305423 974800675
8...

output:

7154270560
522076168
141189620
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #8:

score: 6
Accepted
time: 4ms
memory: 27004kb

input:

16
6 2 396591 824425
14 1 121765 805092
9 10 386895 457376
3 15 20413 247942
8 3 426212 748706
12 11 318841 270569
2 16 925055746 604726712
12 1 359775 784231
14 5 516354 617685
2 9 970316 896797
2 7 943776860 978585272
14 9 712667 948012
8 9 566593 580631
4 12 761761 974298
13 2 136216 831818
16
1
...

output:

1556207783
7704211
3905589
2878333
2046515
1222090
705736
318841
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #9:

score: 6
Accepted
time: 3ms
memory: 27092kb

input:

16
2 8 119073534 555736925
5 2 866791517 685527555
11 14 180535517 448907590
2 16 393190702 164818863
6 9 298521139 301021930
2 1 808238767 844723287
4 1 221776781 268737189
10 2 551486708 14310879
2 15 363573262 106859347
2 9 622353716 714488454
13 2 908780203 288479297
13 7 897814090 253679879
2 3...

output:

6418370219
4638508078
3561532122
2638156476
1952628921
1339055967
890148377
496957675
133384413
14310879
0
0
0
0
0
0

result:

ok 16 lines

Test #10:

score: 6
Accepted
time: 3ms
memory: 27052kb

input:

16
3 12 901164666 987344195
7 11 777270351 297899178
6 14 441322434 685318792
3 4 894100390 768738682
6 10 308476613 227952988
12 2 398335684 800091780
15 9 683557377 818349714
2 8 55495903 851348261
5 10 842245631 650602672
11 16 169505872 655780963
9 8 978986177 766795908
5 13 17521706 829965580
1...

output:

8007192643
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 16 lines

Test #11:

score: 6
Accepted
time: 3ms
memory: 27084kb

input:

16
12 15 517822965 25354413
11 15 338190311 652436812
7 15 127729186 939448905
15 13 696913706 181993967
1 15 498822103 388824680
9 15 20787116 535387165
15 16 202795662 159091154
15 4 474628657 160994640
15 14 997130096 858493491
15 3 341451768 47792481
15 5 757815934 174503003
8 15 341732022 77854...

output:

7709225932
6581334361
5641885456
4863341388
4105525454
3408611748
2756174936
2220787771
1746159114
1337789248
948964568
569601843
228150075
25354413
0
0

result:

ok 16 lines

Subtask #2:

score: 0
Time Limit Exceeded

Test #12:

score: 7
Accepted
time: 7ms
memory: 27096kb

input:

2
1 2 683402985 526289818
1
1

output:

526289818

result:

ok single line: '526289818'

Test #13:

score: 0
Time Limit Exceeded

input:

200000
30498 170310 456566691 649436035
88553 73637 443596936 376869783
157116 8270 670934073 119072463
24742 48732 237943289 398782798
118620 71333 841086509 861755957
91523 118037 345609124 755508586
182978 92078 999023640 247489369
57480 73002 550952716 31090859
85037 151494 615937607 181113974
8...

output:


result:


Subtask #3:

score: 0
Time Limit Exceeded

Test #21:

score: 9
Accepted
time: 8ms
memory: 27092kb

input:

2
2 1 92722556 873785501
1
2

output:

0

result:

ok single line: '0'

Test #22:

score: 0
Time Limit Exceeded

input:

200000
99982 83075 709942852 92942003
168325 12929 879930937 637190556
85628 123672 784369088 731448156
34917 117619 569166498 663184347
92257 112058 369526210 824568522
32464 109884 258245678 691717157
129594 115097 627894556 937225369
54700 187473 81636213 510866047
52020 197198 577461848 47343465...

output:


result:


Subtask #4:

score: 17
Accepted

Dependency #1:

100%
Accepted

Test #30:

score: 17
Accepted
time: 3ms
memory: 27052kb

input:

2
1 2 781089648 283888890
2
1
2

output:

283888890
0

result:

ok 2 lines

Test #31:

score: 17
Accepted
time: 239ms
memory: 27276kb

input:

2000
668 1839 972599655 457068476
133 11 666838083 851019038
1194 1287 133765716 574032589
107 441 176385032 470971775
131 1040 243142030 758968684
377 1963 707275419 115749455
1599 1801 764665175 425876028
169 656 229430355 330349441
128 1885 47324906 989597389
1366 419 253887722 295321149
1520 605...

output:

1007815336129
968471364756
948794710183
931465538135
919379309781
908949503371
898863017460
889541245976
880407673956
871485748529
862948404232
854564677534
846315324929
838321505364
830946890393
824397294302
818173445062
811962023909
805811586483
799889608613
794074981118
788469743669
783290399664
...

result:

ok 2000 lines

Test #32:

score: 17
Accepted
time: 167ms
memory: 27496kb

input:

2000
1507 1054 442165448 671661615
1248 179 87718372 57803246
177 1811 573774719 208696657
1774 45 808902498 987598144
100 667 997239116 107950700
1114 1047 90988914 625746213
818 116 312860776 925130030
1986 811 196318668 361242571
1124 1820 798979369 753656023
435 638 63026816 169722034
496 1349 9...

output:

979634806036
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 2000 lines

Test #33:

score: 17
Accepted
time: 236ms
memory: 27372kb

input:

2000
1525 429 147 147
1216 1496 340 340
717 1473 999975270 999975270
1114 862 697 697
1723 216 974 974
1059 865 495 495
182 210 766 766
1745 1959 999981504 999981504
1052 1914 638 638
318 1144 288 288
1401 927 176 176
1555 496 318 318
565 304 116 116
1439 265 90 90
952 790 402 402
1795 677 127 127
1...

output:

816987603536
814987603536
813987604014
812987604504
811987605268
810987606227
809987607186
808987608484
807987609782
806987611080
805987612378
804987613751
803987615124
802987616617
801987618383
800987620192
799987622058
798987623924
797987625794
796987627815
795987630118
794987632435
793987634752
7...

result:

ok 2000 lines

Test #34:

score: 17
Accepted
time: 229ms
memory: 27284kb

input:

2000
373 1642 63657133 850914336
103 774 827627582 753286797
1704 813 857134718 516101827
886 354 134978226 145183107
132 1239 17657223 582173637
1806 1813 549768976 884335257
993 1205 145864886 175216094
110 1804 554037719 889640060
1240 760 622694407 818131870
335 1049 176463161 321592201
1985 982...

output:

993439578644
956445814624
939840118265
927190958260
916391337740
906274516515
897352078924
888518216208
879966749793
871626842858
863454140478
855567065753
847681257509
840122943214
832807138112
825772780035
818957114766
812382909807
805850688392
799689205484
793683039565
788190914731
782921891017
7...

result:

ok 2000 lines

Test #35:

score: 17
Accepted
time: 228ms
memory: 27276kb

input:

2000
838 616 964972 727856
767 1966 297293 961917
1528 1174 350309 809912
94 145 528172 786328
1519 25 474782 330748
150 84 987021 119895
792 1577 188984 806709
76 1836 801862 360250
9 148 577892 890736
991 955 613442 930810
135 1623 71117 754738
1618 61 754384 824814
1921 1150 9872 832902
1416 16 3...

output:

3151729932
1490745586
970501973
936634296
916387727
896432666
882364904
871595506
861275935
852160225
843667677
835335533
827285136
819530016
812028588
804721144
798490006
792337990
786258606
780232964
774529076
768857427
763423701
758219379
753037762
747913173
742881442
737906445
732937194
72800087...

result:

ok 2000 lines

Test #36:

score: 17
Accepted
time: 229ms
memory: 27284kb

input:

2000
267 1012 29026841 359918212
1553 1061 435867283 33144312
1670 1109 988917740 68160339
948 496 231906652 737226954
610 1641 972617450 818164551
1030 931 630927532 461579893
1209 970 625011983 682844528
63 1856 458314131 670604776
1746 1008 696454538 404229917
917 813 392046602 435463075
1468 102...

output:

998853819359
967120682374
953269672580
941849331387
931241683825
921276677110
911337819540
901986725243
893200309022
884558703799
875976456800
867522290743
859558632337
851608471803
843762237099
836142232132
828919740309
821971874595
815367534376
809019317904
802895133103
796998597941
791322345111
7...

result:

ok 2000 lines

Test #37:

score: 17
Accepted
time: 238ms
memory: 27324kb

input:

2000
278 314 642322 260619
1354 1355 778536 561972
1107 765 653443 859029
810 1596 342249 271261
17 188 909841 624772
784 1153 387898 928863
230 566 503491 92369
1902 17 333718 17338
974 1777 696073 718026
358 758 956259 611920
1996 211 73914 992273
851 376 143429 561006
476 1156 762866 927086
177 7...

output:

14886853906
13166663751
12197152661
11244345647
10325387509
9436897021
8629006527
7850290167
7147075931
6474998375
5890753359
5309769240
4735542024
4172519089
3616514278
3067013296
2536143195
2014862258
1494918615
993605672
969765636
953350461
940694413
928618413
917888172
908243771
899808403
891555...

result:

ok 2000 lines

Test #38:

score: 17
Accepted
time: 233ms
memory: 27276kb

input:

2000
374 138 224422639 38871324
274 25 614140855 294378456
960 482 771284019 389463551
673 1495 327509275 759582532
1670 425 494511063 516818198
1512 234 758587972 294061250
125 416 760945280 345853400
1003 405 84717299 354546151
1935 927 394014334 986087601
1945 286 237720954 958374134
1212 502 139...

output:

1020766846606
1007002784804
999346872165
992274505754
985589793611
979434926460
973485015062
967649305774
961825435056
956057364162
950459867350
944914649107
939463540924
934278992727
929115619904
924079006080
919101029671
914194699920
909382255333
904589503356
899958668369
895331464064
890705684752...

result:

ok 2000 lines

Test #39:

score: 17
Accepted
time: 233ms
memory: 27404kb

input:

2000
1143 1229 81340832 203783547
797 1383 973573951 938965060
688 802 32619795 803180557
1430 1438 330664534 241372464
643 706 61158209 115993048
1648 106 327252353 597706939
1779 1415 293303361 360351419
692 1828 915132451 368048738
16 1709 95899611 285365876
1351 458 166747820 509256128
1727 793 ...

output:

998301212759
880537928692
870457219325
861252294892
852396337323
843981634800
835667290515
828477413156
821655401311
814870686928
808222533521
802024821337
796150817317
790387213402
784736669906
779359674398
774039179523
768840175047
763750052574
758953098983
754172321967
749445382638
744756930608
7...

result:

ok 2000 lines

Test #40:

score: 17
Accepted
time: 224ms
memory: 27260kb

input:

2000
287 975 25233696 534621398
1113 396 104395603 704259239
944 968 167901712 996060127
1820 1963 59027230 940778339
517 421 142414910 668774876
1194 987 697044445 916940725
758 1996 840435736 296316325
859 1228 942003242 410430124
267 1863 69640147 572953353
1531 664 675846017 437317470
1896 1937 ...

output:

979865969015
938524253268
919252073876
908446325642
898652991327
889092497390
880176982256
871653554541
863190891606
854923191298
846796123803
838968661922
831239262473
823590794453
815982441829
808439653715
800918039984
793492711274
786193390091
779078065331
771979068036
765125487688
758277507704
7...

result:

ok 2000 lines

Test #41:

score: 17
Accepted
time: 223ms
memory: 27320kb

input:

2000
151 987 401112 51743
1571 1615 48174 742492
1382 1435 702779 104242
4 1937 536648583 582006045
407 1292 690047 209913
18 74 609460 921874
1713 615 837107 163945
595 1110 736540 874700
104 296 336025 925055
436 1478 268683 619735
1303 213 353888 717230
238 1973 859805 102668
379 1922 238240 8461...

output:

253674247639
252146222576
251150950748
250159056506
249169328747
248179917829
247192247572
246207031683
245222508185
244239965485
243258799509
242277744406
241297414827
240317798683
239339147347
238360849518
237384439214
236408299310
235432280907
234457447152
233485340091
232513737287
231545110505
2...

result:

ok 2000 lines

Test #42:

score: 17
Accepted
time: 196ms
memory: 27276kb

input:

2000
1182 1921 605080443 886655033
1708 1921 595798016 843919086
1680 1921 860566020 131317035
975 1921 418114074 512317024
226 587 473765902 67634029
776 1921 433855395 216901660
495 1921 409271624 79315361
1921 149 936810062 509308613
132 1921 150894436 98571823
1529 1921 430693927 259969407
764 1...

output:

1009089197282
1006610361108
1004752344991
1002897699917
1001044344246
999213639830
997395170490
995584737424
993790322164
991996888755
990214477773
988434882351
986697111591
984984989073
983283340517
981585399308
979893311639
978212055868
976564068551
974938526236
973323760294
971712816971
970105147...

result:

ok 2000 lines

Test #43:

score: 17
Accepted
time: 184ms
memory: 27388kb

input:

2000
1464 1864 547333628 669063562
1110 745 632608125 908067725
1684 428 8923157 938458876
1765 1430 986598839 576426299
1927 1280 377814925 800077297
1161 731 430521772 265852180
1638 1725 909244690 745425182
111 1733 251904285 714544194
743 1824 285789564 35311843
1856 1602 316442646 397926101
214...

output:

985726096226
120339232724
118500847924
116729781772
115033477360
113477145230
112001745571
110529934958
109314993504
108147080886
106995756702
105956093186
104937429871
103931619182
102932846661
101934984607
100952729677
99971614132
98995604204
98028346026
97077956501
96128655790
95190898491
9425401...

result:

ok 2000 lines

Test #44:

score: 17
Accepted
time: 198ms
memory: 27300kb

input:

2000
1594 99 114938634 955551953
1594 535 724720583 787940175
941 1594 632758297 743357149
1594 360 540763785 555917064
1594 304 748278274 799266695
1594 352 264038818 900446954
1594 1913 669527592 537488989
1657 1594 183798298 397102870
1594 1275 186397916 822447484
1594 1982 333936723 32520282
333...

output:

985192149621
984143039445
983144785233
982146796921
981149821551
980152942601
979156406727
978161102895
977166217002
976171652235
975177196106
974184023009
973191204385
972198955355
971206748663
970214979896
969223519746
968232067678
967241269126
966250730842
965261103232
964271731653
963282385779
9...

result:

ok 2000 lines

Subtask #5:

score: 0
Time Limit Exceeded

Test #45:

score: 17
Accepted
time: 4ms
memory: 27060kb

input:

2
1 2 543195986 144983073
1
1

output:

144983073

result:

ok single line: '144983073'

Test #46:

score: 0
Time Limit Exceeded

input:

200000
73974 46059 151001152 42729969
112523 175399 580450366 914798605
65645 46109 848220487 698683602
63048 106502 596698349 144038980
98888 11174 948423025 972032422
115490 95315 788936645 231068151
5185 187319 690370465 616111588
10331 161483 606127487 195799307
133831 170948 694137989 490575964...

output:


result:


Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%