Submission #228382

# Submission time Handle Problem Language Result Execution time Memory
228382 2020-04-30T21:02:53 Z blacktulip Bali Sculptures (APIO15_sculpture) C++17
21 / 100
11 ms 8704 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define int long long
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(int i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

int n,m,b[li],a[li],k,flag,t,x,y,PS[li],dp[102][102][102];
int cev;
string s;
vector<int> v;

inline int f(int sira,int son,int hak){
	int cevv=inf;
	if(hak>y)return inf;
	if(sira>n){
		if(hak<x)return inf;
		return 0;
	}
	if(~dp[sira][son][hak])return dp[sira][son][hak];
	if(sira!=n)cevv=min(cevv,f(sira+1,son,hak));
	cevv=min(cevv,(f(sira+1,sira,hak+1)|(PS[sira]-PS[son])));
	return dp[sira][son][hak]=cevv;
}

main(void){
	memset(dp,-1,sizeof(dp));
	scanf("%lld %lld %lld",&n,&x,&y);
	for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	FOR PS[i]=PS[i-1]+a[i];
	printf("%lld\n",f(1,0,0));
	return 0;
}

Compilation message

sculpture.cpp:44:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(void){
          ^
sculpture.cpp: In function 'int main()':
sculpture.cpp:46:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld %lld",&n,&x,&y);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:47:28: 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]);
                       ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8576 KB Output is correct
2 Correct 9 ms 8576 KB Output is correct
3 Correct 8 ms 8576 KB Output is correct
4 Correct 9 ms 8576 KB Output is correct
5 Correct 9 ms 8576 KB Output is correct
6 Correct 8 ms 8576 KB Output is correct
7 Correct 8 ms 8576 KB Output is correct
8 Correct 9 ms 8576 KB Output is correct
9 Correct 9 ms 8576 KB Output is correct
10 Correct 9 ms 8576 KB Output is correct
11 Correct 9 ms 8704 KB Output is correct
12 Correct 9 ms 8576 KB Output is correct
13 Correct 9 ms 8704 KB Output is correct
14 Correct 9 ms 8704 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 8 ms 8576 KB Output is correct
17 Correct 9 ms 8576 KB Output is correct
18 Correct 8 ms 8576 KB Output is correct
19 Correct 8 ms 8576 KB Output is correct
20 Correct 8 ms 8704 KB Output is correct
21 Incorrect 9 ms 8704 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8704 KB Output is correct
2 Correct 8 ms 8704 KB Output is correct
3 Correct 9 ms 8704 KB Output is correct
4 Correct 9 ms 8704 KB Output is correct
5 Correct 9 ms 8704 KB Output is correct
6 Correct 9 ms 8704 KB Output is correct
7 Correct 9 ms 8576 KB Output is correct
8 Correct 8 ms 8704 KB Output is correct
9 Correct 8 ms 8576 KB Output is correct
10 Correct 9 ms 8576 KB Output is correct
11 Correct 9 ms 8576 KB Output is correct
12 Correct 8 ms 8576 KB Output is correct
13 Correct 9 ms 8576 KB Output is correct
14 Correct 9 ms 8576 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 8 ms 8704 KB Output is correct
17 Correct 8 ms 8576 KB Output is correct
18 Correct 8 ms 8704 KB Output is correct
19 Correct 8 ms 8704 KB Output is correct
20 Correct 8 ms 8576 KB Output is correct
21 Incorrect 9 ms 8576 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8704 KB Output is correct
2 Correct 8 ms 8576 KB Output is correct
3 Correct 9 ms 8576 KB Output is correct
4 Correct 8 ms 8576 KB Output is correct
5 Correct 9 ms 8576 KB Output is correct
6 Correct 9 ms 8576 KB Output is correct
7 Correct 8 ms 8704 KB Output is correct
8 Correct 9 ms 8576 KB Output is correct
9 Correct 9 ms 8576 KB Output is correct
10 Correct 9 ms 8576 KB Output is correct
11 Correct 8 ms 8576 KB Output is correct
12 Correct 9 ms 8704 KB Output is correct
13 Correct 9 ms 8704 KB Output is correct
14 Correct 8 ms 8576 KB Output is correct
15 Correct 8 ms 8704 KB Output is correct
16 Correct 9 ms 8576 KB Output is correct
17 Correct 9 ms 8576 KB Output is correct
18 Correct 9 ms 8704 KB Output is correct
19 Correct 9 ms 8704 KB Output is correct
20 Correct 9 ms 8704 KB Output is correct
21 Correct 9 ms 8704 KB Output is correct
22 Correct 9 ms 8680 KB Output is correct
23 Correct 8 ms 8576 KB Output is correct
24 Correct 9 ms 8576 KB Output is correct
25 Correct 9 ms 8704 KB Output is correct
26 Correct 9 ms 8576 KB Output is correct
27 Correct 10 ms 8576 KB Output is correct
28 Correct 11 ms 8576 KB Output is correct
29 Correct 11 ms 8576 KB Output is correct
30 Correct 9 ms 8576 KB Output is correct
31 Correct 10 ms 8576 KB Output is correct
32 Correct 10 ms 8704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 8664 KB Output is correct
2 Correct 8 ms 8576 KB Output is correct
3 Correct 8 ms 8576 KB Output is correct
4 Correct 9 ms 8576 KB Output is correct
5 Correct 10 ms 8576 KB Output is correct
6 Correct 8 ms 8576 KB Output is correct
7 Correct 9 ms 8576 KB Output is correct
8 Correct 8 ms 8576 KB Output is correct
9 Correct 8 ms 8704 KB Output is correct
10 Correct 9 ms 8576 KB Output is correct
11 Correct 8 ms 8576 KB Output is correct
12 Correct 9 ms 8576 KB Output is correct
13 Correct 8 ms 8576 KB Output is correct
14 Correct 9 ms 8576 KB Output is correct
15 Correct 8 ms 8576 KB Output is correct
16 Correct 9 ms 8576 KB Output is correct
17 Correct 8 ms 8576 KB Output is correct
18 Correct 8 ms 8704 KB Output is correct
19 Correct 8 ms 8576 KB Output is correct
20 Correct 9 ms 8576 KB Output is correct
21 Incorrect 8 ms 8576 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 8576 KB Output is correct
2 Correct 8 ms 8576 KB Output is correct
3 Correct 9 ms 8576 KB Output is correct
4 Correct 8 ms 8576 KB Output is correct
5 Correct 9 ms 8576 KB Output is correct
6 Correct 9 ms 8576 KB Output is correct
7 Correct 9 ms 8576 KB Output is correct
8 Correct 8 ms 8576 KB Output is correct
9 Correct 9 ms 8576 KB Output is correct
10 Correct 9 ms 8576 KB Output is correct
11 Correct 9 ms 8576 KB Output is correct
12 Correct 9 ms 8704 KB Output is correct
13 Correct 8 ms 8576 KB Output is correct
14 Correct 9 ms 8704 KB Output is correct
15 Correct 9 ms 8576 KB Output is correct
16 Correct 8 ms 8704 KB Output is correct
17 Correct 9 ms 8576 KB Output is correct
18 Incorrect 9 ms 8576 KB Output isn't correct
19 Halted 0 ms 0 KB -