# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
311646 | andrew | 비스킷 담기 (IOI20_biscuits) | C++17 | 83 ms | 1016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <biscuits.h>
#define fi first
#define se second
#define p_b push_back
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
ll count_tastiness(ll x, vector <ll> a){
ll ans = 0;
vector <ll> b, c;
ll _now = 0;
for(int i = 0; i < sz(a) || _now; i++){
c.p_b(_now);
if(i < sz(a))_now += a[i];
b.p_b(_now % 2);
_now /= 2;
}
map <ll, ll> dp[63];
dp[62][0] = 1;
while(sz(b) < 63)b.p_b(0);
while(sz(c) < 63)c.p_b(0);
ll xt, t;
for(int i = 61; i >= 0; i--){
for(auto j : dp[i + 1]){
xt = j.fi + b[i];
if(xt >= x){
dp[i][min(min(2 * x, (xt - x) * 2), 2 * c[i])] += j.se;
}
dp[i][min(min(2 * x, xt * 2), 2 * c[i])] += j.se;
}
}
ans = 0;
for(auto j : dp[0])ans += j.se;
return 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... |