Submission #582869

# Submission time Handle Problem Language Result Execution time Memory
582869 2022-06-24T14:13:06 Z Justin1 Bali Sculptures (APIO15_sculpture) C++14
0 / 100
1000 ms 340 KB
#include <bits/stdc++.h>
using namespace std;

int n,m,k,x,y,z;
int mn[2005];
int a,b,ar[2005];

void exhaust(int id, int ttl, int sum, int cut) {
	if (id > n) {
		mn[cut] = min(mn[cut],ttl | sum);
		return;
	}
	exhaust(id+1,ttl,sum+ar[id],cut);
	if (sum) exhaust(id+1,ttl | sum,ar[id],cut+1);
}

int main() {
	cin >> n >> a >> b;
	for (int i = 1; i <= n; i++) mn[i] = INT_MAX;
	for (int i = 1; i <= n; i++) cin >> ar[i];
	exhaust(1,0,0,1);
	int ans = INT_MAX;
	for (int i = a; i <= b; i++) ans = min(ans,mn[i]);
	cout << ans << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 2 ms 212 KB Output is correct
9 Correct 4 ms 304 KB Output is correct
10 Correct 3 ms 212 KB Output is correct
11 Correct 3 ms 212 KB Output is correct
12 Correct 4 ms 308 KB Output is correct
13 Correct 3 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Incorrect 1 ms 304 KB Output isn't correct
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 3 ms 212 KB Output is correct
10 Correct 4 ms 212 KB Output is correct
11 Correct 4 ms 212 KB Output is correct
12 Correct 4 ms 304 KB Output is correct
13 Correct 4 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Incorrect 1 ms 212 KB Output isn't correct
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 308 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 3 ms 212 KB Output is correct
10 Correct 3 ms 212 KB Output is correct
11 Correct 4 ms 212 KB Output is correct
12 Correct 4 ms 212 KB Output is correct
13 Correct 3 ms 212 KB Output is correct
14 Correct 3 ms 212 KB Output is correct
15 Correct 30 ms 212 KB Output is correct
16 Execution timed out 1084 ms 308 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 304 KB Output is correct
8 Correct 2 ms 304 KB Output is correct
9 Correct 3 ms 304 KB Output is correct
10 Correct 4 ms 304 KB Output is correct
11 Correct 3 ms 316 KB Output is correct
12 Correct 3 ms 212 KB Output is correct
13 Correct 3 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Incorrect 1 ms 212 KB Output isn't correct
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 308 KB Output is correct
9 Correct 3 ms 212 KB Output is correct
10 Correct 3 ms 304 KB Output is correct
11 Correct 3 ms 212 KB Output is correct
12 Correct 3 ms 212 KB Output is correct
13 Correct 3 ms 212 KB Output is correct
14 Incorrect 1 ms 212 KB Output isn't correct
15 Halted 0 ms 0 KB -