QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#255831 | #7750. Revenge on My Boss | ucup-team173# | WA | 32ms | 7072kb | C++17 | 1.3kb | 2023-11-18 17:14:55 | 2023-11-18 17:14:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define Mp make_pair
#define SZ(x) (int((x).size()))
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
void solve() {
int n;
cin >> n;
vector<array<ll, 5>> ve(n);
ll a = 0, b = 0;
for(int i = 0; i < n; i++) {
cin >> ve[i][0] >> ve[i][1] >> ve[i][2];
if(ve[i][0] < ve[i][1]) a += ve[i][0];
else b += ve[i][1];
ve[i][3] = i;
}
for(int i = 0; i < n; i++) {
ve[i][4] = (a + b + max(ve[i][0], ve[i][1])) * ve[i][2];
}
sort(ve.begin(), ve.end(), [&](auto a, auto b) {
auto [a1, b1, c1, id1, d1] = a;
auto [a2, b2, c2, id2, d2] = b;
ll ij = max(d1 + c1 * max(0ll, b2 - a2), d2 + c2 * max(0ll, a1 - b1));
ll ji = max(d1 + c1 * max(0ll, a2 - b2), d2 + c2 * max(0ll, b1 - a1));
return ij < ji;
});
for(auto i : ve) {
cout << i[3] + 1 << " ";
}
cout << "\n";
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int t = 1;
cin >> t;
while(t--) solve();
return 0;
}
/*
2
4
1 1 4
5 1 5
1 9 1
9 8 1
9
3 1 4
1 5 9
2 6 5
3 5 8
9 7 9
3 2 3
8 4 6
2 6 8
3 2 7
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3528kb
input:
2 4 1 1 4 5 1 5 1 9 1 9 8 1 9 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 8 3 2 7
output:
3 1 2 4 3 8 4 2 5 9 7 1 6
result:
ok correct
Test #2:
score: 0
Accepted
time: 30ms
memory: 7056kb
input:
1 100000 581297 102863 1 742857 42686 1 676710 233271 1 443055 491162 1 442056 28240 1 769277 331752 1 8608 369730 1 495112 525554 1 787449 938154 1 441186 850694 1 84267 925450 1 740811 32385 1 834021 37680 1 257878 564126 1 90618 914340 1 239641 463103 1 40687 343062 1 587737 458554 1 103684 48666...
output:
70717 6151 48237 28851 35679 19561 94252 73342 13089 34865 69194 82763 50242 22597 3745 24913 97923 53671 77581 47428 82224 93567 61401 50007 4886 54152 28731 91278 99937 6691 26840 6048 46204 66044 60735 44469 20513 45842 18701 46818 27203 9261 50507 8020 72391 54368 86201 18839 64763 61758 40939 3...
result:
ok correct
Test #3:
score: 0
Accepted
time: 29ms
memory: 7064kb
input:
1 99999 30245 831673 1 495617 185056 1 53028 422589 1 503558 778900 1 636981 480008 1 966864 78785 1 644954 303138 1 153080 225499 1 876411 832264 1 758904 549009 1 945000 441995 1 83780 789901 1 883282 832556 1 300776 548075 1 806599 108342 1 354979 831549 1 152110 819163 1 613891 812479 1 856259 6...
output:
42779 26176 16432 93736 36110 21022 69840 33300 88899 48735 24934 97468 58044 16598 54398 41611 25297 90410 54385 14754 38513 7374 40518 45724 3741 95478 36354 5270 92123 87433 5901 57489 42968 40570 60847 61715 65894 68944 27887 3727 38578 14748 15072 79314 41234 42830 79639 35429 60443 63782 12370...
result:
ok correct
Test #4:
score: 0
Accepted
time: 29ms
memory: 6996kb
input:
1 100000 361850 684411 2 188930 167748 2 676274 449963 1 970095 784305 1 412379 854673 1 208323 612179 1 296548 633970 1 560983 633064 2 848966 248363 2 741057 340814 1 393854 435721 2 302707 834494 1 229770 235051 2 875992 747523 2 314215 448795 1 531181 809914 2 786505 95721 1 86557 773136 1 44527...
output:
16321 7131 35939 39108 40409 52183 74664 70501 56736 85313 78033 67062 11374 28893 29910 76382 77675 16590 14329 99654 33902 81051 93812 47118 54934 27805 77685 57504 62353 47016 36321 65709 30222 17782 92966 93722 32969 69339 20699 31143 29231 20833 32593 17020 77014 2193 20753 96742 16406 11108 56...
result:
ok correct
Test #5:
score: 0
Accepted
time: 29ms
memory: 6988kb
input:
1 99999 810798 413222 2 974394 310117 1 987184 606577 2 30598 6635 1 607304 306441 1 438614 583404 1 932894 375890 1 994760 333009 2 937928 950984 2 58774 6426 1 287291 728073 1 421484 592009 1 470520 62631 1 918891 764176 2 997492 642796 1 679223 178361 2 865224 571822 2 112711 192469 1 165146 9387...
output:
38004 71563 34947 26525 22330 44909 47503 52297 78657 28797 29991 22680 7929 68438 15865 70932 27655 90081 30923 61265 20749 31006 35033 64820 20963 86257 21420 27746 3451 43480 36392 44360 16524 76128 8052 60705 72335 52826 82386 88960 8813 60213 12369 84977 96785 82723 23228 1372 34613 67012 54683...
result:
ok correct
Test #6:
score: 0
Accepted
time: 30ms
memory: 6884kb
input:
1 100000 142404 976360 1 924602 517001 3 610429 601247 2 529839 44745 3 606894 456914 2 488586 84093 1 360297 674019 1 435366 740573 3 943187 591275 3 8223 87831 2 703441 689095 1 673115 893499 3 817008 689318 2 237211 187815 1 472404 15953 2 822721 932534 2 275427 591484 3 393890 928933 1 11058 141...
output:
51206 37611 59015 50700 80703 52328 53240 43032 8346 8263 41296 64851 47024 78344 80432 99788 79216 80112 84718 81292 91031 58261 72331 98859 85353 71212 34320 28981 4231 54595 26732 77344 6558 79986 1230 64802 4053 35487 35001 47208 53390 6142 58146 9701 11407 53054 48744 52885 2922 93682 94826 636...
result:
ok correct
Test #7:
score: 0
Accepted
time: 29ms
memory: 6996kb
input:
1 99999 815544 929362 2 644659 659371 3 954043 790565 3 398854 42883 3 577627 875978 2 718877 831126 1 996643 640131 2 869143 249030 3 32149 261192 1 325941 753442 3 372686 238344 2 48789 426822 2 57757 260002 1 280109 237173 3 931489 242658 2 970763 300980 2 578337 100288 1 611532 282858 3 506737 2...
output:
27161 35747 25296 34165 9717 57726 57073 11785 24054 83782 88554 68057 42695 23849 49568 78850 8501 69293 52754 11183 39393 98733 35177 37567 85341 22705 9930 96866 82802 47796 9996 57550 29112 27373 52932 83741 39761 26412 12546 99295 22521 45367 72274 77249 22609 44764 11050 29507 28236 24580 4570...
result:
ok correct
Test #8:
score: 0
Accepted
time: 29ms
memory: 6996kb
input:
1 100000 179854 525204 1 403379 866255 3 544585 817939 4 832686 337889 3 577217 283347 1 960336 331815 3 424045 970964 1 309749 591186 4 37408 677291 2 308093 545247 1 45732 199365 1 267715 728311 2 404245 919393 4 855325 436620 1 406400 774600 3 146965 279345 3 955837 376846 3 860006 276218 2 28724...
output:
24436 23350 14823 6635 16186 28793 85545 28010 65377 49593 9096 36992 62631 55712 98568 36492 47289 43010 3738 84762 70128 48544 57069 75781 59468 17061 39547 97907 7290 48134 29862 84143 19385 42718 49107 41621 94075 30404 65165 61273 78021 98586 89053 17836 39470 53504 98341 37199 90866 20337 9343...
result:
ok correct
Test #9:
score: 0
Accepted
time: 26ms
memory: 6968kb
input:
1 99999 628802 478207 4 156140 784432 3 920902 198745 3 925893 336026 4 772142 702412 2 190627 335745 3 93095 937076 4 710822 356539 2 126370 604104 4 625811 243562 3 714977 524422 2 386493 485827 2 677699 522781 4 898224 453274 1 89677 777113 3 262303 647792 3 291451 852947 2 886160 662847 1 848327...
output:
25476 82833 20708 62196 65199 34417 31863 24519 6410 2660 86721 49138 41559 14233 14538 12861 77995 81983 14766 34516 89431 97096 88505 83091 38565 74389 94338 68659 85344 5885 21302 17145 57922 53773 76261 38160 50466 83035 84330 45236 77809 51690 49927 6715 43442 92483 55111 97458 84347 80388 4440...
result:
ok correct
Test #10:
score: 0
Accepted
time: 30ms
memory: 6924kb
input:
1 100000 993111 41344 2 849452 991316 3 287252 969223 4 392430 565624 3 547540 852885 3 240598 836434 5 520498 11013 2 151428 698695 1 98926 987499 3 607963 259559 2 131127 518148 5 638124 530420 3 991483 116764 5 440736 876913 1 564589 309054 1 438505 593453 5 701654 872609 4 391530 399311 5 628832...
output:
40304 73884 46665 34832 83244 13265 71577 34416 81702 34262 55470 14854 96718 20687 75463 16459 34149 34475 8088 30861 77981 72514 92859 39810 55233 80930 35735 85535 89142 73204 61946 48999 88803 32652 61389 33091 39964 64315 41786 22045 69345 85883 21081 60246 54103 75958 66900 11113 17122 41787 3...
result:
ok correct
Test #11:
score: 0
Accepted
time: 25ms
memory: 6996kb
input:
1 99999 633547 770155 1 634916 133686 5 855058 382733 4 485637 596466 2 742466 271949 3 470889 583467 1 156844 977125 2 585205 464048 5 187887 690121 3 892977 925171 2 57268 34693 4 981093 255232 2 232232 977047 5 516338 893566 4 247866 311567 3 586547 994603 5 4565 348710 5 417684 977428 3 124510 7...
output:
48240 97152 38149 92052 85126 48738 420 86878 1608 77274 25520 16300 85538 61415 87215 9020 23040 6708 82083 15814 66859 99499 16595 23692 38022 28113 27468 68026 15427 8746 33174 14077 72913 80575 26563 66510 41324 17717 35068 39018 73663 45534 19933 82609 30013 16591 13958 58164 4681 66871 61356 1...
result:
ok correct
Test #12:
score: 0
Accepted
time: 29ms
memory: 7060kb
input:
1 100000 997857 590189 5 552421 307866 1 221408 153211 4 952174 826064 4 742055 646614 4 712348 116860 2 808438 307957 5 250004 806205 1 193147 297708 2 875130 941168 5 473418 995714 5 975828 556721 3 578721 379543 1 834658 317206 4 722778 876212 3 730045 972968 6 414768 657972 1 633455 746596 6 970...
output:
58367 96255 27046 51517 62990 14996 43792 8080 70637 88785 56968 29155 30934 51774 59548 29427 90925 70372 58953 41857 33191 96145 17321 23404 87318 1596 46324 13075 9593 11090 26264 56726 77126 83979 64736 94161 65026 25548 5002 62346 36677 33190 44945 17805 87787 14720 15278 41786 55909 91963 1146...
result:
ok correct
Test #13:
score: 0
Accepted
time: 29ms
memory: 6996kb
input:
1 99999 414101 318999 4 305181 450235 4 789213 599425 5 12677 889610 6 936981 98382 2 942639 831190 3 444784 241365 4 683780 538854 3 314812 329 6 192848 447995 3 142664 320771 6 384205 90044 2 595278 174418 6 877557 109667 2 181863 102918 3 910791 341415 2 526191 134073 2 659609 133225 3 690293 561...
output:
35478 18624 78085 84422 64480 8449 51230 4571 89366 63494 34463 41028 36180 21314 30197 81273 40400 69808 42147 3988 98521 2452 13595 43642 69108 39646 93137 95922 39452 1217 10651 80682 35534 34784 49882 14755 73947 23645 38923 95063 30177 52114 49164 98219 208 98408 5373 71603 93716 11385 60484 18...
result:
ok correct
Test #14:
score: 0
Accepted
time: 25ms
memory: 6892kb
input:
1 100000 778411 171737 3 31198 657119 3 155563 369903 1 511917 119207 6 679674 248855 4 992610 588775 5 872187 572198 6 91683 913714 4 254664 416428 3 175000 463992 3 815710 281793 4 603132 358830 2 165958 576913 2 420069 533307 7 656775 410667 2 278481 287076 5 160586 153734 2 164979 126586 2 27930...
output:
10495 78296 86975 66984 43573 26013 68012 28684 21728 84715 73054 55225 80985 71471 19208 75959 3227 49197 78757 51517 90370 45175 30815 33044 22612 38359 10155 50081 38746 20159 29238 80523 64318 24082 8081 80300 49009 47185 51927 50099 81484 31393 93483 48777 27137 18152 11576 10916 63727 96750 55...
result:
ok correct
Test #15:
score: 0
Accepted
time: 22ms
memory: 6912kb
input:
1 99999 451551 900548 5 783958 575297 1 756073 750709 5 605124 150049 5 907304 667919 2 190198 335808 4 508533 538310 7 525460 422171 6 409034 310537 1 268526 129603 1 484955 798337 5 946101 116345 4 215220 404493 1 495671 549960 7 340051 637372 6 169627 688226 2 206600 629835 3 191133 480511 4 3188...
output:
54269 84814 11203 22266 69715 2067 98594 58686 77120 97588 24647 22779 41418 74818 11208 77299 68401 83198 48458 83840 10016 73446 1390 25559 11910 57243 94269 68865 21808 3045 36095 77465 14015 56072 4637 32888 22833 39225 85587 87637 73770 70840 9918 92119 76820 76804 18268 93252 20843 97020 35269...
result:
ok correct
Test #16:
score: 0
Accepted
time: 22ms
memory: 6904kb
input:
1 100000 783156 687878 1 477270 782181 2 122423 521187 1 814765 379647 8 906893 42584 3 464361 836497 8 935935 677655 6 966066 829735 7 348885 726636 6 474870 178304 5 901105 792063 5 940836 193643 7 785900 806988 3 38183 973599 4 814963 945121 3 570021 666591 6 840996 939097 7 406903 216975 2 62090...
output:
72039 60446 79913 606 67084 74974 38540 46212 13925 18473 33329 54770 80078 8805 94531 69295 94929 82414 11017 59740 69274 52094 98394 64031 74594 3026 65376 40859 93220 16215 56539 99398 84080 23209 38748 2719 88190 13990 91697 28371 94299 21350 58000 46528 27 406 68868 13024 13756 32181 12213 6526...
result:
ok correct
Test #17:
score: 0
Accepted
time: 29ms
memory: 7072kb
input:
1 99999 45362 965532 6 708808 306508 2 624384 151389 1 467716 670928 1 39438 96594 5 942210 88149 7 892926 875304 8 241522 637190 1 564772 772170 8 835563 334036 7 104129 627390 5 911109 785971 7 389695 864643 9 475004 239058 3 432237 738985 3 818115 349146 8 665532 910961 8 964582 950889 9 682361 7...
output:
17464 54738 19792 69939 35189 77452 89261 55631 50252 91841 70330 4005 64528 98810 51735 25631 44169 2070 89979 41652 86742 62362 45691 29466 82233 78136 91194 51184 6693 82962 21064 93923 22440 83984 47051 39021 91148 97090 43528 17339 33500 58672 69501 561 7869 9766 74630 46576 40530 51413 7570 62...
result:
ok correct
Test #18:
score: 0
Accepted
time: 22ms
memory: 7064kb
input:
1 100000 545343 214678 2 896330 34297 10 225650 145117 5 3539 141992 10 866014 337066 4 787360 33077 10 990193 565400 7 746446 687990 6 657093 370479 9 221001 777823 3 818490 795673 2 891597 771810 3 322069 291555 3 680477 429062 4 131032 471991 3 498884 709254 9 4962 615960 7 537100 173421 1 166345...
output:
47267 41095 99945 82746 72235 4514 7505 33683 57213 5896 21646 65793 2233 37477 35903 26024 55083 75580 81907 2157 93532 35053 37297 29849 58079 67046 3739 68803 90621 34886 53352 54246 56947 73238 88362 25725 54684 92792 65858 7259 30656 70002 31250 66964 37747 13385 86380 82236 46760 47662 82866 1...
result:
ok correct
Test #19:
score: 0
Accepted
time: 30ms
memory: 6912kb
input:
1 99999 336110 764075 4 762927 765956 4 275286 70789 5 459972 469529 7 870966 316414 7 498229 41636 11 830500 307315 6 854475 488251 5 759873 905341 5 993842 970385 9 217019 809676 12 207189 933113 4 625602 520131 7 736635 340574 11 921162 795091 6 552353 769663 10 406594 84507 8 465432 768495 3 892...
output:
39708 59543 43462 38768 62809 86685 85130 49266 10175 30405 5060 45395 16901 19161 77253 78326 74569 15283 81622 25091 32911 13276 24367 31315 53191 86779 19835 56034 94131 84931 2385 7006 43089 26503 35302 20787 17665 96835 31205 81685 18723 58976 78156 39068 12414 83152 77700 16443 27841 74989 144...
result:
ok correct
Test #20:
score: 0
Accepted
time: 26ms
memory: 7000kb
input:
1 100000 108561 606864 17 350323 824178 19 354491 276661 2 386504 972995 8 126712 330871 13 27512 558033 16 821693 489290 10 531173 946706 11 851074 696984 13 215023 489278 3 550601 849390 9 18144 714207 18 493423 166694 1 682070 122973 15 480819 38485 4 803701 169413 20 175493 785397 12 948045 5586...
output:
75830 42942 27955 67628 18688 75983 38085 55857 99543 58665 84286 98998 62210 79210 59646 20199 18423 96728 65122 77421 90405 52319 32112 50628 76760 47925 52882 92378 23843 58452 908 20803 85457 44246 89707 12492 61643 74369 62071 90435 5029 72372 58509 36921 3618 49681 66178 35530 49608 3543 52130...
result:
ok correct
Test #21:
score: 0
Accepted
time: 26ms
memory: 6924kb
input:
1 99999 270178 61120 9 118244 697562 5 796784 638127 10 716782 572441 25 868171 877138 2 451141 273737 29 917860 184163 26 669039 916520 30 900920 422991 7 772136 494308 18 675065 814143 30 968370 228164 17 447803 120035 26 195744 975315 19 310881 998911 19 512798 212819 4 789254 622264 22 984709 59...
output:
40137 5954 84879 13698 97786 83795 24220 24459 79395 99256 72457 96580 64413 25163 69801 34854 83596 7423 90706 88839 38803 16892 91637 19046 79416 30020 78757 9334 4192 86062 72933 27990 51333 17602 33609 75946 32500 4186 51747 2025 96710 94070 92015 66672 69739 24229 51979 45692 29176 34656 33789 ...
result:
ok correct
Test #22:
score: 0
Accepted
time: 30ms
memory: 6892kb
input:
1 100000 87815 816125 15 712301 586652 26 997911 895483 38 726884 50324 43 427717 312286 28 196351 258982 19 474976 452448 13 371565 914341 28 848695 643798 25 229795 39321 27 129910 753647 6 206296 219095 38 680062 142384 26 752256 980514 31 628293 803374 32 592071 806785 7 70061 583309 35 732498 3...
output:
91856 68167 54045 70962 56607 12074 19415 40950 56580 27223 78432 86849 52217 24146 93734 46920 62508 941 99732 23778 20805 44874 15261 84221 86023 27614 78728 28278 34192 54860 54949 76596 80771 70120 85957 75815 52991 22237 20514 80807 57607 81299 31493 61250 55697 68579 46442 13520 88697 44615 28...
result:
ok correct
Test #23:
score: 0
Accepted
time: 30ms
memory: 6996kb
input:
1 99999 969047 371 41 853468 252554 79 784554 756858 19 945912 189669 56 28679 367615 21 745635 438170 93 394681 487499 76 986024 222074 12 796761 902579 3 934082 772826 5 848868 475664 57 928859 487080 17 447261 415165 48 324804 77833 94 513254 520849 43 811124 531448 22 414298 235550 92 662853 204...
output:
41617 69476 22349 42877 49036 44100 55797 47684 17642 61367 21015 5928 60421 94902 63629 51537 41225 92090 1341 55407 50764 79386 92827 39635 76780 44973 55189 84540 3426 94028 19108 64882 30657 14953 75080 41940 44855 39038 39158 30651 22540 80746 57236 52623 38781 39532 83418 57354 45600 31028 303...
result:
ok correct
Test #24:
score: 0
Accepted
time: 27ms
memory: 6880kb
input:
1 100000 14578 331976 83 739173 945866 58 769064 123208 197 657914 688910 162 63712 334500 95 112850 488141 182 673605 139094 109 8038 662680 177 139883 875134 102 240255 754978 10 139120 891814 83 967220 706007 107 811284 728949 43 749285 653050 130 42454 995761 196 897079 899138 87 585743 869946 6...
output:
90508 94750 27222 98260 80046 51121 56997 85539 55322 91100 17379 96156 22969 13531 10457 30621 86229 18277 36510 92827 55960 30867 58396 33774 91809 70195 11030 79401 31090 94637 24041 81483 46426 40803 23017 89624 18025 61078 92413 91500 55935 81594 3394 31037 49079 38664 15546 25652 88003 60915 2...
result:
ok correct
Test #25:
score: 0
Accepted
time: 30ms
memory: 6980kb
input:
1 99999 776558 379481 222 389786 326445 297 33988 301992 167 922081 171748 27 44539 631883 366 435819 942194 271 728896 223581 455 306860 878391 458 944588 214055 460 459371 939603 266 655301 555228 355 491970 417096 153 318104 764115 348 829143 260691 86 14484 737924 368 508188 763016 368 738889 88...
output:
51087 24925 9188 80737 75625 49059 13150 17689 4942 14937 41090 15393 54230 7347 65007 36235 81067 31749 80027 45190 50983 32941 45815 3118 77029 47944 18060 87580 39178 10109 71391 12284 54426 78322 56688 36466 29023 50964 8976 4073 50273 63636 83987 96474 46305 27725 98185 36169 13266 69800 99536 ...
result:
ok correct
Test #26:
score: 0
Accepted
time: 30ms
memory: 6988kb
input:
1 100000 953776 515469 53 574495 620563 408 331343 705288 552 307179 689650 745 108389 820839 791 831194 34474 881 928795 832739 27 162288 848143 103 438197 683261 522 872355 234923 123 275412 349154 731 403641 327600 231 642668 821247 651 639908 457535 877 184578 621090 792 483486 866841 827 382761...
output:
4481 77517 55861 82021 91171 10278 91599 22352 62997 88175 21543 95213 3653 42138 64829 7098 69951 46439 75512 4374 40173 11528 80373 6310 21548 60450 68611 88084 12345 94012 90077 19911 83423 13985 384 69712 88308 69715 52689 60124 14250 17160 25248 66750 17052 98894 79338 69625 79851 25187 18434 6...
result:
ok correct
Test #27:
score: 0
Accepted
time: 27ms
memory: 6988kb
input:
1 99999 128495 399445 763 873699 750462 2051 771645 791001 3841 668391 425718 3815 274257 54791 3769 572299 402750 3749 622972 357997 1273 354814 50592 1657 409819 763434 3342 941450 774102 2301 705607 604543 3333 441889 400571 2267 563457 738075 3090 751849 8690 1656 524888 757409 1699 294794 33160...
output:
59747 83810 55200 87084 45820 27249 44444 80277 96910 44267 49337 46391 99077 43308 29471 90913 8622 86230 91783 97679 64912 29568 86567 17657 78874 60441 82493 24132 64950 69905 46445 71561 84500 76107 90240 62907 12272 3753 71573 31014 33888 16842 93642 26316 90084 8250 68748 61042 85844 99123 620...
result:
ok correct
Test #28:
score: 0
Accepted
time: 27ms
memory: 6996kb
input:
1 100000 722958 355226 2094 266625 467230 8712 979360 944520 2487 295170 735423 2727 722419 313725 3199 789942 961946 9194 700692 559861 7780 649116 795879 2218 690710 741191 3253 493019 510759 8703 230105 693648 3581 776356 568494 6123 384478 553056 8000 262437 617457 2646 944585 4132 9669 239024 3...
output:
84561 1956 1921 79444 50520 20450 55307 96079 67301 91853 61420 42651 21163 9444 12373 97592 96096 9322 30475 72842 19132 28577 77890 87950 81719 17283 87180 80783 12157 69705 36917 92110 732 31518 1661 23690 41130 51353 23548 12879 43835 82974 26007 73034 12545 28964 2061 39954 9803 17593 70166 771...
result:
ok correct
Test #29:
score: 0
Accepted
time: 32ms
memory: 6968kb
input:
1 99999 846662 746684 27049 416087 114018 39556 827768 480922 19619 538880 640896 35309 974134 999365 37801 462745 682933 806 606482 571441 8720 401083 408557 32312 797890 970757 39099 378069 473292 33198 452952 185965 42390 524236 671077 29109 746622 849987 48916 692368 638905 26915 476085 504542 1...
output:
70482 21335 15461 85424 95385 20665 79381 30388 13895 84891 10841 46253 66878 65901 4704 84176 95878 60820 19212 9508 47085 49421 65239 42175 77219 59780 34249 44035 30352 69531 39889 74948 23900 72251 28815 16749 47511 75309 90877 43450 1233 65449 3744 80227 13231 82141 27093 80311 14857 18607 2357...
result:
ok correct
Test #30:
score: 0
Accepted
time: 27ms
memory: 6980kb
input:
1 100000 971466 923902 13036 178471 298728 9482 405999 2470 22915 603996 25994 53211 456448 30511 11349 18316 78308 17277 863127 738636 42069 857249 263985 26256 617839 464366 58305 395945 918980 28518 969530 806076 36316 806039 806940 96509 282118 141847 56048 595896 449670 41054 190736 674636 4589...
output:
52506 79478 72234 34784 78527 65246 66044 77266 36995 15855 54295 24323 33391 4024 18544 5012 31294 72670 71248 82034 2670 59414 49034 62029 39641 35240 32621 82721 49330 90317 80489 82149 8302 36103 64680 31501 65040 27993 32181 22362 15627 16900 59686 76249 27378 54603 14251 49191 83851 46411 3544...
result:
ok correct
Test #31:
score: 0
Accepted
time: 32ms
memory: 6892kb
input:
1 99999 932826 868158 836741 757509 147472 90812 420972 457136 757627 569138 433050 395584 828836 391573 506718 940415 3167 875552 397212 243182 713853 389349 453435 165834 612841 415193 497972 43233 799293 174303 652096 485581 690886 929649 7236 344171 963593 933013 38136 677458 266199 985380 12930...
output:
29923 69067 45530 56085 46407 77118 597 22067 59156 31824 27915 47967 86140 85811 92426 58101 52397 22833 31888 69838 2615 80882 52064 54673 61865 35466 30058 74909 22248 34503 86002 76331 56364 63474 58775 58189 51899 12053 29273 63262 42405 61959 10658 1623 38992 93935 35496 61801 50078 76216 3979...
result:
ok correct
Test #32:
score: 0
Accepted
time: 20ms
memory: 6988kb
input:
1 100000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 1000000 100...
output:
66663 66675 66674 66673 66672 66671 66670 66669 66668 66667 66666 66665 66664 66676 66662 66661 66660 66659 66658 66657 66656 66655 66654 66653 66652 66688 66699 66698 66697 66696 66695 66694 66693 66692 66691 66690 66689 66651 66687 66686 66685 66684 66683 66682 66681 66680 66679 66678 66677 66614 ...
result:
ok correct
Test #33:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1 10 2 10 1 8 10 6 4 4 9 6 7 5 5 6 4 7 10 9 7 7 7 4 9 6 4 5 7 1 1 7
output:
1 5 4 8 2 9 3 6 7 10
result:
ok correct
Test #34:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1 10 485566 661308 221125 602000 2 6 714165 6 3 7 596643 587186 7 985484 2 197190 2 2 7027 8 5 10 5 8 621058 1 688117 10 633379 164945
output:
5 10 1 4 9 8 2 7 3 6
result:
ok correct
Test #35:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
1 500 229 232 88 36 27 60 158 1 343 356 247 333 440 3 271 420 78 50 181 212 302 384 444 209 284 184 393 416 482 51 242 373 331 355 470 251 382 151 262 206 32 237 483 310 124 275 93 258 212 154 247 379 62 28 456 185 159 454 82 476 168 46 144 17 312 499 10 77 276 339 173 69 330 373 17 256 448 498 223 ...
output:
31 230 131 33 326 378 185 461 86 25 27 69 166 436 275 202 355 445 191 119 103 244 39 37 468 313 170 344 41 10 499 227 489 307 29 151 208 333 405 129 469 141 430 480 89 187 234 441 353 61 1 146 303 374 472 490 54 390 335 368 94 411 373 53 198 159 348 241 487 97 150 109 140 433 62 105 494 210 178 497 ...
result:
ok correct
Test #36:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 500 20004 38 372 100 16 181 149374 35468 294245 126267 486 452 286 412 200 747456 213887 767656 117 847144 226 308111 342 520765 304 80 110121 49258 561097 546419 63074 509481 733960 126 775895 373701 339 365928 385 30 199 318 134197 411 103412 5333 220 336 87 489 25508 166200 987909 511327 476 35...
output:
238 227 198 209 353 440 429 299 340 464 237 326 412 182 499 491 207 496 428 93 320 329 277 111 301 63 53 336 375 281 432 335 26 163 376 403 144 406 32 389 226 303 318 51 473 33 214 70 188 399 5 358 7 77 356 122 383 407 91 72 99 465 365 487 341 445 309 282 181 421 151 219 478 316 180 241 97 236 128 2...
result:
ok correct
Test #37:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 1 1 1 1
output:
1
result:
ok correct
Test #38:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1 1 796328 1 719733
output:
1
result:
ok correct
Test #39:
score: 0
Accepted
time: 30ms
memory: 6996kb
input:
1 100000 61850 84411 46680 88930 67748 47416 76274 49963 99253 70095 84305 34027 12379 54673 14197 8323 12179 31657 96548 33970 69265 60983 33064 76580 48966 48363 63608 41057 40814 26167 93854 35721 27144 2707 34494 18821 29770 35051 54832 75992 47523 9044 14215 48795 25989 31181 9914 69544 86505 9...
output:
7549 33053 37908 46813 18895 44641 81944 92325 55087 98532 20790 39937 1297 10405 51616 98196 51933 29106 29738 51039 33985 81967 92294 96105 95768 43823 52075 34846 48772 52010 48619 85978 39958 38637 50896 47989 30137 45221 4141 88670 3902 85122 22345 22848 87671 50166 24834 75266 40592 76101 4975...
result:
ok correct
Test #40:
score: 0
Accepted
time: 32ms
memory: 6876kb
input:
1 100000 924602 76894 76360 529839 605505 1247 488586 3766 456914 435366 724358 674019 8223 142516 591275 673115 962254 689095 237211 66450 89318 22721 63332 15953 393890 854351 591484 17037 15993 141132 11900 8268 23752 2906 528321 54437 93877 9808 79501 959623 40054 54992 86687 65830 886221 160821...
output:
12335 92245 60547 4405 30790 34394 39818 73444 89849 8833 5549 21464 70585 39531 63678 23364 2948 76571 58867 27058 95278 30507 87024 80202 13539 88143 32610 3012 23044 79798 56251 25952 4415 3906 40905 27544 48810 93292 18654 23995 49808 17603 42485 54252 18602 80995 8233 69325 72871 88714 35977 51...
result:
ok correct
Test #41:
score: 0
Accepted
time: 23ms
memory: 5924kb
input:
2 69821 88401 742421 1 794466 913634 1 103831 780090 1 194366 83442 1 891069 901851 1 14782 827286 1 629158 268122 1 511572 261569 1 64650 726005 1 435161 580063 1 108579 365076 1 257108 490883 1 723162 813583 1 816841 933459 1 333041 428483 1 211846 962418 1 723314 157335 1 837290 54766 1 138584 58...
output:
39242 24912 37635 12878 58141 37503 57255 52102 26851 42115 13266 26543 48086 7772 68038 16815 50533 10858 53523 21194 42401 35354 23612 51845 27618 26397 34164 4171 58980 58034 68116 26091 55364 15974 33614 67378 34316 7021 45547 6835 34366 28136 44038 55376 14109 65357 34978 26523 69443 53668 2335...
result:
ok correct
Test #42:
score: 0
Accepted
time: 23ms
memory: 3696kb
input:
300 253 830133 947891 1 363214 158400 1 678623 525243 1 557424 435477 1 140409 99787 1 957753 183966 1 626409 249098 1 710920 607523 1 15679 17828 1 876419 80539 1 167749 400048 1 269258 222458 1 150536 140001 1 666204 606142 1 46951 206706 1 655815 806710 1 258588 306955 1 735893 932947 1 841224 14...
output:
180 9 159 174 58 135 68 67 164 240 111 225 15 179 32 224 153 23 194 186 108 119 70 199 253 243 242 223 109 237 53 244 38 72 104 140 247 234 229 11 125 115 35 129 122 86 69 137 178 219 142 65 249 50 207 105 128 60 17 27 56 75 91 200 37 235 107 166 28 124 29 59 123 103 126 221 98 155 156 136 187 154 1...
result:
ok correct
Test #43:
score: 0
Accepted
time: 21ms
memory: 3804kb
input:
10000 1 425023 723812 1 13 836095 863384 1 233225 596397 1 566137 236643 1 268085 280508 1 223291 393445 1 809612 382630 1 151088 862073 1 173393 927632 1 17049 195961 1 677649 745628 1 36991 667660 1 298669 836826 1 362975 372403 1 1 963621 249133 1 6 3536 279568 1 587752 487419 1 83384 748663 1 58...
output:
1 9 11 7 8 5 2 4 12 13 10 1 6 3 1 1 3 4 6 2 5 7 4 1 2 6 5 8 3 9 1 1 2 3 4 6 5 7 6 1 5 3 2 4 12 19 8 18 16 14 11 5 1 15 20 2 9 23 6 17 10 13 7 4 3 24 21 22 8 5 11 4 6 9 7 2 12 3 10 1 8 25 16 9 15 17 18 10 21 6 7 4 11 14 12 13 2 3 23 1 5 24 19 22 20 8 7 2 11 3 13 10 9 6 5 4 1 12 9 7 4 1 8 ...
result:
ok correct
Test #44:
score: 0
Accepted
time: 13ms
memory: 4604kb
input:
2 4037 464131 318220 1 90991 541050 2 766311 591558 1 742307 17787 1 781261 488145 1 357957 347184 1 633182 301261 1 94682 843291 1 631637 529027 2 82521 704473 1 437456 276755 2 778263 51432 1 786584 977440 1 833333 648570 1 552303 601466 2 938184 44857 1 794073 277387 1 994953 290395 1 935853 1864...
output:
1837 2352 3405 1674 1491 2947 3658 3510 970 613 1675 2265 3123 3559 1733 1895 1260 403 2051 3019 2949 3286 3872 3197 2882 902 2199 2556 1205 2038 3507 1507 2924 3147 3226 2300 2133 3525 81 2614 1488 3984 1662 2460 2448 3737 2027 2826 251 1556 846 456 836 1376 3424 2754 3858 1174 212 683 2993 2541 25...
result:
ok correct
Test #45:
score: 0
Accepted
time: 19ms
memory: 3636kb
input:
300 134 36059 286818 2 455971 795720 2 74275 63495 1 75077 509010 2 503679 169175 2 11185 421244 1 437281 322883 2 869878 384461 1 191807 672570 1 288040 312855 1 660008 723414 2 221648 416391 2 624391 145096 1 411858 695660 1 578102 665090 2 890142 668549 1 608518 448483 2 113307 706064 1 283662 63...
output:
36 6 29 79 84 133 127 98 112 97 18 92 9 67 91 24 104 109 28 87 43 25 19 10 89 62 90 23 71 32 14 123 50 110 117 99 40 113 77 45 64 1 63 80 4 22 41 132 122 12 54 129 68 108 78 102 61 72 33 128 55 2 70 15 107 101 11 52 31 38 37 88 51 103 131 121 130 17 76 111 56 39 60 114 134 7 94 57 48 65 46 105 5 74 ...
result:
ok correct
Test #46:
score: 0
Accepted
time: 21ms
memory: 3636kb
input:
10000 2 525139 532331 2 923628 228718 1 6 234983 515915 1 705263 115904 2 902643 575572 1 90796 310572 1 191007 876742 1 926631 224132 2 1 363621 733700 1 16 617390 281024 2 354701 28586 2 902129 562488 1 711461 107434 1 714910 223331 2 835971 497838 1 118657 220815 2 375999 800233 1 180250 455648 2...
output:
1 2 4 5 1 6 2 3 1 8 7 9 10 12 16 15 1 5 11 2 14 3 6 13 4 5 4 2 1 3 1 1 5 4 3 2 8 5 6 3 7 1 4 9 2 1 1 2 14 12 3 11 6 15 13 10 5 1 4 7 9 8 2 2 1 5 27 20 25 4 8 22 6 1 17 12 19 14 13 2 23 7 21 18 10 16 26 9 11 24 3 15 12 1 4 9 11 3 5 7 10 6 2 8 13 2 1 27 11 23 26 13 10 12 17 6 2 15 28 3 ...
result:
ok correct
Test #47:
score: 0
Accepted
time: 1ms
memory: 3884kb
input:
2 1389 643295 305353 1 17366 456325 2 596129 942726 1 830936 621567 2 604681 76325 1 774761 275083 3 176002 127294 2 580914 456741 3 634013 437706 1 24737 134880 1 556648 720413 2 801133 640387 2 9231 991784 3 966796 684261 1 847283 768303 2 804657 879431 2 288649 139591 3 511819 701938 1 27061 5639...
output:
941 848 327 992 790 74 831 476 10 986 833 393 79 350 329 57 702 517 1158 1031 507 415 565 388 1037 829 1367 1081 1334 908 580 201 976 610 1001 1010 267 581 261 377 748 396 1149 532 974 167 1200 792 1094 1084 331 504 743 1109 1114 1199 575 1363 45 843 1101 191 1314 1184 818 1299 1389 284 1110 1384 10...
result:
ok correct
Test #48:
score: 0
Accepted
time: 17ms
memory: 3684kb
input:
300 251 789119 100187 2 697580 571877 2 686584 10582 2 418190 372990 2 788026 231797 3 985515 398910 3 237323 766683 2 364345 244638 2 629965 746778 3 442153 340088 3 998666 429796 1 755218 985359 3 840002 539125 1 373406 54563 3 638707 859838 2 656500 817395 3 899880 742356 1 90021 71315 1 883077 9...
output:
37 72 56 88 228 174 153 157 182 152 84 248 124 90 138 169 205 194 125 188 67 139 166 158 40 232 61 47 227 28 207 131 164 192 167 224 57 163 210 70 136 183 225 206 104 202 200 178 244 51 215 196 114 180 82 243 62 191 7 193 208 234 217 23 121 24 133 60 148 122 218 25 102 115 176 238 111 63 15 26 128 8...
result:
ok correct
Test #49:
score: 0
Accepted
time: 17ms
memory: 3548kb
input:
10000 9 340849 332736 2 337156 473580 3 725034 883073 1 219356 12503 2 936044 549719 3 227698 971858 2 370855 568407 1 618895 291761 2 507065 78488 2 8 333383 660664 1 344247 932637 3 200420 429670 2 536827 573382 1 106963 127237 2 713838 866936 2 162062 279088 1 145752 929994 1 4 905737 522662 1 53...
output:
7 3 6 2 5 1 8 9 4 8 7 1 4 5 3 6 2 4 3 2 1 1 3 5 4 6 2 7 5 10 13 1 6 3 4 16 2 9 15 7 11 8 12 14 1 2 3 1 2 1 1 3 2 1 3 4 2 5 3 2 10 5 1 8 13 4 12 7 6 14 11 15 9 3 2 1 4 2 1 27 28 14 19 13 2 25 23 16 5 15 4 29 24 21 8 10 7 31 30 1 17 20 32 26 11 9 18 12 22 6 3 1 7 2 6 8 10 14 12 3 11 5 13...
result:
ok correct
Test #50:
score: 0
Accepted
time: 17ms
memory: 5528kb
input:
2 2795 297292 539767 8 734875 511215 9 667232 536489 8 634005 856493 3 580380 622144 4 581010 98539 9 919508 825607 6 524199 860110 5 802059 591467 8 885913 685100 5 565378 910253 9 490311 943067 1 567041 155343 7 328533 943487 1 154277 487096 1 812892 214739 10 113962 103658 5 687184 187384 6 83481...
output:
2341 233 2265 2025 827 1528 2231 1479 1452 1150 1551 1297 1834 2154 464 1913 1665 1794 628 552 1357 819 940 2021 1304 1682 927 2637 2277 1346 2180 807 560 1608 2148 1589 53 1456 469 2788 426 387 1969 15 2634 2215 1985 51 596 2632 1650 680 1954 930 1200 2123 803 1050 2502 711 2471 355 1374 2410 1473 ...
result:
ok correct
Test #51:
score: 0
Accepted
time: 23ms
memory: 3676kb
input:
300 313 181024 742572 1 847307 106677 9 375980 457310 10 944809 442603 4 570686 894299 8 124371 282741 6 44756 196447 1 312495 303886 8 855637 365548 2 972108 981965 9 657516 19589 9 184806 920191 8 29602 361256 6 752410 616901 2 758651 50575 9 571691 387695 5 601171 137962 8 707125 753434 5 644216 ...
output:
72 7 57 303 29 126 189 230 75 1 89 70 231 255 257 107 109 247 171 311 203 227 282 280 232 62 179 24 211 252 295 173 144 243 234 122 276 146 129 291 313 195 74 130 221 120 167 265 65 26 244 250 259 88 68 206 116 103 228 289 21 51 49 172 220 43 263 156 269 308 90 48 182 164 246 213 236 18 28 135 169 1...
result:
ok correct
Test #52:
score: -100
Wrong Answer
time: 21ms
memory: 3632kb
input:
10000 17 780658 578371 3 47635 686616 8 318753 263312 2 655616 417338 1 224671 828602 9 230974 643576 4 874831 202616 2 177657 47352 1 619169 180834 6 337414 98608 8 14938 561758 2 190162 790130 8 422120 130445 3 907851 740409 5 310886 389878 7 659021 276403 7 973677 834994 7 11 229775 712783 3 6087...
output:
11 6 15 2 12 5 10 17 16 9 14 1 13 3 7 4 8 1 3 10 4 5 8 11 6 7 2 9 4 5 3 7 1 2 6 7 9 5 18 22 4 15 24 1 13 17 23 19 6 14 12 21 20 3 8 10 11 16 2 8 4 1 7 3 2 9 5 6 1 4 2 1 5 6 7 3 14 31 11 25 13 4 29 10 15 12 7 23 24 20 28 17 32 33 3 16 6 18 1 9 21 26 8 19 30 27 2 5 22 1 1 2 7 4 3 6 5 12 11 1...
result:
wrong answer Wrong Answer on Case#144