Submission #789225

#TimeUsernameProblemLanguageResultExecution timeMemory
789225LIFJelly Flavours (IOI20_jelly)C++14
0 / 100
6 ms1236 KiB
#include "jelly.h" #include <vector> #include<bits/stdc++.h> using namespace std; int pricea[300005]; int priceb[300005]; int dp[505][505]; int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) { for(int i=0;i<a.size();i++)pricea[i+1] = a[i]; for(int i=0;i<b.size();i++)priceb[i+1] = b[i]; dp[0][0] = 0; int n = a.size(); for(int i=1;i<=n;i++) { for(int j=x;j>=1;j--) { for(int k=y;k>=1;k--) { if(j >= pricea[i])dp[j][k] = max(dp[j-pricea[i]][k] + 1, dp[j][k]); if(k >= priceb[i])dp[j][k] = max(dp[j][k-priceb[i]]+1,dp[j][k]); } } } int maxx = -1; for(int j=1;j<=x;j++) { for(int k=1;k<=y;k++) { maxx = max(maxx,dp[j][k]); } } return maxx; }

Compilation message (stderr)

jelly.cpp: In function 'int find_maximum_unique(int, int, std::vector<int>, std::vector<int>)':
jelly.cpp:9:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i=0;i<a.size();i++)pricea[i+1] = a[i];
      |              ~^~~~~~~~~
jelly.cpp:10:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i=0;i<b.size();i++)priceb[i+1] = b[i];
      |              ~^~~~~~~~~
#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...