제출 #1311775

#제출 시각아이디문제언어결과실행 시간메모리
1311775norrawichzzzJelly Flavours (IOI20_jelly)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int MXV = 2005; int find_maximum_unique(int x, int y, int[] a, int[] b) { int n=sizeof(a)/sizeof(a[0]); vector<vector<int>> dp(MXV, vector<int>(MXV)); dp[0][0] = 0; for (int e=0; e<n; e++) { for (int i=MXV-1; i>=0; i--) { for (int j=MXV-1; j>=0; j--) { if (i-a[e] >= 0) dp[i][j] = max(dp[i-a[e]][j]+1, dp[i][j]); if (j-b[e] >= 0) dp[i][j] = max(dp[i][j-b[e]]+1, dp[i][j]); } } } return dp[x][y]; } /* int main() { int n,x,y; cin>> n>> x>> y; vector<int> a(n),b(n); for (int i=0; i<n; i++) cin>> a[i]; for (int i=0; i<n; i++) cin>> b[i]; cout<< find_maximum_unique(x,y,a,b); }*/

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

jelly.cpp:6:63: error: expected ',' or '...' before 'a'
    6 | int find_maximum_unique(int     x,      int     y,      int[] a, int[] b) {
      |                                                               ^
jelly.cpp: In function 'int find_maximum_unique(int, int, int*)':
jelly.cpp:7:18: error: 'a' was not declared in this scope
    7 |     int n=sizeof(a)/sizeof(a[0]);
      |                  ^
jelly.cpp:17:23: error: 'b' was not declared in this scope
   17 |                 if (j-b[e] >= 0) dp[i][j] = max(dp[i][j-b[e]]+1, dp[i][j]);
      |                       ^