CT440

Qadir's Golden Ledger

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Qadir the quartermaster watches over the ember mines of Cindercrag's stores of ingots. A careful computation stands between order and chaos. Task: Read n integers and print YES if the array is sorted in non-decreasing order, otherwise NO. Input format: First line: n. Second line: n space-separated integers. Output format: Print YES or NO. Constraints: 1 <= n <= 47; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 10 50 264 490 534 579 623 632 669 716 785
Output: YES

Example 2:

Input: 24 -59 -33 57 134 190 201 236 345 359 480 486 525 578 628 630 676 676 714 759 793 830 883 893 914
Output: YES

Example 3:

Input: 23 -89 -45 43 179 232 261 277 335 347 460 501 586 662 703 764 770 776 835 839 855 893 985 999
Output: YES

Constraints:

1 <= n <= 47; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

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