CT28688

Jeweler's readings Dominant Values

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The inventory keeper Jeweler has been asked to optimize the storeroom layout. On the desk lies a long table of readings readings. 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 <= 808; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 623 151156 347867 89158 952776 58157 302121 126680 972220 953921 9192 804798 495285 465491 417344 710107 923142 175034 969491 606275 471599 383314 953163 933294 515370 875823 687624 622504 246472 425637 380268 906824 76033 908656 765294 552533 150508 924258 270045 91509 900942 752309 607798 85372 124963 186885 271744 341987 477715 508712 64916 367066 624863 806830 115750 847046 22685 969851 771714 817500 558003 80997 840521 172535 167432 934949 311231 381991 448630 905689 965432 196060 840398 978341 537557 206758 826909 45526 83013 387480 53988 556973 42271 453012 60782 310076 707057 463823 200203 957096 910821 172389 988647 534630 792796 187522 878662 4362 317670 3452 11609 341927 221775 528944 135868 731021 899774 74369 736747 63980 417592 49684 764648 104201 708362 194492 352995 868093 …
Output: 503

Example 2:

Input: 671 170528 9896 257479 14296 964082 211417 963925 511787 894450 696652 5521 157939 820437 368368 975267 540536 79375 414096 254963 940147 890304 816127 173676 136804 41692 116832 466934 370753 238315 114236 362098 25765 687749 851154 565535 176732 719123 512139 754135 652232 443045 813371 472262 501407 256298 119622 470740 279125 338065 474185 582951 350638 520543 778597 803041 910303 945232 896988 392113 170571 22333 969277 650543 870038 283150 99292 87817 316074 792342 659413 318497 621960 215347 329337 542182 483278 441370 18925 1610 271073 37673 434947 76722 110495 151520 140057 -24 115991 623186 443193 807760 617442 477355 726331 922322 34526 764847 564631 270487 878715 983443 568278 149709 382164 241437 319265 890463 508294 989181 56862 64708 814744 123303 44765 949658 896948 593430 …
Output: 544

Example 3:

Input: 798 624099 341772 168871 472024 289478 194686 255940 663839 925757 114655 48 859967 561809 499710 226605 535386 266551 954577 883387 820318 404241 752316 836980 692260 742791 178321 750240 163473 289881 523365 14319 624903 289271 211166 506936 631355 427325 509885 743300 678272 491229 587673 930088 213131 738696 496054 969508 442256 901327 391000 20484 874796 589131 824084 772540 766585 801019 419192 330444 725958 641643 14760 579445 106388 905198 124548 470823 798358 86822 669002 778371 34806 834468 745412 768602 248943 152701 500484 809506 686521 540407 484493 228059 33100 334106 227663 118822 350681 447703 491357 427004 682798 181639 567086 157198 488209 580196 60544 624360 708766 208580 999962 883789 310030 839923 409338 113094 726489 157334 925302 183581 583661 492503 658848 273354 91…
Output: 304

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Jeweler's readings Dominant Values - EASY Coding Problem | CodeTikki