CT22466

The Bronze Closest Pair

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the fox den of Rustwood opens only for a perfect tally of crates. Dante means to find out. 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 <= 780; 0 <= a[i] <= 1000.

Example 1:

Input: 533 106 229 232 113 627 753 447 209 361 980 256 404 650 213 300 249 713 509 521 552 904 444 8 156 796 586 678 704 986 69 815 167 307 475 610 404 640 54 532 25 610 864 416 142 985 94 252 137 847 400 256 547 270 722 672 869 247 238 872 125 590 871 969 996 430 499 927 215 883 953 40 307 1000 682 297 191 944 883 353 373 402 240 920 112 137 876 435 996 680 55 938 383 850 73 381 875 748 461 307 977 468 800 563 885 270 745 347 189 483 993 354 750 874 169 366 379 408 409 619 933 9 982 548 234 646 735 540 872 805 899 552 589 680 89 324 424 552 699 307 674 586 106 284 122 344 354 547 298 263 885 927 735 252 64 276 226 988 281 509 556 922 730 680 859 267 419 954 807 824 693 764 136 509 854 777 552 272 933 978 507 354 931 768 386 444 547 140 794 286 969 118 244 152 878 946 378 897 372 10 246 376 818 2…
Output: 0

Example 2:

Input: 94 563 365 335 758 487 697 537 299 836 756 919 189 507 659 859 760 759 417 889 299 912 459 741 227 960 82 418 438 341 478 289 59 749 193 188 581 435 48 94 405 733 736 91 984 523 464 794 581 893 980 413 944 947 833 964 1000 885 23 472 505 123 539 167 513 571 607 812 649 405 827 560 434 525 795 502 377 40 556 913 21 165 857 774 868 693 558 678 776 984 482 396 475 510 713
Output: 0

Example 3:

Input: 264 941 414 65 751 428 559 671 152 49 293 774 531 249 553 383 970 817 149 776 246 893 326 261 149 437 386 497 816 917 991 296 155 172 965 454 502 192 343 79 662 758 784 467 306 940 715 855 420 85 673 105 714 19 654 433 281 148 925 670 183 643 757 436 20 372 660 2 78 496 896 991 654 701 33 942 262 840 657 676 534 383 506 608 354 474 50 63 608 544 123 896 697 5 485 563 756 163 353 612 475 622 554 161 413 169 167 316 969 254 478 159 208 500 470 402 108 315 339 376 617 986 878 167 469 374 621 21 515 190 72 373 412 516 420 497 517 649 367 73 521 986 516 579 675 395 726 308 199 672 325 36 681 766 291 255 127 531 548 658 195 6 856 458 297 390 882 97 598 18 782 808 863 71 206 816 28 275 944 251 149 380 800 471 698 338 706 92 588 415 599 699 901 794 339 437 421 327 473 795 742 600 426 990 987 390 5…
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Bronze Closest Pair - EASY Coding Problem | CodeTikki