제출 #434824

#제출 시각아이디문제언어결과실행 시간메모리
434824jairRS비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms332 KiB
#include "biscuits.h" #include <bits/stdc++.h> typedef long long ll; using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { ll k = a.size(); vector<ll> maxVal(k); maxVal[0] = a[0]; ll sizes = a[0] + 1; //1s plus the case where there are no biscuits in the bag ll power2 = 2; for (int i = 1; i < k; i++) { sizes += a[i] - maxVal[i - 1]/power2; //every biscuit size not possible due to previous sums sizes += a[i]; //every biscuit size past maxVal[i - 1]; maxVal[i] = maxVal[i - 1] + power2*a[i]; power2 *= 2; } return sizes; }
#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...