Submission #597730

#TimeUsernameProblemLanguageResultExecution timeMemory
597730DeepessonNoM (RMI21_nom)C++17
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> const int MOD = 1e9+7; void forca_bruta(int N,int M){ std::vector<int> array; for(int i=0;i!=N;++i){ array.push_back((i*2)+1);array.push_back(i*2); } std::sort(array.begin(),array.end()); int count=0; do{ for(int i=0;i!=2*N;++i){ int p = i+M; if(p<2*N&&(array[p]/2)==(array[i]/2)){ goto fail; } } ++count; fail:{} }while (std::next_permutation(array.begin(),array.end())); std::cout<<count<<"\n"; } int main() { int N,M; std::cin>>N>>M; forca_bruta(N,M); }
#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...