cf/mirror

Cards and Joy

CF
999F2000· candidate master2s256 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 2
Input
4 3
1 3 2 8 5 5 8 2 2 8 5 2
1 2 2 5
2 6 7
Output
21
Sample 2of 2
Input
3 3
9 9 9 9 9 9 9 9 9
1 2 3
1 2 3
Output
0
999F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)