# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
871037 | 2023-11-09T18:25:48 Z | Ahmed57 | NoM (RMI21_nom) | C++17 | 1 ms | 600 KB |
#include <bits/stdc++.h> using namespace std; signed main(){ ios_base::sync_with_stdio(false);cin.tie(0); int n,k; cin>>n>>k; vector<int>v; for(int i = 0;i<n;i++){ v.push_back(i);v.push_back(i+n); } long long ans = 0; do{ int la[n]= {0};bool ss = 1; for(int i = 0;i<v.size();i++){ if(la[v[i]%n]!=0){ if(abs((i+1)-la[v[i]%n])%k==0){ ss = 0; break; } } la[v[i]%n] = i+1; } ans+=ss; }while(next_permutation(v.begin(),v.end())); cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 600 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |