# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101292 | arman_ferdous | Bali Sculptures (APIO15_sculpture) | C++17 | 3 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, A, B;
ll arr[22];
scanf("%d %d", &n, &A, &B);
for(int i = 0; i < n; i++)
scanf("%lld", &arr[i]);
ll ans = (1ll<<62);
for(int mask = 0; mask < (1<<n); mask++) {
ll here = 0, cnt = 0;
for(int i = 0; i < n; ) {
ll sum = 0;
for(int j = i; j < n; j++, i++) {
sum += arr[j];
if(mask>>j&1) { i++; cnt++; break; }
}
here |= sum;
}
if(A <= cnt && cnt <= B) ans = min(ans, here);
} printf("%lld\n", ans);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |