CT22483

Brewer and the Dominant Values

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the windmill fields of Gusthaven, Brewer studies rows of ingots 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 <= 802; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 561 203129520 29763235 950843844 786965639 167214282 590536789 648740926 930365211 296359042 45540276 173786026 217536746 248251409 665489875 664304555 176408274 144737392 926797754 569854592 811092111 537611668 112576774 545632673 734432995 886982119 197601491 969075028 665732514 235709358 239189912 688573839 254059053 977067823 986832270 875184885 143900770 67235449 377404950 94712716 184828546 824751512 343226376 760616701 354558195 239501051 184178849 345266041 770990320 733626720 249474508 492240409 489216310 971353246 611787760 77652470 821166622 614189277 911084868 833005093 722318584 113542653 656938384 77470147 340564874 479694506 219146327 457594422 683127757 838406095 874277220 910312034 138891503 869696969 26474124 60500681 909114449 80980915 103566018 504877157 619223701 15884…
Output: 426

Example 2:

Input: 310 83947545 472389795 146326526 733869560 805904023 788035665 902136618 345191430 11906228 952495181 761718717 199252624 37803958 12777386 66685948 663385629 962059407 468011475 525868407 279762165 235025197 263098192 981968703 457373849 403184194 350688761 602476266 453343437 597983097 491413165 893483203 223176876 454372158 900589653 730979453 662880538 798444806 144589420 33892667 535064032 119074778 490762186 875754504 280854512 368697818 974269559 128420751 306643824 944351847 332789914 464276295 275696937 117284852 51006076 276657662 457275628 973845807 12137528 600316053 215341444 755723698 533536967 147462475 19719625 464564892 916748890 539082219 859660282 508838067 932495353 840312458 694484229 300865130 445522238 698010767 -938216 295676807 187864678 541504164 294592067 8180270…
Output: 283

Example 3:

Input: 38 523071594 234597292 743269152 141192389 920341563 944173452 904941953 54214329 28114878 574203375 722025559 729273584 901057279 864797602 363775537 352747677 335589678 752649285 526707644 465942244 329540690 730325737 418957191 49935660 730461463 891038928 734029552 498475967 89146819 115965445 361707598 903149898 213956723 681672283 860447163 512282323 943127450 870257884
Output: 20

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Brewer and the Dominant Values - EASY Coding Problem | CodeTikki