#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//4 pts: N <= 10
int main()
{
int N, K;
cin >> N >> K;
vector<int> X(N);
for(int i = 1; i <= N; i++) X[i-1] = i;
int res = 0;
int a;
while(next_permutation(X.begin(), X.end()))
{
a = 1;
for(int i = 1; i < N; i++) if(X[i-1] > X[i]) a++;
if(a == K) res++;
}
cout << res << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |