CT23237

Piper's Mossy Ledger

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Piper inherited the timber yard at the eel marshes of Slitherwick along with its curious bookkeeping system for crates. Time to make sense of it. Task: Print the number of distinct values that appear in both arrays. Input format: First line: n and m. Second line: n integers. Third line: m integers. Output format: Print the size of the intersection. Constraints: 1 <= n <= 642; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 620 386 -881907171 -387774073 -61024502 -547789472 -19611867 -491859584 -777637329 -346342300 -777796992 -545103705 -382418091 -795650019 -775135840 -495260317 -937490446 -870216676 -810585794 -507411650 -690855 -889123161 -148719043 -784612943 -736949819 -466342747 -984005766 -120131826 -316416790 -161177514 -29424513 -887230337 -321568269 -791194944 -938962815 -782545308 -422763745 -970414743 -932705186 -466534731 -500337507 -75559502 -447568659 -993879321 -837681435 -362325126 -309781876 -703897494 -611914727 -853072058 -525693601 -640944776 -40676118 -958401406 -313839252 -538521051 -266190235 -908446533 -454311545 -71388752 -439539310 -583558169 -438284130 -306504148 -335332777 -314569963 -930997404 -837519203 -719084497 -423160704 -651888507 -956236598 -983746985 -247072888 -37936091…
Output: 0

Example 2:

Input: 60 329 -838111995 -366606990 -347326333 -853903170 -803154376 -592480703 -487266905 -152841484 -964764474 -340515483 -248326749 -806183947 -504596864 -336824016 -854400837 -146098768 -711816665 -911066549 -766679050 -343313927 -732160780 -192888321 -688467351 -809789698 -880486191 -211233948 -403635764 -601049483 -296041970 -385382435 -546866662 -276054041 -264495467 -558080746 -268613653 -581792058 -655458074 -870324864 -117374466 -63352552 -802268081 -340640141 -902324495 -162411471 -144757518 -609051523 -663220924 -829458372 -829544709 -349093563 -897150417 -218601033 -408464594 -684062272 -880689204 -42917828 -301264466 -488312658 -246032796 -59160412 -883146556 -838169959 -586559218 -428627339 -503028472 -248593466 -766143882 -243747759 -192749013 -233126130 -838656100 -252182957 -600…
Output: 0

Example 3:

Input: 605 55 -937170303 -513449524 -550106179 -731700341 -694585854 -55877363 -39230443 -226607107 -42888969 -296229901 -55338430 -147620450 -487445166 -547546031 -687157952 -133917322 -535620233 -9997956 -267104095 -143093945 -15643143 -951560272 -762785177 -382970286 -175047531 -694390693 -637712577 -469436311 -491325033 -635738636 -91211131 -365766086 -45887563 -728472884 -216663812 -40283494 -446946350 -793765648 -692876879 -261121563 -541573166 -545668533 -633152492 -869021992 -774800568 -57305947 -215885079 -293369654 -75746098 -882102136 -337705727 -408583376 -325705031 -899369822 -189957426 -422535933 -649478087 -637178531 -103255368 -588856291 -299338965 -244246261 -687721265 -584847573 -254047186 -321152346 -899626539 -102883314 -645483369 -270319238 -441837708 -905888795 -717884548 -1…
Output: 0

Constraints:

1 <= n <= 642; -1000000000 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.