제출 #1169121

#제출 시각아이디문제언어결과실행 시간메모리
1169121mkolko21Jelly Flavours (IOI20_jelly)C++20
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <vector>
using namespace std;

int dp[2'007][10'007];

int find_maximum_unique(int x, int y, vector<int> fir, vector<int> sec)
{
    int n=fir.size();
    for(int a=0; a<n; a++){
        for(int i=0; i<=x; i++){
            dp[a+1][i]=max(dp[a+1][i],dp[a][i]);
            if(sec[a]==0)
                dp[a+1][i]=max(dp[a+1][i],dp[a][i]+1):
            if(i+fir[a]<=x)
                dp[a+1][i+fir[a]]=max(dp[a][i]+1,dp[a+1][i+fir[a]]);
        }
    }
    int odp=dp[n][x];
    if(y!=0){
        if(sec[0]==0)
            odp=n;
        else
            odp+=y/sec[0];
    }
    return min(odp,n);
}

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

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:14:54: error: expected ';' before ':' token
   14 |                 dp[a+1][i]=max(dp[a+1][i],dp[a][i]+1):
      |                                                      ^
      |                                                      ;