# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
652942 | mychecksedad | 비스킷 담기 (IOI20_biscuits) | C++17 | 49 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
int n;
ll count_tastiness(ll x, vector<ll> a){
n = 61;
for(int i = 0; i < n-a.size(); ++i) a.pb(0);
ll ans = 0;
int sum = 0;
for(int i = 0; i < min(n, 62); ++i) sum += (1ll<<i) * a[i];
if(sum/x <= 100000){
for(ll y = 0; y <= sum / x; ++y){
ll c = 0;
bool ok = 1;
for(ll j = 0; j < 63; ++j){
if((1ll<<j)&y){
c += a[j];
if(c<x){
ok = 0;
break;
}
c-=x;
}else{
c += a[j];
}
c >>= 1;
}
if(ok) ans++;
}
return ans;
}else{
vector<ll> b = a;
int mx = -1, mx1 = -1;
for(int i = 0; i < n - 1; ++i){
if(b[i] > 1) b[i + 1] += (b[i]-1)/2;
if(b[i + 1] > 0) mx = i + 1;
}
ll ans = 1;
for(int i = 0; i < n - 1; ++i) if(b[i]>0) ans *= 2;
for(int i = 0; i < n - 1; ++i){
a[i + 1] += a[i]/2;
if(a[i + 1] > 0) mx1 = i + 1;
}
if(mx!=mx1) ++ans;
return ans;
}
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... |