Submission #1311777

#TimeUsernameProblemLanguageResultExecution timeMemory
1311777norrawichzzzJelly Flavours (IOI20_jelly)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

const int MXV = 2005;

int find_maximum_unique(int	x,	int	y,	vector<int> &a, vector<int> &b) {
    int n=a.size();

    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);
}

Compilation message (stderr)

jelly.cpp: In function 'int main()':
jelly.cpp:34:32: error: 'x' was not declared in this scope
   34 |     cout<< find_maximum_unique(x,y,a,b);
      |                                ^
jelly.cpp:34:34: error: 'y' was not declared in this scope; did you mean 'yn'?
   34 |     cout<< find_maximum_unique(x,y,a,b);
      |                                  ^
      |                                  yn
jelly.cpp:34:36: error: 'a' was not declared in this scope
   34 |     cout<< find_maximum_unique(x,y,a,b);
      |                                    ^
jelly.cpp:34:38: error: 'b' was not declared in this scope
   34 |     cout<< find_maximum_unique(x,y,a,b);
      |                                      ^