Submission #430696

#TimeUsernameProblemLanguageResultExecution timeMemory
430696charterlaJelly Flavours (IOI20_jelly)C++14
35 / 100
132 ms2380 KiB
#include "jelly.h" #include <iostream> #include <algorithm> #include <vector> using namespace std; int find_maximum_unique(int x, int y, vector<int> a, vector<int> b){ int f[505][505],ans=0; for(int i=0;i<=x;i++){ for(int j=0;j<=y;j++){ f[i][j]=0; } } for(int k=0;k<a.size();k++){ for(int i=x;i>=0;i--){ for(int j=y;j>=0;j--){ if(i>=a[k])f[i][j]=max(f[i][j],f[i-a[k]][j]+1); if(j>=b[k])f[i][j]=max(f[i][j],f[i][j-b[k]]+1); ans=max(ans,f[i][j]); //cout<<f[i][j]<<" "; }//cout<<endl; } } return ans; }

Compilation message (stderr)

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(int k=0;k<a.size();k++){
      |              ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...