Submission #1169030

#TimeUsernameProblemLanguageResultExecution timeMemory
1169030mkolko21Jelly Flavours (IOI20_jelly)C++20
Compilation error
0 ms0 KiB
#include <iostream> 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(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(sec[0]==0) odp+=n; else odp+=y/sec[0]; return odp; }

Compilation message (stderr)

jelly.cpp:6:39: error: 'vector' has not been declared
    6 | int find_maximum_unique(int x, int y, vector<int> fir, vector<int> sec)
      |                                       ^~~~~~
jelly.cpp:6:45: error: expected ',' or '...' before '<' token
    6 | int find_maximum_unique(int x, int y, vector<int> fir, vector<int> sec)
      |                                             ^
jelly.cpp: In function 'int find_maximum_unique(int, int, int)':
jelly.cpp:8:11: error: 'fir' was not declared in this scope
    8 |     int n=fir.size();
      |           ^~~
jelly.cpp:17:8: error: 'sec' was not declared in this scope
   17 |     if(sec[0]==0)
      |        ^~~