CT2067

The Order Check of Scriptoria

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the ink district of Scriptoria close for winter, Vani must finish the parcels ledger - one figure at a time. 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 <= 38; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 28 655148582 855994269 481219727 6850510 174798158 999829388 503883463 767330936 118572121 741601380 636972826 361624340 418943198 904755331 700800588 118153603 446162813 1000000000 577577799 317773491 569039117 223297489 620487800 54769617 878003227 364073990 401524267 113004595
Output: NO

Example 2:

Input: 23 108494113 976417270 391158887 819425558 454574749 117388812 21846712 1000000000 594752795 111362671 378408500 110085694 193736756 395234125 63392916 949545792 729354690 824042093 435261942 233335969 803085884 484367627 485680934
Output: NO

Example 3:

Input: 35 627021921 990121960 132955616 487132556 376668778 41693079 482459792 192175140 504404824 310099220 724619820 67641474 997460116 37182165 213019051 805099451 235427382 992320981 743366281 857613347 497420395 7514677 565934125 1000000000 17837821 965812508 233462205 66140327 644337661 415989607 557670201 37051618 782703830 868438627 771908533
Output: NO

Constraints:

1 <= n <= 38; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

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