CT28194

Kael's Wayward Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the tundra station of Whitesnow. Kael spreads the vials records across the table and picks up a sharp pencil. 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 <= 933; 0 <= a[i] <= 1000000.

Example 1:

Input: 563 34172 667038 529110 263991 76038 527007 530455 986331 951092 928683 450041 171579 733868 888047 118542 651179 452952 717778 957483 479266 546609 287663 467207 130707 509746 319847 55861 4288 414551 740938 132286 260964 125568 135803 486242 254661 162486 516460 613784 465062 432606 290729 565806 751884 302644 371082 724939 863262 727542 686074 123493 495272 809503 677682 754706 121054 689928 16618 674021 387978 78346 241110 325477 421558 563393 240266 818011 774773 968531 847626 243244 748669 130728 801708 961119 662430 968523 90248 301752 175720 844884 242958 851831 178206 788827 555696 953758 303764 884237 238906 773551 248407 51295 688687 580747 460883 196430 168678 657983 681318 825806 701656 31723 483148 599238 194486 208797 61641 145441 14888 424709 318645 3887 296566 169649 13050…
Output: 5

Example 2:

Input: 907 585170 113581 986295 88602 582580 874130 454994 51171 463751 784404 835401 768484 262774 183845 841838 932140 92570 175522 231479 598391 595860 4078 207628 49777 50765 459325 161611 884400 385310 475805 925688 466055 577703 626552 524486 819029 843977 194888 18609 313911 819425 318395 221309 536776 887071 681737 56421 427814 414492 925404 48987 51614 66946 689114 581591 377594 381160 837670 327444 569039 271554 910285 787653 153455 28748 592109 829674 950248 773821 393706 618608 20471 490573 499375 844984 442718 748627 998757 331785 400715 324517 210048 102352 307086 912902 473210 576473 747824 80267 155332 884652 611420 526944 150106 82117 209149 462477 950306 123986 989139 738130 984771 280656 405362 918749 310714 732543 460758 838416 504506 835422 641218 573510 628267 174880 661259 …
Output: 1

Example 3:

Input: 44 974372 103261 126019 647642 467105 764379 158639 200936 193467 682693 435823 856331 375210 194577 233252 929567 515111 248662 340200 32988 911054 524065 445313 846123 822235 745924 376096 570682 238833 772711 444538 99083 680717 429225 400131 105364 635034 46431 99067 20869 404384 951713 547631 204412
Output: 16

Constraints:

2 <= n <= 933; 0 <= a[i] <= 1000000.

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