cf/mirror

Equal Multisets (Hard Version)

CF
2211C21800· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
5 5
1 2 3 4 5
3 1 5 2 4
5 2
1 2 1 2 1
2 -1 -1 -1 -1
6 1
5 6 2 2 4 3
5 -1 -1 2 -1 3
2 1
1 2
2 -1
6 4
1 2 3 4 1 2
2 -1 3 -1 4 -1
Output
YES
YES
YES
NO
NO
2211C2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…