문제 풀이/Codeforces
2020. 11. 25.
Codeforces Round #686 (Div. 3)
A - Special Permutation Problem - A - Codeforces codeforces.com \(n\)길이의 순열 \(a\)를 출력해야 하는데, 모든 인덱스에 대해 \(a_i \ne i\)를 만족해야 한다. 해설은 생략한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a; } int main() { ios::sync_with_stdio(0); cin.tie(0), c..