CT29033

The Hidden crates of Jaya

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Jaya found an old ledger of crates in the dairy attic at the port of Emberfall. The margin notes pose a precise question. 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 <= 10700; 0 <= a[i] <= 1000.

Example 1:

Input: 1598 240 55 468 607 591 5 560 834 443 21 320 403 164 304 671 414 202 978 669 944 609 268 101 756 928 987 447 537 445 299 157 299 117 955 441 73 921 767 625 327 410 614 226 330 45 252 668 258 517 315 230 290 916 58 567 591 706 469 30 265 831 192 737 708 919 374 699 58 506 398 702 112 330 613 694 953 142 338 557 456 422 625 950 625 401 413 597 824 277 352 784 245 370 723 96 771 344 11 664 412 415 997 830 706 890 719 763 390 71 483 31 190 0 514 819 705 910 937 866 491 657 359 302 698 411 723 753 612 548 913 371 559 990 272 54 156 444 986 196 224 782 760 198 651 228 134 887 562 968 730 895 881 634 566 915 514 610 885 280 899 977 351 50 66 411 117 660 37 233 946 247 583 70 518 253 357 950 498 220 147 485 141 538 46 610 902 534 489 754 724 276 235 153 205 591 271 588 715 380 91 668 790 814 124 3…
Output: 0

Example 2:

Input: 1944 910 997 737 176 87 435 303 887 492 568 81 991 214 144 193 615 25 916 79 138 138 438 497 112 866 252 179 872 791 427 781 299 651 583 135 309 962 330 144 668 470 946 190 769 207 195 357 680 313 502 315 761 653 748 786 729 326 123 105 279 62 379 594 616 238 324 567 336 448 647 220 225 213 864 966 10 300 992 793 610 98 143 606 594 61 29 514 620 420 98 842 745 356 375 104 314 462 100 902 600 818 164 476 579 761 438 64 533 90 368 699 678 728 894 549 984 684 301 882 99 783 910 696 281 551 918 165 711 383 492 450 355 226 409 174 71 203 849 142 13 261 380 510 188 535 826 392 71 980 177 789 831 284 667 648 287 746 949 843 474 763 859 680 101 910 918 226 176 333 316 725 804 604 516 779 785 100 801 37 769 730 128 707 757 281 819 4 353 113 713 512 565 136 400 266 601 903 442 542 996 42 287 32 549 …
Output: 0

Example 3:

Input: 8652 534 942 810 563 317 1 176 520 141 880 346 971 515 369 440 693 802 522 59 74 336 125 706 461 150 493 811 382 619 509 315 993 384 415 329 931 45 315 744 254 788 727 971 820 326 17 517 45 713 986 893 907 524 952 275 412 118 316 386 414 861 236 89 765 58 486 750 660 520 723 660 287 545 18 353 610 180 688 531 592 4 767 513 845 731 747 922 664 121 172 593 918 23 880 909 986 428 474 420 9 684 891 398 991 455 934 732 177 647 816 75 379 275 862 554 542 295 415 811 200 754 842 384 238 274 751 431 768 686 972 692 374 246 68 678 441 961 54 22 841 978 663 909 238 715 22 844 780 501 702 394 784 156 68 466 524 199 107 25 602 543 757 399 249 46 548 771 729 283 364 792 453 551 309 980 951 626 581 742 701 699 976 957 753 34 867 373 10 107 222 664 325 528 288 1000 299 304 80 137 670 103 113 441 609 711 …
Output: 0

Constraints:

2 <= n <= 10700; 0 <= a[i] <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
The Hidden crates of Jaya - MEDIUM Coding Problem | CodeTikki