CT22746

The Closest Pair of the Ember shelves

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the observatory of Starfall pays by the answer, and Hugo intends to earn it. First: the full register of shelves. Task: Print the minimum absolute difference between any two array elements. Input format: First line: n (>=2). Second line: n integers. Output format: Print the minimum pairwise absolute difference. Constraints: 2 <= n <= 956; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 455 947801298 221315042 849314843 481342751 384089755 886696012 502702910 535261111 923183685 728952442 976749853 919848519 485074679 241740456 872877401 191451595 740103293 870067336 471752944 681133353 69878961 237531565 531014892 554668245 181289082 805652319 534073880 894173426 372509777 778482387 924622668 400905768 589570 232067916 820956487 746556074 320557745 386922216 555747029 109464881 13702247 578412820 680801946 906056125 692371897 860437076 158460608 399109519 400682516 505134830 211281650 302835453 375407396 935550942 666000072 818338568 172460805 3669605 512362633 520360879 328670586 262187111 601165042 774035775 717975791 414118184 116290045 16451308 544852889 109353056 774690431 320066549 203010007 469428445 925953941 655001430 171095409 329545863 424336072 973863246 1566…
Output: 6457

Example 2:

Input: 804 424463000 162886135 181811724 839874295 97551954 145560693 916794225 582956657 40945390 808803838 926922810 313021858 386048317 632308592 253720494 736453947 89852721 463438129 152215806 252169875 4442842 820391867 194024166 22450907 778389323 65887190 208475033 785353059 987125247 749636372 392349649 837910001 869823552 618013454 636971640 180012615 362697938 941646832 782269656 210860992 174582248 698311335 615093319 884851295 324089089 534207383 864378308 692097839 894813498 754661538 290599744 883947349 335165414 282288155 15937659 282762008 876309926 558856427 60709495 861195926 447045675 202434286 791052799 683382277 543151377 916578444 285048187 132603076 701943664 361201377 107962752 951945445 786104345 458918308 115623060 956647987 294640177 463682885 896586508 794482145 50202…
Output: 311

Example 3:

Input: 679 493627203 200446358 12110719 867486794 506583115 608280695 905320289 655463191 569741099 323616359 692985326 730178904 181972456 767369339 160785512 -634762 827282262 891942860 845063675 509796453 485452607 294187148 110237271 901394908 517625600 48799895 943245599 183178076 614210425 705017674 353202350 855614327 511505871 984886634 691773510 516560699 485005809 729445301 796047164 276844660 955619428 562163683 447587051 501323803 778583075 721149616 18872298 609763835 651574426 131318386 110321072 297331409 739562383 625636495 290642228 49734553 495275341 286192806 753305770 644058900 254024402 125336024 775866355 986707990 141942124 885071486 205276480 57627712 716604356 222483545 577089230 807928315 835384046 883754593 349774740 918848266 797446708 574975451 632537205 774683928 350…
Output: 6825

Constraints:

2 <= n <= 956; -1000000 <= a[i] <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
The Closest Pair of the Ember shelves - EASY Coding Problem | CodeTikki