| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 249138 | hunni10 | Bali Sculptures (APIO15_sculpture) | C++14 | 1093 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<math.h>
#include<string.h>
#include<queue>
#include<list>
#include<time.h>
#include<assert.h>
#include<unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
int n, m, k, t;
int a, b;
int y[2000];
ll acc[2000];
vector<int> current_division;
int get() {
int sum = 0;
auto riter = current_division.rbegin();
while (true) {
if (riter + 1 == current_division.rend()) return 1;
sum += *riter;
*riter = 0;
if (*(riter + 1) != 0) {
(*(riter + 1))--;
*riter = sum + 1;
return 0;
}
riter++;
}
return 0;
}
int main() {
scanf("%d %d %d", &n, &a, &b);
ll sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", y + i);
sum += y[i];
acc[i] = sum;
}
ll mn = 0x7FFFFFFFFFFFFFFF;
for (int d = a; d <= b; d++) {
current_division.clear();
current_division.assign(d, 0);
current_division[0] = n - d;
int stop = 0;
while (!stop) {
int idx = 0;
ll ors = 0;
for (int num : current_division) {
ll subsum = acc[idx + num];
if (idx != 0) {
subsum -= acc[idx-1];
}
ors |= subsum;
idx += num + 1;
}
if (mn > ors) mn = ors;
stop = get();
}
}
printf("%lld", mn);
}
컴파일 시 표준 에러 (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... | ||||
