# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
519652 | DanerZein | Packing Biscuits (IOI20_biscuits) | C++14 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N=1e5;
int bits[62];
long long count_tastiness(long long x, std::vector<long long> a) {
/* ll res=0;
for(ll i=0;i<=MAX_N;i++){
memset(bits,0,sizeof bits);
for(int j=0;j<a.size();j++) bits[j]=a[j];
bool sw=1;
for(ll j=0;j<30;j++){
if(i&(1<<j)){
if(bits[j]<x){
sw=0;
break;
}
bits[j]-=x;
}
bits[j+1]+=(bits[j]/2);
}
res+=sw;
}*/
memset(bits,0,sizeof bits);
for(int i=0;i<a.size();i++)
bits[i]=a[i];
for(ll j=0;j<=60;j++){
if(bits[j]>2){
ll y;
if(bits[j]%2==0) y=(bits[j]-2)/2;
else y=(bits[j]-1)/2;
bits[j+1]+=y;
bits[j]-=(2*y);
}
}
ll ans=1;
for(int i=0;i<=61;i++){
if(bits[i]==0){
ll tot=1;
for(int j=i-1;j>=0;j--){
if(bits[j]==0){
break;
}
tot*=(ll)2;
}
ll rp=tot;
ll p2=1;
for(int j=i-1;j>=0;j--){
if(bits[j]==0) break;
p2*=(ll)2;
if(bits[j]==2)
rp+=(tot/p2);
}
ans*=rp;
}
}
//cout<<ans<<" "<<res<<endl;
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... |