Submission #747739

#TimeUsernameProblemLanguageResultExecution timeMemory
747739Rafi22비스킷 담기 (IOI20_biscuits)C++14
0 / 100
2 ms920 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() #define ll long long ll mod=1000000007; int inf=1000000007; ll infl=1000000000000000007; const int K=67; ll ile[K][K]; ll count_tastiness(ll x, vector<ll>a) { int k=sz(a); for(int i=0;i<k;i++) { ll c=0; for(int j=i;j<k;j++) { c=c/2+a[j]; ile[i][j]=c; } } vector<pair<ll,pair<ll,int>>>V; V.pb({0,{0,-1}}); for(int i=0;i<k;i++) { for(auto [p,z]:V) { ll a=z.st; int j=z.nd; if(j==i) break; ll q=p/(1LL<<(i-j))+ile[j+1][i]; //if(q<x) break; V.pb({q-x,{a+(1LL<<i),i}}); } } return sz(V); } /*int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<count_tastiness(2, {2, 1, 2}); return 0; }*/

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:36:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   36 |         for(auto [p,z]:V)
      |                  ^
#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...