# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23427 | 14kg | Bali Sculptures (APIO15_sculpture) | C++11 | 283 ms | 36356 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#define N 2002
#define INF 999999999
#define min2(x,y) (x<y?x:y)
#define max2(x,y) (x>y?x:y)
int n, L, R, nn;
bool out[51], check[N][N];
long long p[51], in[N], s[N][N];
int main()
{
int num, temp1[N], temp2[N];
long long sum, tot=0;
scanf("%d %d %d", &n, &L, &R);
for (int i = 1; i <= n; i++) scanf("%lld", &in[i]);
p[0] = 1;
for (int i = 1; i <= 50; i++) p[i] = p[i - 1] * 2;
for (int i = 1; i <= n; i++) for (int j = i; j <= n; j++) s[i][j] = s[i][j - 1] + in[j];
if (s[1][n] == 0) { printf("0"); return 0; }
for (int i = 49; i >= 0; i--)
{
num = 1, sum = 0;
for (int j = 1; j <= n; j++)
{
sum += in[j];
if (sum >= p[i + 1]) sum = in[j], num++;
if (sum >= p[i + 1]) { num = INF; break; }
Compilation message (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... |