CT22606

The Shared Marks of Serpentis

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the jade shrine of Serpentis. Clerk spreads the weights records across the table and picks up a sharp pencil. 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 <= 408; -1000000 <= a[i],x <= 1000.

Example 1:

Input: 7 205 -928482 -139203 -820530 -75285 -534721 -154651 -450314 -820077 -409927 -881468 -203720 -686603 -603021 -53609 -268654 -14963 -380935 -147646 -632946 -368461 -406645 -469981 -522786 -409287 -304370 -639536 -69621 -544760 -213535 -394819 -755987 -556118 -886063 -968634 -821176 -782258 -298270 -991228 -741728 -696968 -454571 -420587 -968562 -159555 -922349 -494242 -635607 -797859 -932108 -78051 -910072 -653561 -635827 -294956 -655209 -364884 -183660 915 -64934 -945923 -157790 -792044 -209202 -85377 -875092 -898071 -918497 -211981 -813708 -564121 -317308 -115843 -929876 -694317 -783052 -196227 -854604 -734513 -746151 -397758 -849216 -986939 -528478 -724726 -357609 -604652 -844415 -277281 -374495 -327517 -711147 -703856 -176546 -596018 -3927 -963653 -776813 -683967 -71267 -569024 -190450 …
Output: 0

Example 2:

Input: 306 306 -182808 -616931 -830571 -852300 -653092 -980440 -737876 -636604 -814162 -640232 -730420 -239640 -857768 -206770 -990744 -410090 -126562 -918140 -483152 -636896 -176253 -696410 -621778 -70266 -198026 -870474 -254498 -797651 -647398 -534403 -640998 -708391 -44419 -598694 -324646 -456131 -246090 -834771 -444909 -538624 -610843 -243073 -584437 -563402 -303512 -498879 -746948 -817362 -710900 -924029 -6785 -217690 -797734 -863676 -751425 -54580 -930014 -107004 -421792 -954526 -449534 -799207 -1588 -498191 -955243 -705328 -773726 -760063 -263779 -151624 -710329 -821717 -615265 -318431 -380870 -122020 -459729 -685707 -78167 -711492 -513559 -336123 -75632 -165206 -805531 -515517 -631331 -191437 -632453 -612004 -339752 -679944 -935308 -799863 -600607 -257638 -797525 -756798 -258709 -239257 -…
Output: 0

Example 3:

Input: 216 162 -284141 -632257 -747578 -899848 -273324 -877452 -691929 -803724 -828601 -598456 -971850 -823319 -319145 -511551 -638217 -659245 -442079 -454651 -667557 -493962 -579463 -665101 -764555 -597056 -14398 -677961 -140570 -124440 -885402 -482937 -476446 -411581 -489883 -361887 -758157 -857577 -12646 -539400 -820070 -192268 -900498 -186984 -923686 -724746 -968042 -241145 -345801 -604553 -999876 -202660 -655719 -243357 -126712 -768894 -748448 -806874 -155664 -889526 -407647 -269764 -364604 -640907 -14901 -179249 -912524 -821215 -173399 -767151 -135466 -391841 -263757 -686510 -270079 -301813 -232330 -577929 -746338 -895744 -568282 -646224 -200099 -195632 -716826 -862631 -170906 -496167 -931842 -407719 -237845 -811161 -553485 -281768 -765513 -898245 -74431 -503042 -68162 -641463 -790161 -5924…
Output: 0

Constraints:

1 <= n <= 408; -1000000 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
The Shared Marks of Serpentis - EASY Coding Problem | CodeTikki