Subscribed unsubscribe Subscribe Subscribe

0w1

Hi everyone, please feel free to have discussions with me!

CFR 303 A. Lucky Permutation Triple ( Math, Modulo )

Problem - 303A - Codeforces題意: 求長度為 N 的三個排列 A, B, C,使得所有 ( A[ i ] + B[ i ] ) % N = C[ i ]。若無解輸出 - 1。資料規模: N ≤ 1e5解法: 先算一下總和:Sigma( i % N, for all 0 ≤ i 時間 / 空間複雜度: O( N ) #include <bits/stdc++.h> using names</bits/stdc++.h>…