CT25417

Qadir Counts the parcels

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the railway depot of Cinderline; Qadir weighs the day's parcels manifests and starts the calculations. 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 <= 629; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 476 377225300 293091167 389972098 750499059 98633762 434731140 204926370 866781520 773355257 587405634 517006760 974405043 921417129 109676785 16110671 376710982 463484785 450364415 543459374 222593530 187767175 315668263 349279705 45167049 668120486 127637373 31717785 560171446 552823299 733443358 444457768 806724222 4619062 207600791 784688048 439889530 407593500 933301621 13334008 683861565 14784557 314979472 428082567 288061727 757289755 993300224 351420887 589043305 12803412 516611917 982107407 564845955 76485740 660227516 260376467 32822916 773018568 364235469 202141966 700678621 795059247 283247572 24641165 415428055 118278119 267282937 356389200 671554144 679988460 607977257 612865793 482484709 269343727 409206907 249759994 919828764 302718994 699102530 954309995 358781566 12143104…
Output: 293

Example 2:

Input: 18 226134553 996181300 614416115 507669140 477518013 12951515 546306652 620464062 442010209 488618153 938918326 157220431 351965167 827956726 879631093 89224566 592774673 675959188
Output: 14

Example 3:

Input: 373 710446264 997481498 274105516 878887720 392907000 847620964 616000386 192555195 318385304 813400412 556021350 20860928 116591301 740878712 957002233 671636706 653250267 29621908 39062489 202073879 884492762 422550088 525629072 407088659 65891387 99593585 437839805 416929699 93919969 85113828 405301191 458204183 452891254 478697065 882056060 508348889 131059124 464401241 357615501 154821267 982059276 622797772 330203322 170207051 651891440 797172238 728752052 584574486 986259107 706133551 668487685 243295337 513880438 774928328 523838426 123850286 312256208 258238421 383134682 853480309 512777368 374532103 431954952 333402360 423371738 429066953 853730286 305652929 437229215 921497950 33761588 388971752 56554092 828383535 427040005 728469693 733886794 693443686 119456332 912135755 26809…
Output: 104

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Qadir Counts the parcels - EASY Coding Problem | CodeTikki