Submission #404554

# Submission time Handle Problem Language Result Execution time Memory
404554 2021-05-14T15:30:22 Z sad Bali Sculptures (APIO15_sculpture) C++14
16 / 100
36 ms 16960 KB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
const int N=100;
int n,a,b;const int OR=1030;
int vis[N][N][OR],aa[N];
void d(int ind,int o,int orr)
{
    if(vis[ind][o][orr]==1)return;
    vis[ind][o][orr]=1;
    if(ind==n)return ;ll sum=0;
    for(int j=ind;j<n;j++)
    {
        sum+=aa[j];
        d(j+1,o+1,orr|sum);
    }
    return;
}
int main()
{
    cin>>n>>a>>b;
    for(int i=0;i<n;i++)cin>>aa[i];
    d(0,0,0);int mn=1e9;
    for(int i=a;i<b+1;i++)
    {
        for(int j=OR;j>-1;j--)
        {
            if(vis[n][i][j])
            {
                mn=min(mn,j);
            }
        }
    }
    cout<<mn;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 2 ms 716 KB Output is correct
7 Correct 1 ms 844 KB Output is correct
8 Correct 1 ms 1100 KB Output is correct
9 Correct 1 ms 1100 KB Output is correct
10 Correct 1 ms 1100 KB Output is correct
11 Correct 1 ms 1100 KB Output is correct
12 Correct 1 ms 1100 KB Output is correct
13 Correct 1 ms 1100 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 296 KB Output is correct
18 Correct 1 ms 424 KB Output is correct
19 Correct 1 ms 716 KB Output is correct
20 Correct 1 ms 844 KB Output is correct
21 Correct 1 ms 1100 KB Output is correct
22 Correct 2 ms 1100 KB Output is correct
23 Correct 2 ms 1100 KB Output is correct
24 Correct 1 ms 1100 KB Output is correct
25 Correct 1 ms 1100 KB Output is correct
26 Correct 1 ms 1100 KB Output is correct
27 Runtime error 3 ms 332 KB Execution killed with signal 11
28 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 844 KB Output is correct
8 Correct 2 ms 1100 KB Output is correct
9 Correct 1 ms 1100 KB Output is correct
10 Correct 2 ms 1100 KB Output is correct
11 Correct 1 ms 1100 KB Output is correct
12 Correct 1 ms 1100 KB Output is correct
13 Correct 1 ms 1100 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 460 KB Output is correct
19 Correct 1 ms 716 KB Output is correct
20 Correct 1 ms 844 KB Output is correct
21 Correct 1 ms 1100 KB Output is correct
22 Correct 2 ms 1064 KB Output is correct
23 Correct 2 ms 1100 KB Output is correct
24 Correct 1 ms 1100 KB Output is correct
25 Correct 1 ms 1100 KB Output is correct
26 Correct 2 ms 1100 KB Output is correct
27 Correct 2 ms 1228 KB Output is correct
28 Correct 2 ms 1584 KB Output is correct
29 Correct 3 ms 3276 KB Output is correct
30 Correct 4 ms 3916 KB Output is correct
31 Correct 7 ms 5324 KB Output is correct
32 Correct 5 ms 5324 KB Output is correct
33 Correct 5 ms 5324 KB Output is correct
34 Correct 6 ms 5452 KB Output is correct
35 Correct 7 ms 5324 KB Output is correct
36 Correct 7 ms 5324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 844 KB Output is correct
8 Correct 2 ms 1120 KB Output is correct
9 Correct 1 ms 1100 KB Output is correct
10 Correct 1 ms 1100 KB Output is correct
11 Correct 1 ms 1100 KB Output is correct
12 Correct 1 ms 1100 KB Output is correct
13 Correct 1 ms 1100 KB Output is correct
14 Correct 1 ms 1228 KB Output is correct
15 Correct 2 ms 1612 KB Output is correct
16 Correct 4 ms 3276 KB Output is correct
17 Correct 4 ms 3916 KB Output is correct
18 Correct 6 ms 5324 KB Output is correct
19 Correct 5 ms 5372 KB Output is correct
20 Correct 5 ms 5324 KB Output is correct
21 Correct 6 ms 5324 KB Output is correct
22 Correct 6 ms 5452 KB Output is correct
23 Correct 6 ms 5324 KB Output is correct
24 Correct 7 ms 5580 KB Output is correct
25 Correct 13 ms 8872 KB Output is correct
26 Correct 23 ms 12612 KB Output is correct
27 Correct 36 ms 16960 KB Output is correct
28 Runtime error 5 ms 1352 KB Execution killed with signal 11
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 460 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 844 KB Output is correct
8 Correct 1 ms 1100 KB Output is correct
9 Correct 1 ms 1100 KB Output is correct
10 Correct 1 ms 1100 KB Output is correct
11 Correct 1 ms 1100 KB Output is correct
12 Correct 1 ms 1100 KB Output is correct
13 Correct 1 ms 1100 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 332 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 1 ms 460 KB Output is correct
19 Correct 1 ms 716 KB Output is correct
20 Correct 1 ms 816 KB Output is correct
21 Correct 2 ms 1100 KB Output is correct
22 Correct 1 ms 1100 KB Output is correct
23 Correct 1 ms 1068 KB Output is correct
24 Correct 1 ms 1100 KB Output is correct
25 Correct 2 ms 1100 KB Output is correct
26 Correct 2 ms 1100 KB Output is correct
27 Runtime error 3 ms 296 KB Execution killed with signal 11
28 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 460 KB Output is correct
6 Correct 1 ms 716 KB Output is correct
7 Correct 1 ms 896 KB Output is correct
8 Correct 1 ms 1100 KB Output is correct
9 Correct 1 ms 1100 KB Output is correct
10 Correct 1 ms 1100 KB Output is correct
11 Correct 1 ms 1100 KB Output is correct
12 Correct 1 ms 1100 KB Output is correct
13 Correct 1 ms 1100 KB Output is correct
14 Runtime error 3 ms 332 KB Execution killed with signal 11
15 Halted 0 ms 0 KB -