| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 129358 | arnold518 | Bali Sculptures (APIO15_sculpture) | C++14 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 100;
const ll INF = numeric_limits<ll>::max();
int N, A, B;
ll Y[MAXN+10], dp[MAXN+10][MAXN+10], ans=INF;
int main()
{
int i, j, k;
scanf("%d%d%d", &N, &A, &B);
for(i=1; i<=N; i++) scanf("%lld", &Y[i]), Y[i]+=Y[i-1];
dp[1][0]=INF;
for(i=1; i<=N; i++) dp[1][i]=Y[i];
for(i=2; i<=N; i++)
{
for(j=1; j<=N; j++)
{
dp[i][j]=INF;
for(k=1; k<j; k++)
{
dp[i][j]=min(dp[i][j], dp[i-1][k]|(Y[j]-Y[k]));
}
}
}
for(i=A; i<=B; i++) ans=min(ans, dp[i][N]);
printf("%lld", ans);
}
컴파일 시 표준 에러 (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... | ||||
