cf/mirror

Swap Dilemma

CF
1983D1700· expert1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
6
4
1 2 3 4
1 2 3 4
5
1 3 4 2 5
7 1 2 5 4
4
1 2 3 4
4 3 2 1
3
1 2 3
1 3 2
5
1 5 7 1000 4
4 1 7 5 1000
3
1 4 2
1 3 2
Output
YES
NO
YES
NO
NO
NO
1983D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)