제출 #1201418

#제출 시각아이디문제언어결과실행 시간메모리
1201418ezzzayJelly Flavours (IOI20_jelly)C++20
컴파일 에러
0 ms0 KiB
int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) { int n = a.size(); vector< vector<int> > dp (x+1, vector<int>(y+1)); int ans=0; for(int k=0;k<n;k++){ for(int i=a[k];i<=x;i++){ for(int j=0;j<=y;j++){ dp[i-a[k]][j]=max(dp[i][j]+1,dp[i-a[k]][j]); ans=max(ans,dp[i-a[k]][j]); } } for(int i=0;i<=x;i++){ for(int j=b[k];j<=y;j++){ dp[i][j-b[k]]=max(dp[i][j]+1,dp[i][j-b[k]]); ans=max(ans,dp[i][j-b[k]]); } } } return ans; }

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

jelly.cpp:1:39: error: 'std::vector' has not been declared
    1 | int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
      |                                       ^~~
jelly.cpp:1:50: error: expected ',' or '...' before '<' token
    1 | int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
      |                                                  ^
jelly.cpp: In function 'int find_maximum_unique(int, int, int)':
jelly.cpp:3:17: error: 'a' was not declared in this scope
    3 |         int n = a.size();
      |                 ^
jelly.cpp:4:17: error: 'vector' was not declared in this scope
    4 |         vector< vector<int> > dp (x+1, vector<int>(y+1));
      |                 ^~~~~~
jelly.cpp:4:24: error: expected primary-expression before 'int'
    4 |         vector< vector<int> > dp (x+1, vector<int>(y+1));
      |                        ^~~
jelly.cpp:9:33: error: 'dp' was not declared in this scope
    9 |                                 dp[i-a[k]][j]=max(dp[i][j]+1,dp[i-a[k]][j]);
      |                                 ^~
jelly.cpp:9:47: error: 'max' was not declared in this scope
    9 |                                 dp[i-a[k]][j]=max(dp[i][j]+1,dp[i-a[k]][j]);
      |                                               ^~~
jelly.cpp:14:35: error: 'b' was not declared in this scope
   14 |                         for(int j=b[k];j<=y;j++){
      |                                   ^
jelly.cpp:15:33: error: 'dp' was not declared in this scope
   15 |                                 dp[i][j-b[k]]=max(dp[i][j]+1,dp[i][j-b[k]]);
      |                                 ^~
jelly.cpp:15:47: error: 'max' was not declared in this scope
   15 |                                 dp[i][j-b[k]]=max(dp[i][j]+1,dp[i][j-b[k]]);
      |                                               ^~~