Submission #597760

#TimeUsernameProblemLanguageResultExecution timeMemory
597760ThegeekKnight16NoM (RMI21_nom)C++17
0 / 100
921 ms324 KiB
#include <bits/stdc++.h> using namespace std; vector<int> v; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N, M; cin >> N >> M; for (int i = 1; i <= 2*N; i++) v.push_back(i); int resp = 0; do { bool b = true; for (int i = 0; i < 2*N; i++) { for (int j = 0; j < 2*N; j++) { if (abs(v[j] - v[i]) != N) continue; if ((j - i) % M == 0) b = false; } } resp += b; } while (next_permutation(v.begin(), v.end())); cout << resp; }
#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...