CT28609

Captain's shelves Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the ink district of Scriptoria; Captain weighs the day's shelves manifests and starts the calculations. 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 <= 875; -1000000 <= a[i] <= 1000000.

Example 1:

Input: 280 137411 717056 -292284 -868751 -376620 -82374 -104113 -660342 608820 956908 910550 96181 816693 -8121 1622 392595 -292099 449867 -368883 564676 -379667 -85874 -435302 439282 -531062 210394 -538888 -80200 766182 -680641 -746948 -924717 132838 -426017 -836079 521185 -3477 712755 675531 -317970 996512 938468 874048 -112139 -873351 -216258 107935 -269136 -148737 -820982 920387 -423472 697239 -387712 -157235 -643926 -962807 -700232 31408 561662 428124 -906975 640955 427308 165833 541314 -60558 552545 -828410 385484 80787 161537 -193809 46533 -180867 535389 -342116 -669297 197452 751283 656664 -922729 -977710 -865808 548178 852726 -987390 -434496 -798234 -110815 -86129 -168048 382555 -788718 111558 -554583 -923387 567412 42926 575032 776259 795325 -63370 356661 -694801 -351890 -34422 921315 -…
Output: 5

Example 2:

Input: 592 -152940 157878 -138748 -756629 -573663 -250698 748352 934958 -437639 -929819 -890780 299439 840433 15300 -412293 -99746 475863 102615 894921 -936961 437110 290290 178537 693049 218196 -755954 715827 556730 -748506 -107328 774036 -147635 475114 30579 924220 -760507 780590 317685 -221 -765013 -569694 138329 -928825 837692 -757984 825689 -706240 -505798 -887527 64012 -125447 -917855 881838 -328536 665083 944109 -59318 -210646 307818 -537327 -555021 -113427 153789 702676 439559 369241 577770 -176825 85167 -949715 -223260 -329577 -468087 -734440 827218 -732782 589254 -409226 -438783 214937 101687 -266697 673140 137968 -2672 -342255 -901899 81694 -901444 554095 491292 -375658 69234 982714 745439 200916 -65469 922256 696411 669291 -441623 -618151 413185 101156 951243 -306755 -406594 285640 -5…
Output: 1

Example 3:

Input: 272 325817 235382 -434643 -698415 259452 940234 -2459 248436 -313532 869987 -633073 -662885 -374102 -793729 -215003 400279 -481900 -736005 127336 978799 684963 560350 488523 -617899 -181722 588072 -722796 774094 -43413 957757 -781470 -394122 -723091 803793 -477207 -740113 783316 655630 204240 -561679 -918858 -620504 -370408 -647796 750285 362854 912633 435974 -402002 -44528 -458244 -29808 37914 -937419 -490954 -750595 -782604 -688816 -273917 133466 -74195 159304 68854 -650852 227392 -385800 -411619 -497398 -728101 295612 483320 238363 -613447 -852466 682846 -436871 -657214 463579 -515616 -609455 140885 -458990 -92788 -901731 811258 338848 502017 -736784 637976 -508870 691617 522742 709747 -953143 -32336 -608600 723626 -735357 -210463 -794182 135509 624675 -57454 350759 301366 550364 163521…
Output: 2

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.