CT27525

Xara and the Dominant Values

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the caldera rim of Firewatch close for winter, Xara must finish the stamps ledger - one figure at a time. Task: Read n integers and print how many of the elements after the first are strictly greater than the first element. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of elements a[2..n] greater than a[1]. Constraints: 1 <= n <= 547; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 41 907766 325411 635891 522437 352383 382076 524791 444095 225302 950182 614234 196564 647426 642636 669542 518041 673957 449013 637760 763027 305131 763204 940347 834323 157796 133406 507226 407322 73904 248788 657294 791192 394219 568194 896347 820257 345761 980005 132748 674814 362894
Output: 3

Example 2:

Input: 345 205173 636394 529491 957590 780163 872371 165067 173376 946026 795036 676059 353612 174161 172523 913917 55188 787071 705210 756845 555811 75953 56844 146742 494586 989649 702000 996897 757243 230328 228217 139264 268989 398096 994160 262272 256352 63137 831240 666788 726451 931827 106147 33444 986015 799692 54747 85343 233890 82813 680676 461086 378020 207257 995321 519852 709225 163909 202859 892186 617101 409344 50408 188196 726925 403367 869882 965013 136481 23964 750016 168047 12768 541294 938327 868773 515492 995387 217976 605775 721364 984012 783839 833962 263747 707005 71056 957228 583693 572890 422133 45775 142208 604275 939189 618642 526202 488288 761303 848059 182190 417410 205237 998591 455221 98506 487974 27566 541747 485106 642029 674831 653435 481760 96491 907977 172377 …
Output: 255

Example 3:

Input: 87 712954 767343 732411 681138 422379 807492 23445 449274 304631 182026 493092 519483 359071 665238 28709 596533 113458 536056 672994 60871 35612 395513 230755 60793 184526 468272 373739 492616 839171 545385 184181 647757 625032 757805 35551 503456 489322 458687 426199 821760 611507 442905 176317 199249 646646 546544 941842 137647 966647 56519 319678 111242 929124 613859 182771 530910 63977 280465 880303 135005 980337 207393 784349 316044 190037 877289 143757 105070 857401 792352 205692 924799 855290 190258 728386 991974 487468 762739 136767 676530 680569 661685 846424 259403 41645 281716 721213
Output: 22

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Xara and the Dominant Values - EASY Coding Problem | CodeTikki