# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1077775 | 2024-08-27T09:04:20 Z | ntdaccode | K개의 묶음 (IZhO14_blocks) | C++17 | 1000 ms | 9072 KB |
#include<bits/stdc++.h> #define fori(i,a,b) for(int i=a;i<=b;i++) #define int long long #define ii pair<int,int> #define fi first #define se second #define pb push_back using namespace std; const int mod=1e9+7; const int M=1e4+10; const int N=1e3+10; int n,k,a[M],f[M][110]; int kq=0; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define task "1" if(fopen(task".inp","r")) { freopen(task".inp","r",stdin); freopen(task".out","w",stdout); } cin >> n >> k; fori(i,1,n) cin >> a[i]; memset(f,61,sizeof(f)); f[0][0]=0; fori(j,1,k) { fori(i,1,n) { int ma=0; for(int pos=i;pos!=0;pos--) { ma=max(ma,a[pos]); f[i][j]=min(f[i][j],f[pos-1][j-1]+ma); } } } cout << f[n][k] ; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 9052 KB | Output is correct |
2 | Correct | 4 ms | 9052 KB | Output is correct |
3 | Correct | 3 ms | 9052 KB | Output is correct |
4 | Correct | 3 ms | 8912 KB | Output is correct |
5 | Correct | 4 ms | 9052 KB | Output is correct |
6 | Correct | 3 ms | 9052 KB | Output is correct |
7 | Correct | 3 ms | 9052 KB | Output is correct |
8 | Correct | 4 ms | 8920 KB | Output is correct |
9 | Correct | 4 ms | 9052 KB | Output is correct |
10 | Correct | 3 ms | 9052 KB | Output is correct |
11 | Correct | 4 ms | 9052 KB | Output is correct |
12 | Correct | 4 ms | 9052 KB | Output is correct |
13 | Correct | 4 ms | 8912 KB | Output is correct |
14 | Correct | 5 ms | 9052 KB | Output is correct |
15 | Correct | 3 ms | 9052 KB | Output is correct |
16 | Correct | 3 ms | 9052 KB | Output is correct |
17 | Correct | 4 ms | 8908 KB | Output is correct |
18 | Correct | 4 ms | 9052 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 9052 KB | Output is correct |
2 | Correct | 4 ms | 8916 KB | Output is correct |
3 | Correct | 4 ms | 9052 KB | Output is correct |
4 | Correct | 5 ms | 9048 KB | Output is correct |
5 | Correct | 5 ms | 8996 KB | Output is correct |
6 | Correct | 4 ms | 9052 KB | Output is correct |
7 | Correct | 5 ms | 9052 KB | Output is correct |
8 | Correct | 5 ms | 9052 KB | Output is correct |
9 | Correct | 4 ms | 8900 KB | Output is correct |
10 | Correct | 3 ms | 8876 KB | Output is correct |
11 | Correct | 3 ms | 9052 KB | Output is correct |
12 | Correct | 3 ms | 9052 KB | Output is correct |
13 | Correct | 3 ms | 9052 KB | Output is correct |
14 | Correct | 3 ms | 9052 KB | Output is correct |
15 | Correct | 4 ms | 9052 KB | Output is correct |
16 | Correct | 3 ms | 8844 KB | Output is correct |
17 | Correct | 3 ms | 9052 KB | Output is correct |
18 | Correct | 4 ms | 9052 KB | Output is correct |
19 | Correct | 3 ms | 9048 KB | Output is correct |
20 | Correct | 3 ms | 9052 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 9052 KB | Output is correct |
2 | Correct | 4 ms | 9052 KB | Output is correct |
3 | Correct | 3 ms | 9052 KB | Output is correct |
4 | Correct | 3 ms | 8912 KB | Output is correct |
5 | Correct | 4 ms | 9052 KB | Output is correct |
6 | Correct | 3 ms | 9052 KB | Output is correct |
7 | Correct | 3 ms | 9052 KB | Output is correct |
8 | Correct | 4 ms | 8920 KB | Output is correct |
9 | Correct | 4 ms | 9052 KB | Output is correct |
10 | Correct | 3 ms | 9052 KB | Output is correct |
11 | Correct | 4 ms | 9052 KB | Output is correct |
12 | Correct | 4 ms | 9052 KB | Output is correct |
13 | Correct | 4 ms | 8912 KB | Output is correct |
14 | Correct | 5 ms | 9052 KB | Output is correct |
15 | Correct | 3 ms | 9052 KB | Output is correct |
16 | Correct | 3 ms | 9052 KB | Output is correct |
17 | Correct | 4 ms | 8908 KB | Output is correct |
18 | Correct | 4 ms | 9052 KB | Output is correct |
19 | Correct | 3 ms | 9052 KB | Output is correct |
20 | Correct | 4 ms | 8916 KB | Output is correct |
21 | Correct | 4 ms | 9052 KB | Output is correct |
22 | Correct | 5 ms | 9048 KB | Output is correct |
23 | Correct | 5 ms | 8996 KB | Output is correct |
24 | Correct | 4 ms | 9052 KB | Output is correct |
25 | Correct | 5 ms | 9052 KB | Output is correct |
26 | Correct | 5 ms | 9052 KB | Output is correct |
27 | Correct | 4 ms | 8900 KB | Output is correct |
28 | Correct | 3 ms | 8876 KB | Output is correct |
29 | Correct | 3 ms | 9052 KB | Output is correct |
30 | Correct | 3 ms | 9052 KB | Output is correct |
31 | Correct | 3 ms | 9052 KB | Output is correct |
32 | Correct | 3 ms | 9052 KB | Output is correct |
33 | Correct | 4 ms | 9052 KB | Output is correct |
34 | Correct | 3 ms | 8844 KB | Output is correct |
35 | Correct | 3 ms | 9052 KB | Output is correct |
36 | Correct | 4 ms | 9052 KB | Output is correct |
37 | Correct | 3 ms | 9048 KB | Output is correct |
38 | Correct | 3 ms | 9052 KB | Output is correct |
39 | Correct | 3 ms | 9052 KB | Output is correct |
40 | Correct | 4 ms | 8912 KB | Output is correct |
41 | Correct | 4 ms | 9052 KB | Output is correct |
42 | Correct | 3 ms | 8888 KB | Output is correct |
43 | Correct | 4 ms | 8912 KB | Output is correct |
44 | Correct | 4 ms | 9052 KB | Output is correct |
45 | Correct | 4 ms | 9052 KB | Output is correct |
46 | Correct | 5 ms | 9052 KB | Output is correct |
47 | Correct | 4 ms | 9052 KB | Output is correct |
48 | Correct | 3 ms | 9052 KB | Output is correct |
49 | Correct | 3 ms | 9052 KB | Output is correct |
50 | Correct | 4 ms | 9052 KB | Output is correct |
51 | Correct | 3 ms | 9048 KB | Output is correct |
52 | Correct | 4 ms | 9052 KB | Output is correct |
53 | Correct | 3 ms | 9052 KB | Output is correct |
54 | Correct | 3 ms | 8984 KB | Output is correct |
55 | Correct | 3 ms | 9052 KB | Output is correct |
56 | Correct | 6 ms | 8980 KB | Output is correct |
57 | Correct | 4 ms | 9052 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 9052 KB | Output is correct |
2 | Correct | 4 ms | 9052 KB | Output is correct |
3 | Correct | 3 ms | 9052 KB | Output is correct |
4 | Correct | 3 ms | 8912 KB | Output is correct |
5 | Correct | 4 ms | 9052 KB | Output is correct |
6 | Correct | 3 ms | 9052 KB | Output is correct |
7 | Correct | 3 ms | 9052 KB | Output is correct |
8 | Correct | 4 ms | 8920 KB | Output is correct |
9 | Correct | 4 ms | 9052 KB | Output is correct |
10 | Correct | 3 ms | 9052 KB | Output is correct |
11 | Correct | 4 ms | 9052 KB | Output is correct |
12 | Correct | 4 ms | 9052 KB | Output is correct |
13 | Correct | 4 ms | 8912 KB | Output is correct |
14 | Correct | 5 ms | 9052 KB | Output is correct |
15 | Correct | 3 ms | 9052 KB | Output is correct |
16 | Correct | 3 ms | 9052 KB | Output is correct |
17 | Correct | 4 ms | 8908 KB | Output is correct |
18 | Correct | 4 ms | 9052 KB | Output is correct |
19 | Correct | 3 ms | 9052 KB | Output is correct |
20 | Correct | 4 ms | 8916 KB | Output is correct |
21 | Correct | 4 ms | 9052 KB | Output is correct |
22 | Correct | 5 ms | 9048 KB | Output is correct |
23 | Correct | 5 ms | 8996 KB | Output is correct |
24 | Correct | 4 ms | 9052 KB | Output is correct |
25 | Correct | 5 ms | 9052 KB | Output is correct |
26 | Correct | 5 ms | 9052 KB | Output is correct |
27 | Correct | 4 ms | 8900 KB | Output is correct |
28 | Correct | 3 ms | 8876 KB | Output is correct |
29 | Correct | 3 ms | 9052 KB | Output is correct |
30 | Correct | 3 ms | 9052 KB | Output is correct |
31 | Correct | 3 ms | 9052 KB | Output is correct |
32 | Correct | 3 ms | 9052 KB | Output is correct |
33 | Correct | 4 ms | 9052 KB | Output is correct |
34 | Correct | 3 ms | 8844 KB | Output is correct |
35 | Correct | 3 ms | 9052 KB | Output is correct |
36 | Correct | 4 ms | 9052 KB | Output is correct |
37 | Correct | 3 ms | 9048 KB | Output is correct |
38 | Correct | 3 ms | 9052 KB | Output is correct |
39 | Correct | 3 ms | 9052 KB | Output is correct |
40 | Correct | 4 ms | 8912 KB | Output is correct |
41 | Correct | 4 ms | 9052 KB | Output is correct |
42 | Correct | 3 ms | 8888 KB | Output is correct |
43 | Correct | 4 ms | 8912 KB | Output is correct |
44 | Correct | 4 ms | 9052 KB | Output is correct |
45 | Correct | 4 ms | 9052 KB | Output is correct |
46 | Correct | 5 ms | 9052 KB | Output is correct |
47 | Correct | 4 ms | 9052 KB | Output is correct |
48 | Correct | 3 ms | 9052 KB | Output is correct |
49 | Correct | 3 ms | 9052 KB | Output is correct |
50 | Correct | 4 ms | 9052 KB | Output is correct |
51 | Correct | 3 ms | 9048 KB | Output is correct |
52 | Correct | 4 ms | 9052 KB | Output is correct |
53 | Correct | 3 ms | 9052 KB | Output is correct |
54 | Correct | 3 ms | 8984 KB | Output is correct |
55 | Correct | 3 ms | 9052 KB | Output is correct |
56 | Correct | 6 ms | 8980 KB | Output is correct |
57 | Correct | 4 ms | 9052 KB | Output is correct |
58 | Execution timed out | 1076 ms | 9072 KB | Time limit exceeded |
59 | Halted | 0 ms | 0 KB | - |