CT27011

Elowen's shelves Closest Pair

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the galleon yard of Masthead, Elowen records each shelves in a worn leather ledger. The guild wants answers, not guesses. 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 <= 808; -1000000 <= a[i] <= 1000000000.

Example 1:

Input: 745 40122636 706717314 9976323 543476811 692843297 836351572 973391878 572224173 83091685 683210280 64138736 700354213 489358027 192794395 57897069 802529481 325772272 697655494 621791402 832318799 87242655 37703524 658935012 107613796 592838755 594811419 270024125 784675950 354244182 216619923 855404250 123273945 817335622 308090033 941865283 394911282 420016257 86418688 773227498 213965882 539761959 267343711 523424789 649932596 158553462 505585982 297921813 631791633 534845633 897500875 904388273 524870467 812353659 481320256 906222377 205592370 572557454 792952328 375091490 89165957 290352820 670298609 501184447 478341973 706260927 39943685 161486690 491624575 104281987 682937130 584324636 668064519 204146102 193766210 216729853 974605747 383224692 736049700 720734453 264556417 6916338…
Output: 2605

Example 2:

Input: 208 603132986 54619056 223676267 439584819 424758573 373656882 251686291 162520293 793058389 440927271 938680616 936236831 632599107 953708476 754297053 85937436 112442490 67170129 886525291 850592407 322896129 777759379 500263962 132346339 750323756 245792537 339416385 982331182 747241080 608305963 325430944 313734312 794194836 341758358 365222868 778034742 876505798 25602141 831107536 604497971 285446327 106113813 910138098 598669252 67347604 364019665 449048782 139788221 448387404 864965542 488515307 188365227 285036834 951289845 279150431 103112359 275458376 180741023 687657312 297295564 806766597 992637462 82019027 615614418 487103265 543189087 594900725 45094154 194511963 239214696 198819595 709025929 464209088 135215112 69819626 672068476 503961190 694214549 926109419 845981780 9859…
Output: 1059

Example 3:

Input: 719 134910816 416369167 681667368 951502892 155656901 546520119 779327521 391268277 275241987 42636950 836161838 430117098 697494252 323003017 293448962 434796549 646375655 518772295 374655033 537188433 356142696 862214033 176795918 712122346 254365852 384460915 143569827 428987944 321631313 914515605 975465733 656755482 469406855 272022489 195316177 127794554 699824361 645092131 384171796 877709299 187705977 318876542 473717106 63242570 67346968 408869486 132455959 96150238 820295922 946076637 166758315 700099736 460349836 643719310 527909389 500591037 199826660 183202277 931180895 258714155 70417568 117249942 968173362 718099642 245039704 712191258 849295428 701624112 18751600 328999593 249685563 277878861 349081724 261947750 549042493 889685934 44207784 107213138 96369387 201226558 4118…
Output: 3825

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Elowen's shelves Closest Pair - EASY Coding Problem | CodeTikki