CT28621

Alaric's Wayward Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the mountain city of Highreach. Alaric spreads the readings records across the table and picks up a sharp pencil. 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 <= 486; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 237 535525 813611 268675 205829 548212 281094 727102 654137 11708 877643 321436 582336 874684 117801 614893 722689 453625 231283 746596 651961 308227 411602 129964 583826 46397 494742 704698 449807 361145 747223 826332 835338 105443 764749 14340 368608 142302 213699 32498 759270 167401 354338 987607 525344 285182 518834 243273 88710 214546 830563 905951 682900 868209 446225 196057 227504 298771 16536 201798 108971 38669 493462 390103 940529 299709 997252 426584 37474 377199 439706 985378 571129 505370 272705 269627 388179 410933 494711 493082 809606 675118 69444 973231 762612 765285 446851 17716 987094 506380 487417 596481 365770 434720 934577 289733 395724 258698 347394 445166 815399 574526 152758 743403 982614 549823 39997 525936 453809 299026 212085 118212 63733 82911 337516 158611 9018…
Output: 102

Example 2:

Input: 219 286507 939878 729874 765206 68022 720253 94296 514516 754507 944549 365663 361431 643497 253244 780250 588225 480906 600915 891937 271583 55610 778568 962268 914558 6232 644004 646883 68928 286531 234449 505609 624336 278345 818412 14493 288262 783739 633335 77804 765604 683333 330681 808562 502532 348467 957247 479245 341685 908277 291983 154795 162962 840574 731874 33118 349086 24054 843770 380032 967329 883790 541965 80036 578181 106344 756591 230623 546902 600392 887757 398737 780902 50550 676906 358958 343021 18430 335723 653983 269810 707309 121169 358094 871391 733363 792285 824622 823953 579178 388404 689053 629570 374291 939840 85948 710373 759627 168157 643133 354349 387967 528515 714423 330287 819603 981425 687475 998139 635748 258689 275006 534335 157905 438636 525275 40482…
Output: 159

Example 3:

Input: 292 180864 755076 772769 138030 838940 230060 28496 98692 687384 693305 329202 158484 732985 900973 669207 233973 227597 403997 570379 817098 517151 621154 211506 489274 323726 88027 20191 494828 757329 20423 927034 104996 652456 643547 252093 339521 240522 770276 234234 707481 8649 349871 210035 224339 732061 750789 823831 388660 565777 4283 670959 295047 465135 380854 942577 173053 478685 511529 848642 755899 126706 216763 387474 407124 490012 223035 100988 259614 373297 79715 396913 201785 161062 865253 452575 790357 35914 910076 776526 743411 321139 844077 99565 5219 411569 153754 299625 531409 846706 777814 286505 319285 907181 128388 815764 216288 690430 260250 783523 340109 535246 955702 756816 307165 813575 941384 871809 553575 278362 805297 343510 571360 900348 729321 751218 38599…
Output: 243

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Alaric's Wayward Ledger - EASY Coding Problem | CodeTikki