답안 #766382

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
766382 2023-06-25T15:18:52 Z 1ne Bali Sculptures (APIO15_sculpture) C++14
0 / 100
5 ms 316 KB
#include<bits/stdc++.h>
using namespace std; 
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	long long n,a,b;cin>>n>>a>>b;
	vector<long long>arr(n);
	for (long long i = 0;i<n;++i){
		cin>>arr[i];
	}
	long long vv = 1e16;                                   
	for (long long i = 0;i<(1LL<<n);++i){
		long long v = 0;
      long long cnt = 0;
		for (long long j = 0;j<n;){
			long long cur = (i & (1LL<<j));
			long long k = j;
			long long ans = 0;
			while(k < n && (i & (1LL<<k)) == cur){
				ans+=arr[k];
				++k;
			}
			v|=ans;
			cnt++;	
         j = k;
		}
		if (cnt >= a && cnt <= b){
			vv = min(vv,v);
		}
	}
	cout<<vv<<'\n';
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Incorrect 5 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 256 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 Incorrect 5 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 2 ms 212 KB Output is correct
7 Incorrect 5 ms 316 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 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 Incorrect 5 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 2 ms 212 KB Output is correct
7 Incorrect 5 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -