#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);array.push_back(i);
}
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]==array[i]){
goto fail;
}
}
++count;
fail:{}
}while (std::next_permutation(array.begin(),array.end()));
for(int i=0;i!=N;++i){
count=(count*2)%MOD;
}
std::cout<<count<<"\n";
}
int main()
{
int N,M;
std::cin>>N>>M;
forca_bruta(N,M);
}
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |