Card Pairing
1969F3000· legendary gm2s512 MB⌨ stdin/stdout
Examples
Sample 1of 8
Input
4 21 2 1 2
Output
0
Sample 2of 8
Input
8 22 1 2 2 1 2 1 2
Output
1
Sample 3of 8
Input
4 41 2 1 2
Output
2
Sample 4of 8
Input
6 43 2 3 1 2 1
Output
3
Sample 5of 8
Input
6 43 2 3 3 2 1
Output
2
Sample 6of 8
Input
18 65 6 1 1 6 5 4 1 5 1 1 6 2 6 2 2 6 3
Output
6
Sample 7of 8
Input
8 41 2 3 4 4 3 1 2
Output
2
Sample 8of 8
Input
8 41 2 3 4 4 3 3 2
Output
3
58%
1969F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)