CT23752

Indu's Ledger of weights

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the wheat plains of Amberfield close for winter, Indu must finish the weights ledger - one figure at a time. 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 <= 651; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 266 394 672492441 268846090 782472297 501556121 141502333 48111232 34165107 612208716 895256982 981503874 919328926 608265036 659727644 672389246 602838148 103737067 344842577 921926213 833208460 456720564 330738281 428325564 412874589 965586311 625351200 245741370 612370727 713492455 920519209 216989269 94670681 67939009 677995829 861850950 264896758 871263944 629555332 386738365 353913956 878166746 653100321 836892920 323512976 667225531 666746048 963068988 121507199 220000278 319294157 279887271 769234766 542537054 73392364 747542990 960055819 439064221 755077700 563531021 905593834 478596324 841510320 25324999 658248122 766899155 517072520 263760508 707264332 687555126 791848460 395384248 504616368 9538547 532064109 638103709 471443626 788140458 502395396 926361917 851001130 423125637 …
Output: 0

Example 2:

Input: 496 540 168797706 265577728 785591522 123821416 257621565 758478736 617698283 12137652 736648194 524429756 562967436 820823588 705732244 883801135 695998010 584630566 54800687 517116146 951146130 282435906 835089936 445662232 461286643 727418351 484912166 234018118 239064857 754375175 90370598 557936758 546461525 269321242 117356533 996925898 946412212 52437527 898899412 61276090 701023300 226364331 397748711 681283653 213333980 334010382 192707516 515959447 925888421 492923339 667588452 299809934 564088154 540257570 222030270 846516920 767171684 696615655 132521416 378841686 744969186 634841153 29780681 275619791 40083606 12155312 390150384 232672377 83312373 252362502 371285289 933790979 128093429 446391545 250075074 150440432 987276708 953495024 166663771 264980685 992457382 602834922 1…
Output: 0

Example 3:

Input: 539 474 452245916 483816189 100757116 718584219 539287835 821214964 639091716 844092943 386305599 472212006 105802652 799391977 553653147 430897525 396566863 486387356 976343249 631684365 979305888 720642690 432859726 217315157 78388972 970975095 754754419 48378579 706392356 476182108 387139575 416025236 428557793 721696046 716340408 357995635 148108562 593912226 257786976 484821664 824964929 98653204 522611920 464262120 612821478 477839711 42607518 161866915 406488081 539736269 584599279 676274794 649176569 407414442 542156557 354507132 908989260 423905143 45490562 850785742 540142299 430347277 92538134 50631095 209116010 226554133 90500450 834184431 988934661 721737247 426493758 333892168 115101541 641958965 222394670 889683027 217796325 259045654 518044873 444432723 412707671 182789624 …
Output: 0

Constraints:

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

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