Submission #201998

# Submission time Handle Problem Language Result Execution time Memory
201998 2020-02-13T02:52:56 Z mdn2002 Bali Sculptures (APIO15_sculpture) C++14
21 / 100
27 ms 33528 KB
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
long long n,y[2050],dp[2050][2050],a,b;
long long f(int x,int g)
{
    if(x==n&&a<=g&&g<=b)return 0;
    if(x==n)return 1e18;
    if(dp[x][g]!=-1)return dp[x][g];
    long long ans=1e18,sum=0;
    for(int i=x;i<n;i++)
    {
        sum+=y[i];
        ans=min(ans,(f(i+1,g+1)|sum));
    }
    return dp[x][g]=ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen("empty.in","r",stdin);
    //freopen("empty.out","w",stdout);
    memset(dp,-1,sizeof dp);
    cin>>n>>a>>b;
    for(int i=0;i<n;i++)cin>>y[i];
    long long ans=f(0,0);
    cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33276 KB Output is correct
2 Correct 23 ms 33272 KB Output is correct
3 Correct 24 ms 33144 KB Output is correct
4 Correct 25 ms 33272 KB Output is correct
5 Correct 24 ms 33272 KB Output is correct
6 Correct 24 ms 33272 KB Output is correct
7 Correct 24 ms 33272 KB Output is correct
8 Correct 24 ms 33272 KB Output is correct
9 Correct 23 ms 33144 KB Output is correct
10 Correct 23 ms 33272 KB Output is correct
11 Correct 24 ms 33272 KB Output is correct
12 Correct 23 ms 33272 KB Output is correct
13 Correct 22 ms 33272 KB Output is correct
14 Correct 26 ms 33272 KB Output is correct
15 Correct 22 ms 33272 KB Output is correct
16 Correct 24 ms 33272 KB Output is correct
17 Correct 25 ms 33272 KB Output is correct
18 Correct 23 ms 33176 KB Output is correct
19 Correct 23 ms 33272 KB Output is correct
20 Correct 23 ms 33272 KB Output is correct
21 Incorrect 24 ms 33272 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 33272 KB Output is correct
2 Correct 23 ms 33272 KB Output is correct
3 Correct 23 ms 33272 KB Output is correct
4 Correct 23 ms 33272 KB Output is correct
5 Correct 23 ms 33272 KB Output is correct
6 Correct 24 ms 33272 KB Output is correct
7 Correct 24 ms 33268 KB Output is correct
8 Correct 23 ms 33400 KB Output is correct
9 Correct 23 ms 33272 KB Output is correct
10 Correct 23 ms 33272 KB Output is correct
11 Correct 23 ms 33272 KB Output is correct
12 Correct 23 ms 33284 KB Output is correct
13 Correct 23 ms 33272 KB Output is correct
14 Correct 23 ms 33272 KB Output is correct
15 Correct 23 ms 33272 KB Output is correct
16 Correct 23 ms 33276 KB Output is correct
17 Correct 23 ms 33272 KB Output is correct
18 Correct 23 ms 33272 KB Output is correct
19 Correct 23 ms 33272 KB Output is correct
20 Correct 23 ms 33272 KB Output is correct
21 Incorrect 23 ms 33272 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 33272 KB Output is correct
2 Correct 24 ms 33272 KB Output is correct
3 Correct 23 ms 33272 KB Output is correct
4 Correct 23 ms 33272 KB Output is correct
5 Correct 23 ms 33272 KB Output is correct
6 Correct 23 ms 33272 KB Output is correct
7 Correct 23 ms 33276 KB Output is correct
8 Correct 23 ms 33272 KB Output is correct
9 Correct 23 ms 33272 KB Output is correct
10 Correct 23 ms 33272 KB Output is correct
11 Correct 23 ms 33272 KB Output is correct
12 Correct 24 ms 33272 KB Output is correct
13 Correct 23 ms 33272 KB Output is correct
14 Correct 24 ms 33272 KB Output is correct
15 Correct 25 ms 33528 KB Output is correct
16 Correct 24 ms 33272 KB Output is correct
17 Correct 24 ms 33324 KB Output is correct
18 Correct 23 ms 33272 KB Output is correct
19 Correct 23 ms 33272 KB Output is correct
20 Correct 26 ms 33272 KB Output is correct
21 Correct 22 ms 33272 KB Output is correct
22 Correct 24 ms 33272 KB Output is correct
23 Correct 23 ms 33272 KB Output is correct
24 Correct 24 ms 33272 KB Output is correct
25 Correct 23 ms 33272 KB Output is correct
26 Correct 23 ms 33272 KB Output is correct
27 Correct 24 ms 33272 KB Output is correct
28 Correct 24 ms 33272 KB Output is correct
29 Correct 25 ms 33272 KB Output is correct
30 Correct 27 ms 33400 KB Output is correct
31 Correct 24 ms 33272 KB Output is correct
32 Correct 24 ms 33272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 33272 KB Output is correct
2 Correct 23 ms 33272 KB Output is correct
3 Correct 23 ms 33272 KB Output is correct
4 Correct 25 ms 33400 KB Output is correct
5 Correct 24 ms 33272 KB Output is correct
6 Correct 24 ms 33276 KB Output is correct
7 Correct 24 ms 33272 KB Output is correct
8 Correct 23 ms 33272 KB Output is correct
9 Correct 23 ms 33272 KB Output is correct
10 Correct 22 ms 33272 KB Output is correct
11 Correct 23 ms 33272 KB Output is correct
12 Correct 24 ms 33272 KB Output is correct
13 Correct 24 ms 33272 KB Output is correct
14 Correct 23 ms 33272 KB Output is correct
15 Correct 23 ms 33272 KB Output is correct
16 Correct 23 ms 33272 KB Output is correct
17 Correct 23 ms 33272 KB Output is correct
18 Correct 24 ms 33272 KB Output is correct
19 Correct 24 ms 33272 KB Output is correct
20 Correct 24 ms 33272 KB Output is correct
21 Incorrect 25 ms 33272 KB Output isn't correct
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 23 ms 33272 KB Output is correct
2 Correct 24 ms 33276 KB Output is correct
3 Correct 23 ms 33144 KB Output is correct
4 Correct 23 ms 33272 KB Output is correct
5 Correct 23 ms 33272 KB Output is correct
6 Correct 24 ms 33272 KB Output is correct
7 Correct 23 ms 33272 KB Output is correct
8 Correct 23 ms 33272 KB Output is correct
9 Correct 23 ms 33272 KB Output is correct
10 Correct 23 ms 33220 KB Output is correct
11 Correct 23 ms 33272 KB Output is correct
12 Correct 23 ms 33272 KB Output is correct
13 Correct 24 ms 33272 KB Output is correct
14 Correct 24 ms 33272 KB Output is correct
15 Correct 24 ms 33272 KB Output is correct
16 Correct 23 ms 33272 KB Output is correct
17 Correct 23 ms 33272 KB Output is correct
18 Incorrect 23 ms 33272 KB Output isn't correct
19 Halted 0 ms 0 KB -