Submission #47471

# Submission time Handle Problem Language Result Execution time Memory
47471 2018-05-03T10:54:20 Z mirbek01 Asceticism (JOI18_asceticism) C++17
4 / 100
600 ms 672 KB
# 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 time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 51 ms 488 KB Output is correct
3 Correct 50 ms 488 KB Output is correct
4 Correct 50 ms 488 KB Output is correct
5 Correct 52 ms 520 KB Output is correct
6 Correct 2 ms 536 KB Output is correct
7 Correct 7 ms 536 KB Output is correct
8 Correct 2 ms 672 KB Output is correct
9 Correct 2 ms 672 KB Output is correct
10 Correct 2 ms 672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 51 ms 488 KB Output is correct
3 Correct 50 ms 488 KB Output is correct
4 Correct 50 ms 488 KB Output is correct
5 Correct 52 ms 520 KB Output is correct
6 Correct 2 ms 536 KB Output is correct
7 Correct 7 ms 536 KB Output is correct
8 Correct 2 ms 672 KB Output is correct
9 Correct 2 ms 672 KB Output is correct
10 Correct 2 ms 672 KB Output is correct
11 Execution timed out 1071 ms 672 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 51 ms 488 KB Output is correct
3 Correct 50 ms 488 KB Output is correct
4 Correct 50 ms 488 KB Output is correct
5 Correct 52 ms 520 KB Output is correct
6 Correct 2 ms 536 KB Output is correct
7 Correct 7 ms 536 KB Output is correct
8 Correct 2 ms 672 KB Output is correct
9 Correct 2 ms 672 KB Output is correct
10 Correct 2 ms 672 KB Output is correct
11 Execution timed out 1071 ms 672 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 51 ms 488 KB Output is correct
3 Correct 50 ms 488 KB Output is correct
4 Correct 50 ms 488 KB Output is correct
5 Correct 52 ms 520 KB Output is correct
6 Correct 2 ms 536 KB Output is correct
7 Correct 7 ms 536 KB Output is correct
8 Correct 2 ms 672 KB Output is correct
9 Correct 2 ms 672 KB Output is correct
10 Correct 2 ms 672 KB Output is correct
11 Execution timed out 1071 ms 672 KB Time limit exceeded
12 Halted 0 ms 0 KB -