Submission #83251

# Submission time Handle Problem Language Result Execution time Memory
83251 2018-11-06T11:58:27 Z farukkastamonuda Bali Sculptures (APIO15_sculpture) C++14
21 / 100
207 ms 227616 KB
#include <bits/stdc++.h>
#define li 105
#define inf 1000000000000000009
#define md 1000000007
#define lo long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define iii pair< pair<int,int> ,int >
using namespace std;
int n,a,b;
lo int sum[li],A[li],dp[li][li][li][25];
lo int dfs(int sira,int l,int r,int gs){
	//printf("%d %d %d %d\n",sira,l,r,gs);
	lo int cev=inf;
	if(gs>b) return inf;
	if(sira==n+1){
		if(gs>=a)
			return (sum[n]-sum[l-1]);
		else return inf;
	}
	if(~dp[sira][l][r][gs]) return dp[sira][l][r][gs];
	cev=min(cev,dfs(sira+1,l,r+1,gs));
	if(sira<n)
		cev=min(cev,dfs(sira+1,r+1,r+1,gs+1)|(sum[r]-sum[l-1]));
	return dp[sira][l][r][gs]=cev;
}
int main(){
	memset(dp,-1,sizeof(dp));
	scanf("%d %d %d",&n,&a,&b);
	for(int i=1;i<=n;i++) {scanf("%lld",&A[i]);sum[i]=sum[i-1]+A[i];}
	lo int ty=dfs(1,1,1,1);
	printf("%lld\n",ty);	
	return 0;
}
//~ 6 1 3
//~ 8 1 2 1 5 4

Compilation message

sculpture.cpp: In function 'int main()':
sculpture.cpp:31:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d",&n,&a,&b);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:32:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1;i<=n;i++) {scanf("%lld",&A[i]);sum[i]=sum[i-1]+A[i];}
                         ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 182 ms 226828 KB Output is correct
2 Correct 183 ms 226944 KB Output is correct
3 Correct 182 ms 226976 KB Output is correct
4 Correct 180 ms 226976 KB Output is correct
5 Correct 177 ms 226996 KB Output is correct
6 Correct 176 ms 226996 KB Output is correct
7 Correct 177 ms 227076 KB Output is correct
8 Correct 189 ms 227088 KB Output is correct
9 Correct 180 ms 227088 KB Output is correct
10 Correct 178 ms 227140 KB Output is correct
11 Correct 179 ms 227140 KB Output is correct
12 Correct 179 ms 227140 KB Output is correct
13 Correct 179 ms 227204 KB Output is correct
14 Correct 203 ms 227208 KB Output is correct
15 Correct 184 ms 227208 KB Output is correct
16 Correct 178 ms 227208 KB Output is correct
17 Correct 185 ms 227208 KB Output is correct
18 Correct 189 ms 227208 KB Output is correct
19 Correct 196 ms 227208 KB Output is correct
20 Correct 176 ms 227208 KB Output is correct
21 Incorrect 182 ms 227208 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 181 ms 227208 KB Output is correct
2 Correct 183 ms 227208 KB Output is correct
3 Correct 183 ms 227208 KB Output is correct
4 Correct 179 ms 227232 KB Output is correct
5 Correct 185 ms 227232 KB Output is correct
6 Correct 182 ms 227280 KB Output is correct
7 Correct 180 ms 227280 KB Output is correct
8 Correct 177 ms 227308 KB Output is correct
9 Correct 180 ms 227312 KB Output is correct
10 Correct 185 ms 227312 KB Output is correct
11 Correct 179 ms 227312 KB Output is correct
12 Correct 185 ms 227324 KB Output is correct
13 Correct 182 ms 227324 KB Output is correct
14 Correct 179 ms 227324 KB Output is correct
15 Correct 181 ms 227324 KB Output is correct
16 Correct 185 ms 227340 KB Output is correct
17 Correct 184 ms 227420 KB Output is correct
18 Correct 188 ms 227420 KB Output is correct
19 Correct 186 ms 227420 KB Output is correct
20 Correct 183 ms 227420 KB Output is correct
21 Incorrect 190 ms 227472 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 188 ms 227472 KB Output is correct
2 Correct 181 ms 227472 KB Output is correct
3 Correct 182 ms 227472 KB Output is correct
4 Correct 195 ms 227472 KB Output is correct
5 Correct 177 ms 227472 KB Output is correct
6 Correct 183 ms 227472 KB Output is correct
7 Correct 177 ms 227472 KB Output is correct
8 Correct 184 ms 227472 KB Output is correct
9 Correct 177 ms 227472 KB Output is correct
10 Correct 179 ms 227472 KB Output is correct
11 Correct 180 ms 227472 KB Output is correct
12 Correct 178 ms 227472 KB Output is correct
13 Correct 183 ms 227472 KB Output is correct
14 Correct 196 ms 227472 KB Output is correct
15 Correct 185 ms 227472 KB Output is correct
16 Correct 204 ms 227472 KB Output is correct
17 Correct 186 ms 227472 KB Output is correct
18 Correct 178 ms 227472 KB Output is correct
19 Correct 184 ms 227472 KB Output is correct
20 Correct 182 ms 227472 KB Output is correct
21 Correct 176 ms 227472 KB Output is correct
22 Correct 189 ms 227472 KB Output is correct
23 Correct 191 ms 227472 KB Output is correct
24 Correct 179 ms 227472 KB Output is correct
25 Correct 183 ms 227472 KB Output is correct
26 Correct 184 ms 227472 KB Output is correct
27 Correct 184 ms 227472 KB Output is correct
28 Correct 196 ms 227472 KB Output is correct
29 Correct 196 ms 227520 KB Output is correct
30 Correct 181 ms 227520 KB Output is correct
31 Correct 184 ms 227520 KB Output is correct
32 Correct 194 ms 227520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 188 ms 227520 KB Output is correct
2 Correct 191 ms 227520 KB Output is correct
3 Correct 185 ms 227520 KB Output is correct
4 Correct 184 ms 227520 KB Output is correct
5 Correct 207 ms 227520 KB Output is correct
6 Correct 188 ms 227520 KB Output is correct
7 Correct 189 ms 227520 KB Output is correct
8 Correct 185 ms 227520 KB Output is correct
9 Correct 183 ms 227520 KB Output is correct
10 Correct 191 ms 227520 KB Output is correct
11 Correct 191 ms 227520 KB Output is correct
12 Correct 184 ms 227524 KB Output is correct
13 Correct 183 ms 227524 KB Output is correct
14 Correct 197 ms 227524 KB Output is correct
15 Correct 186 ms 227524 KB Output is correct
16 Correct 178 ms 227524 KB Output is correct
17 Correct 184 ms 227544 KB Output is correct
18 Correct 185 ms 227544 KB Output is correct
19 Correct 185 ms 227544 KB Output is correct
20 Correct 195 ms 227544 KB Output is correct
21 Incorrect 190 ms 227544 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 187 ms 227544 KB Output is correct
2 Correct 187 ms 227544 KB Output is correct
3 Correct 196 ms 227560 KB Output is correct
4 Correct 182 ms 227560 KB Output is correct
5 Correct 186 ms 227568 KB Output is correct
6 Correct 186 ms 227572 KB Output is correct
7 Correct 184 ms 227572 KB Output is correct
8 Correct 183 ms 227572 KB Output is correct
9 Correct 186 ms 227572 KB Output is correct
10 Correct 190 ms 227572 KB Output is correct
11 Correct 200 ms 227572 KB Output is correct
12 Correct 189 ms 227600 KB Output is correct
13 Correct 194 ms 227600 KB Output is correct
14 Correct 188 ms 227600 KB Output is correct
15 Correct 188 ms 227600 KB Output is correct
16 Correct 202 ms 227608 KB Output is correct
17 Correct 188 ms 227608 KB Output is correct
18 Incorrect 186 ms 227616 KB Output isn't correct
19 Halted 0 ms 0 KB -