제출 #333199

#제출 시각아이디문제언어결과실행 시간메모리
333199nickmet2004비스킷 담기 (IOI20_biscuits)C++14
컴파일 에러
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[k] , (1ll << k) - 1);
        for(int j = 60; ~i; --i){
            if(S >> j & 1) dp[i] += dp[j];
        }
        if(a[k -1])dp[k]++;
    }
    return dp[60];
}

컴파일 시 표준 에러 (stderr) 메시지

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:13:26: error: 'i' was not declared in this scope
   13 |         for(int j = 60; ~i; --i){
      |                          ^