제출 #1031277

#제출 시각아이디문제언어결과실행 시간메모리
1031277happy_node비스킷 담기 (IOI20_biscuits)C++17
44 / 100
120 ms3676 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int MX=2e5+5; ll good[MX]; long long count_tastiness(long long X, std::vector<long long> a) { while(a.size()<60) a.push_back(0); good[0]=0; int ptr=1; ll sum=0; for(int b=0;b<60;b++) { ll c=1LL<<b; sum+=a[b]*c; int tmp=ptr; for(int i=0;i<tmp;i++) { ll y=good[i]+c; if(y<=sum/X) good[ptr++]=y; else break; } } return ptr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...