Submission #114111

#TimeUsernameProblemLanguageResultExecution timeMemory
114111SaboonAsceticism (JOI18_asceticism)C++14
4 / 100
1077 ms384 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[20]; int main(){ ios_base::sync_with_stdio(false); int n, k; cin >> n >> k; for (int i = 1; i <= n; i++) a[i] = i; int cnt = 0; do{ int p = 1; for (int i = 2; i <= n; i++) p += (a[i] < a[i - 1]); cnt += (p == k); }while (next_permutation(a + 1, a + n + 1)); cout << cnt << 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...