제출 #817745

#제출 시각아이디문제언어결과실행 시간메모리
817745Theo830비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define f(i,a,b) for(int i = a;i < b;i++) #define ll long long #define ii pair<ll,ll> #define pb push_back #define F first #define S second #define iii pair<ll,ii> #include "biscuits.h" ll dp[1<<14][10000]; ll a[65] = {0}; ll x; ll solve(ll extra,ll j,ll mask){ if(j > 60){ return 1; } if(dp[mask][j] != -1)){ return dp[mask][j]; } extra += a[j]; ll neo = mask>>1; ll ans = solve(extra / 2,j+1,neo); if(extra >= x){ ans += solve((extra - x) / 2,j+1,neo + (1<<14)); } return dp[mask][j] = ans; } long long count_tastiness(long long X, vector<long long> A){ x = X; ll k = A.size(); memset(dp,-1,sizeof dp); f(i,0,65){ a[i] = 0; } f(i,0,k){ a[i] = A[i]; } return solve(0,0); }

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

biscuits.cpp: In function 'long long int solve(long long int, long long int, long long int)':
biscuits.cpp:18:26: error: expected primary-expression before ')' token
   18 |     if(dp[mask][j] != -1)){
      |                          ^
biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:39:21: error: too few arguments to function 'long long int solve(long long int, long long int, long long int)'
   39 |     return solve(0,0);
      |                     ^
biscuits.cpp:14:4: note: declared here
   14 | ll solve(ll extra,ll j,ll mask){
      |    ^~~~~