CT24081

The ingots at Serpentis

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the jade shrine of Serpentis, Fiora records each ingots in a worn leather ledger. The guild wants answers, not guesses. 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 <= 426; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 230 -119388 220411 -361061 -211603 265874 -238924 -203107 -562837 -921567 764051 -28883 721498 554596 -857300 473635 -498335 849742 567809 -618020 701442 -928807 -732942 800280 226577 106797 -512044 800068 539934 336098 412555 91256 196347 -674052 118241 -83112 -236203 -595095 -949142 -513357 -203630 -365008 -639543 941292 190558 802036 886598 459595 -500537 -563371 -874854 -424163 348188 -611448 214403 -589076 -305978 467439 -297449 -364722 334714 54710 -105012 -942265 -727171 -18591 57371 -123234 -600254 -826599 801215 932959 964923 282809 -168835 -798638 -912904 585067 -907335 -209143 -345820 -698825 -307952 898019 -923586 -556391 679883 -989561 -786983 569199 420292 -388066 232119 -293089 -849664 -441077 835566 -159251 907972 464909 -424801 190641 611287 -512062 -14413 -257850 -460920 -829705 486804 906717 -363818 -830678 773408 587847 679273 -178520 194032 -302444 -112196 -209655 195337 92865 817894 -2706 93881 440376 -402055 -75684 138284 409349 -855210 225719 936418 -458091 932605 -818882 -203986 -270798 758915 -74908 -4953 982581 -323992 -408077 -177771 177420 39334 -880841 271070 -131095 735642 104531 -217020 359942 206706 -747602 450716 -324850 269468 44756 568828 138183 584697 -897611 667788 -760248 -706308 -423246 898083 -598397 -403661 -480320 235474 597253 311572 658039 518439 338849 -350173 -284078 542259 -330227 224449 652540 837060 591500 372054 -412781 318109 418168 -321724 -544315 320075 -533974 -274510 -318735 533006 966030 810828 828844 -978791 -612604 -161289 -37087 20847 -894803 -850224 666112 142182 526257 -119384 -789306 811059 -891878 941260 -837651 -214968 -281944 805088 -356320 323186 374178 -409463 220060 -772691 478465 30745 818602 231908 421228 240016
Output: 125

Example 2:

Input: 169 -117531 -346060 -949673 563809 46314 211691 742768 333273 837276 -411240 -412857 275897 456733 864342 -257583 359786 -688762 -734217 713763 435311 884513 299670 -698567 -512141 30504 -186575 824678 144496 750074 602109 -176498 850592 -474704 765504 -292141 -441359 48459 -835954 963022 959763 -246138 -670118 -606816 214577 475316 -724123 866324 -89756 -694368 630351 -818612 592889 -156039 -646288 -359489 -505315 -410123 388744 363806 545138 68341 -314705 55929 -592002 -231461 -705781 152786 68244 246948 607204 737267 -632541 -972733 349577 838880 -95086 -282004 334724 -442260 360386 484382 195275 584396 -641147 544320 153331 -585605 735572 68581 67702 559829 562484 646856 344964 -100986 276414 -231301 737514 -150112 596741 794362 -810510 638271 -73005 634592 -908826 -598605 -861565 -907502 293012 -887618 857309 289508 123470 544152 206052 605161 -218760 439758 678782 -610081 -655813 -446663 971603 -170270 -117804 568373 -339618 856118 37720 270700 -156360 146391 209416 179948 -322991 -32144 158090 595431 323310 -588251 456024 994823 630533 -632378 -188122 651693 -147099 -921782 642313 -408746 525197 462136 449741 -461548 -813928 513994 -771005 527555 420980 -26904 833975 235644 -122319 484183 12103 -305214 201622 -942840
Output: 103

Example 3:

Input: 340 -296904 -804264 691628 -601577 -486990 -241876 310459 221956 -681248 -304212 324325 -58147 859345 667589 -214581 430569 917744 306225 198679 808882 867269 -914778 43097 11784 15937 -897752 -590620 968420 -222639 396603 642331 271541 666927 463637 799375 -355786 -265064 -610035 -464852 517507 949980 -482300 266774 -7623 590368 660113 -966826 -359216 314440 -566355 935077 -606346 -805579 33220 190858 -560152 787341 745948 803512 712682 -16580 -877127 419119 -588616 835232 784579 612413 -295798 -933072 -930460 -666389 -717629 -739940 -761207 -793067 -322927 488331 172785 197859 641934 666882 961439 340703 812865 892590 114175 -466270 -425224 715048 -605932 -732273 94738 685897 67567 -816971 405594 794474 177867 607922 122667 427800 524015 806567 407387 -823894 368294 627896 -422448 -115912 -29523 715474 -898979 -16060 -308254 165881 127347 -156367 177729 748989 -670531 -350201 536347 -210319 488809 -202733 697179 932339 902525 -532578 35316 -641682 -621818 -33978 13004 443122 268033 -40085 -928880 -90238 -263639 138951 -6855 307455 595124 -313795 -521312 834246 35300 -242934 777932 484333 976787 -706756 264987 246226 830323 -336093 -829478 911021 -331854 29036 177670 690753 -506840 396021 -587307 447784 727999 -812782 -566775 891098 76452 -480858 -797312 -469276 877117 542440 -735035 99937 789225 380131 851700 -645433 739677 377180 702941 -831277 -810673 826885 -856021 -982171 -47652 377874 -271788 455840 965653 -651206 -822245 -811655 -506826 690954 -485469 684755 744421 -142699 945590 -670406 -409314 388061 371135 -2008 653626 -481371 901912 407254 -291639 926291 10465 29520 494143 -407393 261545 875862 -877116 -828015 750086 421395 811767 -500767 128544 643339 -312225 776154 -735143 982962 874769 943950 110832 -644162 -287309 61498 362966 -599759 232420 -272091 -659894 820497 982177 122308 -192995 763157 943913 916515 -785640 504584 371446 158359 -273973 936820 71741 -613404 693689 612673 165102 300411 969816 81353 575835 -627438 -967407 -647719 -309824 -357431 709543 -886870 -331754 -755147 -197960 -416010 -152838 100584 -865453 -499101 925826 -365644 -628662 990988 -634566 270223 -165595 36969 -549540 -694848 575801 516584 -191202 -537426 98014 48014 -781075 -879444 -880761 12364 -430229 429373 471200 -139044 673075 996160 -384488 305589 202011 563738 196839 183925 -147987 388946 -248815 25557 -903979 751813 -258724 -881682 -821941 686160 807193 -999844 -432446 556758 -638078 116755 462489 495335 -985245 -673890 -59872 -973220 -769572 990973 -133627
Output: 226

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The ingots at Serpentis - EASY Coding Problem | CodeTikki