CT21826

Herald's Obsidian Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the coastal hub of Tidewater as Herald unrolls the day's manifest of weights. The tally will decide the next shipment. Task: Sort the array by absolute value ascending; for equal |x|, the smaller value comes first. Print the sorted array. Input format: First line: n. Second line: n integers. Output format: Print the sorted values space-separated. Constraints: 1 <= n <= 734; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 468 773926293 409476529 285036286 256438522 887418858 262822341 609366794 414782986 485353378 581932675 754364383 392683474 484399355 616672989 230297369 660252108 156541003 762234876 848806581 572270154 2940966 98392142 228441132 26998794 584120776 897389232 779806844 118274719 484079988 307163865 343610769 736747754 15870523 618212106 824921075 247211825 812969785 395863918 776402162 120008848 547539346 625502662 590322805 429777594 924364100 543979826 318291465 625755932 161210512 988298699 154632130 979010645 875840625 325819247 923921262 790267151 49026394 95196253 459535897 454165100 728734742 140013609 583181433 492103302 6742320 572716602 992205520 840178341 64994894 998117890 825657976 428697985 807934812 520147164 294614072 850055213 715562458 687206886 709254605 584095062 232186…
Output: -133499 2940966 6742320 7254914 15870523 21998762 23491022 24378175 26998794 31664505 40263919 42679187 44657274 46755171 48639514 49026394 49403459 50085068 50913978 53239289 54635544 54809676 56599854 57107564 58169969 64994894 67139008 68105245 70016012 70686719 71152811 75965603 76384479 77398010 82903708 83828534 86514395 87036835 88812863 90581867 91026428 91424149 93293618 93591495 95196253 98392142 99430390 100646300 101278962 101880086 103250751 105651547 109327069 110805349 112705892 113071133 115233961 116487581 117030761 117890047 118274719 120008848 123531562 127419043 128218312 134203948 136437913 138149522 140013609 140963894 141397558 144108689 144843762 145244552 147865623 151470784 152155722 153638641 154564074 154632130 155034852 156541003 159143790 160812227 161210512 1…

Example 2:

Input: 154 471858802 331653694 369857194 548673160 894591552 821897158 683389974 477835478 404571781 712406299 86663269 467906316 677861352 447287340 954366241 670683140 110660207 186053386 422914636 69229255 771455235 422506723 282922032 605040038 178437530 894996511 393028993 641940234 710432230 77995114 688717134 989144352 167232708 921192914 11509786 618741527 789376010 228560809 636753219 800156394 277344529 727815241 92147506 260095836 784622428 268504103 358271258 111451441 819111015 105870645 722171478 993089338 195559606 41350461 191250445 571975190 353785976 611202044 659918742 121827878 68969003 82839705 33689505 127523570 558898330 914459238 439835697 804776505 522398315 173023967 97143520 27665213 655195079 541600431 498621292 233238249 8680987 14876643 719521176 617527913 42320046 9…
Output: 8680987 11509786 14179535 14876643 27665213 33344016 33689505 38488165 41350461 41733279 42320046 43832661 47076364 54296702 56850824 68969003 69229255 77995114 82839705 86663269 92147506 97143520 105870645 110660207 111451441 111542248 116137444 118084942 121827878 124684150 127523570 150309056 152546522 167232708 173023967 174794369 176165495 178437530 186053386 191250445 192514124 195559606 199661006 228560809 233238249 245748902 251979183 260095836 261477637 268504103 271472819 277344529 281652278 282922032 284556107 300856550 302097677 311733029 315055564 326486826 331653694 336158617 353785976 354834521 358271258 369857194 376176681 381765250 393028993 398747017 404571781 408485307 415347952 422506723 422914636 439835697 440871149 447287340 467906316 471858802 477835478 492942384 498…

Example 3:

Input: 518 200693480 385304979 746219168 296441021 222356307 452873005 995559029 251799405 465505134 327067744 895082238 117406322 788668463 487797079 597140128 226584298 105727994 828808795 187569323 450479774 278559859 489104576 620685812 724366634 784675587 144715452 570752243 288814083 419113108 950387336 688685222 387406906 54262105 167015351 640873944 222887628 37362025 895079875 298870018 984655670 651514038 810543115 147993598 511492805 465691273 910290794 83382418 656352528 782920419 927956416 679371792 724071171 298026202 202270207 302021612 983862511 889265381 634489023 566064107 458129517 369878188 672602816 986973905 839150449 530915535 254200970 437785567 363138132 236796720 440977932 237953520 157175468 768268201 627551072 873412888 315455247 141713072 936577 654137894 701756004 96…
Output: 936577 3773040 3861091 7454632 9342529 11241130 11447025 12019449 15950090 16974078 19107543 19984519 25965810 26504764 32429876 37320220 37362025 39989007 41640632 44224549 46765159 48002327 51762055 51815940 54262105 59307868 60966118 62656680 65886808 66053363 66755968 69733058 72346580 73899769 75570477 76836266 79757645 81655904 83382418 86768231 91390300 92154008 93853133 95924127 100138214 101021030 105727994 106151153 106158777 112496801 112964262 113602011 116357481 117406322 120716034 126980839 127137037 131550320 131616340 131656596 133549907 138731272 139822874 141713072 144139606 144715452 147993598 150155091 151537931 153504482 157175468 167015351 170315782 173075026 175526713 177363068 178740010 180499934 181460339 184601856 185566602 187569323 187626283 190096507 192115909 …

Constraints:

1 <= n <= 734; -1000000 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Herald's Obsidian Ledger - EASY Coding Problem | CodeTikki