| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 371273 | pit4h | 비스킷 담기 (IOI20_biscuits) | C++14 | 1 ms | 364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 2e18+1;
ll count_tastiness(ll x, vector<ll> a) {
int k = a.size();
vector<ll> dp(k), dp0(k), pref(k);
pref[0] = a[0];
for(int i=1; i<k; ++i) {
pref[i] = pref[i-1]/2 + a[i];
}
for(int i=0; i<k; ++i) {
if(i>0) {
dp0[i] = dp[i-1];
}
else {
dp0[i] = 1;
}
ll sum = 0;
dp[i] = 1;
for(int j=i; j>=0; --j) {
if(pref[j] - sum >= x) {
dp[i] += dp0[j];
if(sum + x < INF/2) {
sum += max(0LL, x - a[j]);
sum *= 2;
}
else {
sum = INF;
}
}
else {
if(sum < INF/2) sum *= 2;
else sum = INF;
}
}
}
return dp[k-1];
}
| # | 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... | ||||
