CT23577

Beryl crates Dominant Values

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Farmer the assayer watches over the thorn maze of Bramblecourt's stores of crates. A careful computation stands between order and chaos. 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 <= 911; 0 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 748 812 381 34 363 379 571 605 494 170 991 19 352 208 606 64 9 506 130 818 781 675 923 749 509 551 543 348 263 256 455 423 581 36 485 289 409 413 143 108 792 53 668 631 66 487 54 734 661 281 44 826 294 571 905 57 649 526 970 54 917 314 465 46 403 551 564 413 474 720 136 169 999 557 865 488 965 549 802 319 51 758 950 488 196 223 885 737 707 215 698 928 292 926 51 497 353 470 235 211 366 990 380 85 439 668 448 429 992 914 61 408 654 648 767 165 314 779 832 354 496 672 671 108 297 609 696 408 330 723 543 700 328 82 836 636 836 81 788 382 213 338 427 178 34 78 755 369 985 653 900 36 363 441 908 994 563 538 202 786 652 671 902 164 700 154 713 105 534 949 225 328 359 844 642 734 86 418 220 962 291 538 798 208 428 485 375 83 992 95 292 185 727 182 229 600 502 624 448 702 51 219 614 296 580 649 15…
Output: 129

Example 2:

Input: 733 785 708 591 47 182 29 222 162 66 174 586 950 975 870 695 510 372 992 704 897 570 506 621 477 964 814 857 541 997 262 842 690 726 781 830 930 977 881 332 960 709 335 880 576 430 963 392 142 113 426 149 374 705 928 76 831 861 182 128 553 723 224 301 751 779 920 900 138 585 139 944 435 902 106 495 563 761 697 552 552 530 30 405 156 39 390 443 340 415 602 956 284 729 370 734 114 380 979 318 148 487 590 799 160 189 254 320 145 672 542 561 411 136 264 212 936 523 35 28 79 198 50 744 606 639 243 725 531 778 770 249 371 359 232 361 968 730 329 236 163 344 163 262 524 745 329 64 285 142 415 550 177 511 274 543 83 519 330 133 209 301 547 352 929 153 519 818 896 222 838 4 925 667 1000 571 254 50 448 888 721 832 384 503 49 16 579 255 57 99 826 314 165 907 874 950 20 182 264 57 645 234 71 359 660 5…
Output: 152

Example 3:

Input: 298 51 990 578 960 0 171 355 268 896 933 728 985 821 432 655 222 310 887 203 228 936 845 870 881 643 501 994 541 594 248 513 361 874 457 947 575 786 810 822 429 128 80 367 856 385 199 848 457 82 765 50 247 945 377 382 843 916 492 729 783 929 176 951 978 399 152 986 805 347 96 210 454 44 232 405 516 559 888 700 722 918 364 811 596 625 405 453 979 957 465 823 602 103 949 43 328 577 835 341 650 720 596 599 366 933 199 890 529 68 693 330 887 751 648 898 282 464 943 435 551 602 271 516 987 747 385 659 198 155 453 72 256 878 538 487 504 932 980 497 63 480 493 399 243 673 28 779 349 827 747 629 256 731 226 863 35 239 528 101 523 433 295 954 583 125 743 564 96 623 130 107 680 932 359 132 122 928 827 20 877 454 677 170 228 727 161 522 83 637 497 932 762 206 758 554 61 325 460 171 980 693 445 238 17…
Output: 283

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Beryl crates Dominant Values - EASY Coding Problem | CodeTikki