CT25193

The Verdigris Closest Pair

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Librarian the quartermaster watches over the copper works of Verdigris's stores of crates. A careful computation stands between order and chaos. 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 <= 772; -1000000000 <= a[i] <= 1000000000.

Example 1:

Input: 542 485593329 -985379335 742504150 55154256 806259885 -320605060 482431552 389980018 633311518 882900621 -792691016 -962134750 -378270194 90556062 -927150632 95066017 -266510634 989664572 -536457046 378437433 -117585531 894577594 -758325837 -108748167 -850495801 931352837 -636081254 373629915 -711569026 323270429 316378493 296689399 -237770337 -349964709 -66152385 -302579827 622380351 -94030091 420535979 760409635 -294424421 -690641634 -497014788 -658609596 -461142090 -838083480 375518605 362863579 501598257 -736230553 461166393 370520837 367232846 -956216172 295560209 -974742287 715079250 698543221 -499200628 -340369507 -165492023 700592601 -530406330 -56011090 -710500138 -925218940 298975853 915203611 -224782488 -254090536 -305671800 -638247135 -903404954 -776762171 -667952232 613247150 …
Output: 793

Example 2:

Input: 238 -785099461 -481276968 -854237317 -948981126 -916267030 621657950 -291047075 24264336 -398360676 -933008652 -787109401 -571612677 -802147006 -686604179 -111936246 571608228 149290673 380330217 -595919844 -532134286 -572475180 -864731707 716323826 -157179194 918331066 954854821 -782263952 -225270228 25799626 496997709 785936748 -411694087 466728789 796379157 -100787987 822820888 -106037882 528181805 -255819683 982640469 -643511431 -606030979 162632154 478839855 -83518183 833924907 -222233584 -308671686 616949319 -732247491 -28174161 -134611422 53541939 853612007 594596883 938414280 -228593746 -705143841 -81830178 -961723837 256360318 776879098 839897220 216509933 186132739 774629292 -662705200 816452671 505147584 743931458 448175715 -179125033 185727031 -592135168 -318219343 -452576105 -…
Output: 49527

Example 3:

Input: 665 -292290262 186337787 -793835177 -20692766 640764581 221404731 -895565558 845783506 -540479655 306670194 616363077 474784070 138409207 404778926 -385122929 -16018456 -687662906 805492529 -123626503 285179748 -672708005 333017835 -538785758 -230105470 248912714 -144803991 637543663 832852762 -62721634 -840425524 482223371 -798792812 -392831942 -245571164 262209921 902594404 -614374341 -196548089 270179155 518981667 635743107 13120746 367661432 28592499 132612146 -418659852 -278188456 471690405 243321916 924511862 -276653912 628115501 830066824 -182542817 592806277 -635785873 274463334 -340191984 -799029510 -204546840 920553137 713767655 -556900868 621900940 92323221 -706192744 -920917744 399935651 390585569 514402321 799620471 872537960 295369622 -223838518 -769636689 45065262 -548165397…
Output: 153

Constraints:

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

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