CT24282

The Dominant Values of Briarthorn

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Deep in the forest village of Briarthorn, Piper studies rows of crates 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 <= 583; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 369 944 448 771 253 127 168 605 524 642 251 487 562 418 312 887 147 621 254 676 418 178 21 286 553 174 303 511 135 347 776 807 44 867 753 389 642 30 239 190 613 177 50 96 67 160 972 928 888 209 540 627 558 631 150 667 894 998 371 51 460 842 198 60 786 349 194 518 127 853 129 773 815 141 42 0 245 292 739 647 25 115 575 644 660 407 130 71 306 26 622 560 400 479 34 427 978 322 236 709 162 685 834 170 667 580 254 515 738 834 574 103 453 520 300 991 968 547 82 829 642 185 805 296 604 503 408 642 836 944 386 999 714 94 129 29 460 509 751 708 799 956 919 636 164 221 395 136 771 492 845 935 537 400 849 548 712 377 98 775 621 796 603 738 682 383 882 243 703 522 214 176 693 345 299 476 609 664 497 464 305 0 864 899 913 947 317 638 813 334 677 72 297 27 47 819 554 241 142 104 619 939 77 846 912 105 1…
Output: 18

Example 2:

Input: 321 268 916 764 496 111 909 221 265 352 91 88 494 462 514 355 781 108 456 874 243 400 539 606 847 441 741 69 298 969 358 507 414 971 711 279 918 757 633 425 941 453 1 912 333 281 650 529 36 195 84 63 205 516 223 360 198 910 384 983 383 219 434 33 614 781 22 788 792 563 528 642 77 808 613 872 326 303 699 844 470 370 298 704 717 856 396 748 712 416 865 232 660 590 417 901 670 944 374 234 651 246 717 828 692 955 177 301 1 883 433 97 13 435 915 685 646 518 61 351 562 846 682 69 628 808 993 554 628 226 663 422 474 853 729 800 43 144 207 358 995 623 889 29 635 368 106 692 603 908 670 655 281 206 93 922 139 810 351 429 663 325 1 254 689 846 106 212 932 393 758 1000 747 670 723 590 939 312 266 103 118 357 139 611 275 153 147 426 976 831 195 947 53 334 810 569 942 261 857 722 427 381 25 615 625 814…
Output: 235

Example 3:

Input: 168 821 3 986 782 367 558 335 706 898 957 941 499 564 52 696 294 229 240 130 120 612 733 264 238 521 53 277 741 616 164 938 848 958 278 958 423 446 932 792 639 574 583 337 975 127 327 39 482 384 10 425 213 913 115 24 136 817 313 982 614 926 611 642 831 890 107 588 168 545 549 62 727 1000 198 121 409 906 103 842 665 513 388 641 980 385 654 491 838 257 689 455 373 221 303 567 675 331 939 259 718 666 330 158 704 100 382 667 697 800 867 997 10 744 816 826 259 897 451 606 777 442 203 307 273 91 755 417 149 454 446 91 844 906 280 345 758 228 271 748 705 214 193 338 480 488 997 720 356 320 968 110 667 142 234 731 406 673 421 845 570 549 500 314 267 104 84 190 716
Output: 30

Constraints:

1 <= n <= 583; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
The Dominant Values of Briarthorn - EASY Coding Problem | CodeTikki