# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
949587 | 2024-03-19T11:39:01 Z | tnun | Jelly Flavours (IOI20_jelly) | C++14 | 62 ms | 78508 KB |
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair pair<int,int> c[2005]; int dp[2005][10005]={0}; int find_maximum_unique(int x, int y,vector<int> a,vector<int> b){ int sz=a.size(); int ans=0; for(int i=0;i<sz;i++){ c[i+1]=mp(a[i],b[i]); } sort(c+1,c+sz+1); for(int i=1;i<=sz;i++){ int uld=10005; for(int j=0;j<x;j++){ dp[i][j]=dp[i-1][j]+c[i].second; if(j>=c[i].first){ dp[i][j]=min(dp[i][j],dp[i][j-c[i].first]); } uld=min(uld,dp[i][j]); } uld=y-uld; int cnt=i; vector<int> temp; for(int k=i+1;k<=sz;k++){ temp.pb(c[k].second); } sort(temp.begin(),temp.end()); for(int k=0;k<temp.size();k++){ if(uld>=temp[k]){ uld-=temp[k]; cnt++; } } ans=max(cnt,ans); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2392 KB | 1st lines differ - on the 1st token, expected: '8', found: '9' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2392 KB | 1st lines differ - on the 1st token, expected: '8', found: '9' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 62 ms | 78508 KB | 1st lines differ - on the 1st token, expected: '689', found: '1949' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 47 ms | 76372 KB | 1st lines differ - on the 1st token, expected: '62', found: '1936' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 57 ms | 78480 KB | 1st lines differ - on the 1st token, expected: '154', found: '1959' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2392 KB | 1st lines differ - on the 1st token, expected: '8', found: '9' |
2 | Halted | 0 ms | 0 KB | - |