Submission #411091

# Submission time Handle Problem Language Result Execution time Memory
411091 2021-05-24T10:48:26 Z 반딧불(#7588) Asceticism (JOI18_asceticism) C++17
4 / 100
600 ms 392 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, k;
int ans;
vector<int> v;

int main(){
    scanf("%d %d", &n, &k); k--;
    for(int i=1; i<=n; i++) v.push_back(i);
    do {
        int cnt = 0;
        for(int i=0; i<n-1; i++) if(v[i] > v[i+1]) cnt++;
        if(cnt==k) ans++;
    } while(next_permutation(v.begin(), v.end()));
    printf("%d", ans);
}

Compilation message

asceticism.cpp: In function 'int main()':
asceticism.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d %d", &n, &k); k--;
      |     ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 75 ms 276 KB Output is correct
3 Correct 66 ms 268 KB Output is correct
4 Correct 59 ms 204 KB Output is correct
5 Correct 64 ms 268 KB Output is correct
6 Correct 2 ms 296 KB Output is correct
7 Correct 10 ms 292 KB Output is correct
8 Correct 1 ms 392 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 75 ms 276 KB Output is correct
3 Correct 66 ms 268 KB Output is correct
4 Correct 59 ms 204 KB Output is correct
5 Correct 64 ms 268 KB Output is correct
6 Correct 2 ms 296 KB Output is correct
7 Correct 10 ms 292 KB Output is correct
8 Correct 1 ms 392 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Execution timed out 1081 ms 204 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 75 ms 276 KB Output is correct
3 Correct 66 ms 268 KB Output is correct
4 Correct 59 ms 204 KB Output is correct
5 Correct 64 ms 268 KB Output is correct
6 Correct 2 ms 296 KB Output is correct
7 Correct 10 ms 292 KB Output is correct
8 Correct 1 ms 392 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Execution timed out 1081 ms 204 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 75 ms 276 KB Output is correct
3 Correct 66 ms 268 KB Output is correct
4 Correct 59 ms 204 KB Output is correct
5 Correct 64 ms 268 KB Output is correct
6 Correct 2 ms 296 KB Output is correct
7 Correct 10 ms 292 KB Output is correct
8 Correct 1 ms 392 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Execution timed out 1081 ms 204 KB Time limit exceeded
12 Halted 0 ms 0 KB -