제출 #1186895

#제출 시각아이디문제언어결과실행 시간메모리
1186895hengliao비스킷 담기 (IOI20_biscuits)C++20
0 / 100
0 ms396 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define vll vector<ll> #define pll pair<ll, ll> #define pb push_back typedef long long ll; long long count_tastiness(long long x, vector<long long> a) { ll k=a.size(); ll sum=0; vll pw(k); pw[0]=1; for(ll i=0;i<k;i++){ if(i!=0) pw[i]=pw[i-1]*2; sum+=pw[i]*a[i]; } ll ans=1; vll add; add.pb(0); for(ll i=0;i<k;i++){ vll new_add; for(auto &it:add){ ll tep=it+a[i]; new_add.pb(tep/2); if(tep>=x){ ans++; tep-=x; new_add.pb(tep/2); } } add=new_add; } return ans; }
#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...