Submission #503705

#TimeUsernameProblemLanguageResultExecution timeMemory
503705StickfishNoM (RMI21_nom)C++17
9 / 100
1090 ms264 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; signed main() { int n, m; cin >> n >> m; vector<int> a(n * 2); for (int i = 0; i < n * 2; ++i) a[i] = i; vector<int> ca = a; int ans = 0; do { ++ans; for (int i = 0; i < 2 * n; i += 2) { if (a[i] % m == a[i + 1] % m) { //for (auto x : a) //cout << x << ' '; //cout << endl; --ans; break; } } next_permutation(a.begin(), a.end()); } while (ca != a); cout << ans << endl; }
#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...