Submission #40485

# Submission time Handle Problem Language Result Execution time Memory
40485 2018-02-02T08:49:11 Z Waschbar Bali Sculptures (APIO15_sculpture) C++14
9 / 100
1000 ms 872 KB
#include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;

const long long INF = 1e12;
const int MOD = 1e9+7;
const int MAXN = 30000;

int n, l, r;
long long v[100];

long long func(int f, int k, int cnt, long long sum, long long orr) {
        long long ans = INF;
        if(k > r) return INF;
        if(f == n+1) {
            if(k < l || k > r) return INF;
            //cout << f << " " << k << " " << (orr|sum) << endl;
            return orr|sum;
        }
        ans = func(f+1,k,cnt+1,sum+v[f],orr);
        if(cnt != 0)
        ans = min(ans,func(f+1,k+1,1,v[f],sum|orr));
        return ans;
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> l >> r;
    for(int i = 1; i <= n; i++)
        cin >> v[i];

    cout << func(1,1,0,0,0);


}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 352 KB Output is correct
3 Correct 1 ms 408 KB Output is correct
4 Correct 1 ms 408 KB Output is correct
5 Correct 2 ms 528 KB Output is correct
6 Correct 2 ms 600 KB Output is correct
7 Correct 2 ms 600 KB Output is correct
8 Correct 1 ms 600 KB Output is correct
9 Correct 2 ms 600 KB Output is correct
10 Correct 2 ms 600 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Correct 2 ms 668 KB Output is correct
13 Correct 7 ms 668 KB Output is correct
14 Correct 1 ms 668 KB Output is correct
15 Correct 1 ms 668 KB Output is correct
16 Correct 1 ms 668 KB Output is correct
17 Correct 1 ms 668 KB Output is correct
18 Correct 2 ms 668 KB Output is correct
19 Correct 2 ms 668 KB Output is correct
20 Correct 1 ms 668 KB Output is correct
21 Correct 3 ms 668 KB Output is correct
22 Correct 2 ms 668 KB Output is correct
23 Correct 3 ms 668 KB Output is correct
24 Correct 2 ms 668 KB Output is correct
25 Correct 2 ms 668 KB Output is correct
26 Correct 7 ms 668 KB Output is correct
27 Correct 1 ms 668 KB Output is correct
28 Correct 2 ms 744 KB Output is correct
29 Correct 2 ms 744 KB Output is correct
30 Correct 2 ms 744 KB Output is correct
31 Correct 3 ms 744 KB Output is correct
32 Correct 2 ms 744 KB Output is correct
33 Correct 11 ms 744 KB Output is correct
34 Correct 7 ms 744 KB Output is correct
35 Correct 2 ms 764 KB Output is correct
36 Correct 7 ms 764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 764 KB Output is correct
2 Correct 2 ms 764 KB Output is correct
3 Correct 1 ms 764 KB Output is correct
4 Correct 2 ms 764 KB Output is correct
5 Correct 2 ms 764 KB Output is correct
6 Correct 2 ms 764 KB Output is correct
7 Correct 1 ms 764 KB Output is correct
8 Correct 2 ms 764 KB Output is correct
9 Correct 1 ms 764 KB Output is correct
10 Correct 2 ms 764 KB Output is correct
11 Correct 2 ms 764 KB Output is correct
12 Correct 2 ms 764 KB Output is correct
13 Correct 7 ms 764 KB Output is correct
14 Correct 2 ms 764 KB Output is correct
15 Correct 1 ms 764 KB Output is correct
16 Correct 1 ms 764 KB Output is correct
17 Correct 1 ms 764 KB Output is correct
18 Correct 1 ms 764 KB Output is correct
19 Correct 2 ms 780 KB Output is correct
20 Correct 1 ms 780 KB Output is correct
21 Correct 2 ms 780 KB Output is correct
22 Correct 2 ms 780 KB Output is correct
23 Correct 3 ms 780 KB Output is correct
24 Correct 2 ms 780 KB Output is correct
25 Correct 2 ms 780 KB Output is correct
26 Correct 7 ms 780 KB Output is correct
27 Correct 15 ms 780 KB Output is correct
28 Correct 47 ms 780 KB Output is correct
29 Correct 6 ms 780 KB Output is correct
30 Execution timed out 1076 ms 780 KB Time limit exceeded
31 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 780 KB Output is correct
2 Correct 1 ms 780 KB Output is correct
3 Correct 1 ms 780 KB Output is correct
4 Correct 1 ms 780 KB Output is correct
5 Correct 2 ms 780 KB Output is correct
6 Correct 2 ms 780 KB Output is correct
7 Correct 2 ms 780 KB Output is correct
8 Correct 2 ms 780 KB Output is correct
9 Correct 1 ms 780 KB Output is correct
10 Correct 1 ms 780 KB Output is correct
11 Correct 2 ms 780 KB Output is correct
12 Correct 2 ms 780 KB Output is correct
13 Correct 7 ms 780 KB Output is correct
14 Correct 12 ms 780 KB Output is correct
15 Correct 46 ms 780 KB Output is correct
16 Correct 6 ms 780 KB Output is correct
17 Execution timed out 1072 ms 780 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 1 ms 780 KB Output is correct
3 Correct 2 ms 780 KB Output is correct
4 Correct 2 ms 780 KB Output is correct
5 Correct 1 ms 780 KB Output is correct
6 Correct 2 ms 780 KB Output is correct
7 Correct 1 ms 780 KB Output is correct
8 Correct 1 ms 780 KB Output is correct
9 Correct 1 ms 780 KB Output is correct
10 Correct 1 ms 780 KB Output is correct
11 Correct 1 ms 780 KB Output is correct
12 Correct 2 ms 780 KB Output is correct
13 Correct 7 ms 780 KB Output is correct
14 Correct 1 ms 780 KB Output is correct
15 Correct 1 ms 780 KB Output is correct
16 Correct 1 ms 780 KB Output is correct
17 Correct 1 ms 780 KB Output is correct
18 Correct 1 ms 780 KB Output is correct
19 Correct 2 ms 780 KB Output is correct
20 Correct 1 ms 780 KB Output is correct
21 Correct 2 ms 780 KB Output is correct
22 Correct 3 ms 780 KB Output is correct
23 Correct 2 ms 780 KB Output is correct
24 Correct 2 ms 780 KB Output is correct
25 Correct 3 ms 780 KB Output is correct
26 Correct 7 ms 780 KB Output is correct
27 Correct 2 ms 780 KB Output is correct
28 Correct 2 ms 780 KB Output is correct
29 Correct 2 ms 780 KB Output is correct
30 Correct 1 ms 780 KB Output is correct
31 Correct 3 ms 780 KB Output is correct
32 Correct 1 ms 780 KB Output is correct
33 Correct 7 ms 780 KB Output is correct
34 Correct 7 ms 780 KB Output is correct
35 Correct 2 ms 780 KB Output is correct
36 Correct 7 ms 780 KB Output is correct
37 Correct 13 ms 780 KB Output is correct
38 Correct 44 ms 820 KB Output is correct
39 Correct 6 ms 820 KB Output is correct
40 Execution timed out 1072 ms 820 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Output is correct
2 Correct 1 ms 820 KB Output is correct
3 Correct 1 ms 820 KB Output is correct
4 Correct 2 ms 820 KB Output is correct
5 Correct 2 ms 820 KB Output is correct
6 Correct 2 ms 820 KB Output is correct
7 Correct 2 ms 820 KB Output is correct
8 Correct 1 ms 828 KB Output is correct
9 Correct 1 ms 828 KB Output is correct
10 Correct 2 ms 828 KB Output is correct
11 Correct 1 ms 828 KB Output is correct
12 Correct 1 ms 828 KB Output is correct
13 Correct 8 ms 828 KB Output is correct
14 Correct 2 ms 828 KB Output is correct
15 Correct 1 ms 828 KB Output is correct
16 Correct 1 ms 828 KB Output is correct
17 Correct 2 ms 828 KB Output is correct
18 Correct 2 ms 828 KB Output is correct
19 Correct 2 ms 828 KB Output is correct
20 Correct 7 ms 828 KB Output is correct
21 Correct 7 ms 828 KB Output is correct
22 Correct 1 ms 828 KB Output is correct
23 Correct 7 ms 828 KB Output is correct
24 Correct 18 ms 872 KB Output is correct
25 Correct 71 ms 872 KB Output is correct
26 Correct 7 ms 872 KB Output is correct
27 Execution timed out 1063 ms 872 KB Time limit exceeded
28 Halted 0 ms 0 KB -