CT26326

Last crates of Tomas

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the ivy courts of Vineward with crates of crates, and Tomas the ledger master must account for every last one. 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 <= 841; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 209 784 403469599 173665461 740905537 228120535 425909943 609027207 267276935 652850225 822439137 132972716 209681793 670341718 261354841 525993669 398473595 666054660 780270150 770312564 851621656 467539250 783900411 170556608 395568400 879075358 327146374 339516973 263094188 536508413 183295894 416543362 391578490 326639101 876383236 17083723 299426535 50864859 63599803 760273221 535242821 246596737 298184018 241678239 545345301 580975028 249288043 915271920 174644270 448367906 49152667 822029019 431745647 695076185 960275072 821880453 855206829 43443716 162945979 980436512 98081302 357456959 646140032 635820995 235882577 639813921 628238245 88964259 491712715 983190646 201357190 188216502 146118499 191836370 849529969 838767781 623918201 232025221 54920374 245846550 439284006 369102416 …
Output: 0

Example 2:

Input: 82 559 157518969 605412540 169841328 218998665 858307802 14697700 818556165 614718927 162978268 742368887 592175884 247203826 469198382 521546567 716921812 777939463 684803022 943138987 620631689 163452877 852982632 673984512 59534688 591217369 946274280 96356242 228249808 68133988 600622150 466441396 220032815 527486181 611460580 10115478 339816995 288385478 32488837 328315583 663570 83543284 409677725 438984825 789833888 35582187 491318474 649149868 609465506 52407934 191272891 144312965 48871340 245178617 977826861 51009084 605980094 745311302 532320085 516207936 263953481 933747885 840269108 415335251 550776701 272932612 630594509 561962442 748438802 658607089 246573715 264202529 847772349 66041726 417907349 369204791 251075978 809183177 424007352 457776022 186914190 187284991 22587832…
Output: 0

Example 3:

Input: 379 140 489420126 596615593 858984182 816775680 182053189 403733171 81896401 7132351 383380446 635792565 259864656 67445820 962370211 648125787 186110203 177043331 752617839 594602345 345529269 508279604 476604992 441205538 92496251 622234854 206432238 333909891 745436746 978407046 528494419 76357396 770964201 677594614 887635084 8749545 58224977 156582964 588541156 409348121 219295439 111324470 975192203 30193488 262955780 909948379 271676025 891738152 905713335 237807024 308029059 579742153 133050232 868713284 560362705 107779196 748498704 520831135 294711 70443378 78082469 282424813 393662811 988455274 326237438 157407453 258853570 405499534 274675891 820573480 119705757 703737209 569845269 976465808 492645553 819436710 107532615 682261289 142108591 853617613 481588689 639119138 1036954…
Output: 0

Constraints:

1 <= n <= 841; -1000000 <= a[i],x <= 1000000000.

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