CT23990

Anaya's ingots Reckoning

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Morning light hits the terraced vines of Grapehollow as Anaya unrolls the day's manifest of ingots. The tally will decide the next shipment. 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 <= 324; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 106 703535 569880 173257 962979 467594 667263 745615 439378 993033 780621 452375 434707 924662 44726 537224 830938 636164 988182 215664 256325 346866 280150 951013 747643 704885 367799 93552 6217 336728 614342 752703 836065 104643 758230 312058 324961 35397 203200 427842 358289 241027 708908 476246 449636 950634 390959 181719 923938 852280 624186 32132 964392 88853 765943 671528 334377 729210 164736 20613 647692 16851 195369 581117 130694 605192 994736 197019 882519 577401 447040 987432 92752 307949 984166 660607 419153 434394 680288 228663 348573 158272 369942 636037 994741 738665 345945 710323 163683 139347 596772 167948 497572 605769 542086 599460 997742 25559 8061 288765 69858 410441 282195 850031 894409 669742 361853
Output: 30

Example 2:

Input: 279 936753 119891 818900 646666 92964 501255 634161 239371 613240 523641 405948 283621 955933 419 954770 337524 586912 756424 343963 220878 5786 104711 489358 904809 64318 804211 773386 13959 452546 156848 695720 509168 501098 260393 933265 606490 882946 847164 579073 675077 873887 622675 726873 50054 914353 66121 949496 724097 334381 410541 358171 98136 525720 89763 771166 627153 285540 537943 193110 155888 601518 321026 151134 307388 972336 989288 42498 6082 458233 245272 77946 570256 105896 463879 504995 32435 81692 482459 124904 956197 351422 708714 932814 273028 833416 345675 284563 77079 911945 642788 278572 481274 734074 640061 432677 809823 646475 359074 677312 552725 249844 247226 492587 663204 736861 272657 858215 982528 683080 672183 384116 845090 940563 87209 419374 126396 7144…
Output: 21

Example 3:

Input: 11 306368 907133 183848 637623 991795 655562 227337 47605 738742 468576 688317
Output: 7

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Anaya's ingots Reckoning - EASY Coding Problem | CodeTikki