CT28112

Wade's Ledger of scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Wade the store warden watches over the canyon post of Redrock's stores of scrolls. A careful computation stands between order and chaos. Task: Read n integers and a target x; print how many times x occurs. Input format: First line: n and x. Second line: n space-separated integers. Output format: Print the number of occurrences of x. Constraints: 1 <= n <= 525; 0 <= a[i],x <= 1000000000.

Example 1:

Input: 250 719978209 153156733 453872803 903688884 328806886 535119939 221299877 499798843 901030815 275612328 463078067 393326196 849717848 706879572 132672910 758837558 7135731 980601038 86271095 90193795 609966437 867934908 653609168 680273311 993927043 282367760 250903466 289124312 773948514 158957702 899852762 586210678 166464895 58043256 282366490 910259879 860152003 55745382 602982552 159419932 38285227 301178445 693523286 781491682 12422664 950115733 408355766 676010971 558447357 251956320 805692379 381078977 610825415 317164604 87720695 528852641 266208399 692769414 778503204 731608042 938503354 909151024 569858002 281004206 75925582 141857016 206550242 744179014 649333509 667963578 73708251 682534220 379428051 633374371 187538768 328098630 278296008 340330804 455837578 336504803 7139417…
Output: 0

Example 2:

Input: 283 720121476 773504288 382106707 79723051 729067198 667147802 3105888 780251517 318804209 383572040 126592101 506772885 659979902 878064847 407172993 676912886 843572425 969594629 399818374 735279756 862247170 671250752 349696371 711135929 889101494 308313936 728446849 41761091 180814098 331251765 526243137 691957617 4611276 340298096 598613526 253415023 483270224 29458014 855407228 43708169 654792546 66131097 531622168 120798976 879521852 955488353 751389789 953321942 563296916 131313020 281293322 859909414 45619918 828451268 649977399 625661236 458255452 691168397 160609853 536414338 912570658 58006452 307446886 150805322 251887440 385509153 281500840 981058170 23053672 744024762 577474180 745006406 889805331 553908218 322463193 350943619 13159222 151327894 486245758 753818810 554714128…
Output: 0

Example 3:

Input: 323 651282081 677093179 911238913 212540857 945744173 40417999 453670419 342048872 738313737 402624309 464072315 459113950 143238066 856621799 238709208 500053099 213846069 519378636 402776481 883929686 479700581 35284708 260090855 380164678 714079230 271323290 32570716 773287833 39897801 796287208 508894525 949438366 458236548 52112469 653962341 263152292 401421667 397461038 818498002 857996753 680010208 543889272 459179147 680500030 683902495 833642271 361727126 373487092 176763927 604155320 935356377 398744961 193196699 477406520 782554097 378023434 513395786 404854352 346023909 385650359 721931145 643440047 293610623 328908209 478793742 486176434 471065814 261801901 998685633 351507846 821722470 132053212 862615345 477728206 807766912 943878352 499305195 811046232 154136985 40502132 10…
Output: 0

Constraints:

1 <= n <= 525; 0 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Wade's Ledger of scrolls - EASY Coding Problem | CodeTikki