0w1

Meet in the Middle

CFR 285 D. Permutation Sum ( Meet in the Middle, Search )

Problem - D - Codeforces題意: 問有多少 A, B, C 數列的組合,使得 ( A[ i ] + B[ i ] ) % N = C[ i ],且 A, B, C 都是 [ 0, N ) 的排列。資料規模: The single line contains integer n (1 ≤ n ≤ 16). TL: 1500 ms ML: 256 MB解法: 有用到這題的結論,…