CT1410

Bhanu's Ledger of coins

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Deep in the mulberry rows of Silkmead, Bhanu studies rows of coins entries. One clean number will settle the guild's oldest argument. 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 <= 73; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 64 733539095 293251887 85897835 181985699 722615558 648290315 246604526 753035025 577318843 637468539 409992736 16189739 167478898 509381910 226280009 130906968 946311044 959285686 171295980 653350325 12656017 121663536 234600331 664947057 719208097 965357107 400240181 105534135 656011963 906374668 787496727 437601723 957838565 645256667 136664166 99481500 657489964 122748353 927398681 691043448 932456554 902677612 362718038 807134588 950628178 397854928 852760008 268830489 729482799 219828287 763775147 431642645 434677822 657387182 129567244 493168580 685019227 833619921 14501471 485719636 282359733 290534836 849064169 357186645
Output: 16

Example 2:

Input: 50 326308282 395294591 295985856 534997504 711964574 515453368 468835082 713910682 405730009 897511258 901481762 216554690 140351069 924935415 242763971 728076834 827613444 542103013 50984959 957795186 366034863 230095697 355268995 205148169 209504027 757548595 6819932 808601738 828299678 884691014 132655548 363208065 746452089 395621909 519561085 602608585 893708921 563419977 19274107 280792934 385977246 338084318 740546697 533151090 849177137 209173985 732807006 556441814 364064539 273744216
Output: 35

Example 3:

Input: 69 366440453 742264553 978431249 -709828 57171454 637719286 252321457 658570784 540613167 48246909 762151993 474126046 153881348 116057714 838706166 780335711 529820450 649224734 833843242 83780013 801097530 107776257 569372121 690760175 646678854 392046961 164540589 15442226 873253562 675093735 206906215 238285411 471487589 156558416 18895437 374918423 255657072 839795894 787343191 47702234 606767310 680243112 94440984 823359123 239750733 274798954 843123320 389826401 259732734 534904594 470336063 280704537 283350114 999891473 234551050 549810436 764064030 526231700 939150660 9244613 598409205 215982683 806148921 307570609 873060031 937399997 614393448 305967840 202510644
Output: 40

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Bhanu's Ledger of coins - EASY Coding Problem | CodeTikki