# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
597731 |
2022-07-16T17:53:41 Z |
Deepesson |
NoM (RMI21_nom) |
C++17 |
|
0 ms |
212 KB |
#include <bits/stdc++.h>
const int MOD = 1e9+7;
void forca_bruta(int N,int M){
std::vector<int> array;
for(int i=1;i!=N+1;++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)std::cout<<array[i]<<" ";
// std::cout<<"\n";
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=(count+1)%MOD;
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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |