Submission #645558

#TimeUsernameProblemLanguageResultExecution timeMemory
645558VanillaNoM (RMI21_nom)C++17
9 / 100
1093 ms296 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int64; int main() { int n,m; cin >> n >> m; vector <int> v(2 * n); for (int i = 0; i < n * 2; i++){ v[i] = i; } int rs = 0; do { bool f = 1; int p[2 * n] = {}; for (int i = 0; i < n * 2; i++){ p[v[i]] = i; } for (int i = 0; i < n; i++){ if (abs(p[i] - p[i + n]) % m == 0) f = 0; } rs+=f; } while (next_permutation(v.begin(), v.end())); cout << rs << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...