Submission #333197

#TimeUsernameProblemLanguageResultExecution timeMemory
333197nickmet2004비스킷 담기 (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; ll dp[61] , Pr[61]; ll count_tastiness(ll X , vector<ll> a){ int n = a.size(); for(int i = 0; i < n; ++i) if(i)Pr[i] = Pr[i - 1] + a[i] * (1ll << i); dp[0] = 1; for(int k = 1; k < 61; ++k){ ll S = min(Pr[i] , (1ll << k) - 1); for(int j = 60; ~i; --i){ if(S >> j & 1) dp[i] += dp[j]; } if(a[k -1])dp[i]++; } return dp[60]; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:12:23: error: 'i' was not declared in this scope
   12 |         ll S = min(Pr[i] , (1ll << k) - 1);
      |                       ^