Submission #47471

#TimeUsernameProblemLanguageResultExecution timeMemory
47471mirbek01Asceticism (JOI18_asceticism)C++17
4 / 100
1071 ms672 KiB
# include <bits/stdc++.h> using namespace std; const int N = 1e5 + 2; int n, k, a[N], ans; int main(){ cin >> n >> k; for(int i = 1; i <= n; i ++) a[i] = i; do{ int cn = 1; for(int i = 2; i <= n; i ++){ if(a[i] < a[i - 1]) cn ++; } if(cn == k) ans ++; } while(next_permutation(a + 1, a + n + 1)); cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...