Submission #983692

#TimeUsernameProblemLanguageResultExecution timeMemory
983692SofiatpcJelly Flavours (IOI20_jelly)C++14
14 / 100
1 ms600 KiB
#include "jelly.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 2005, MAX = 1e4+5; int dp[MAXN][MAX]; int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) { int n = a.size(); sort(a.begin(),a.end()); int l = 1, r = n; while(l!=r){ int mid = (l+r+1)/2; int curx = x, cury = y; for(int i = mid-1; i >= 0; i--){ if(curx > cury)curx -= a[i]; else cury -= a[i]; } if(curx >= 0 && cury >= 0)l = mid; else r = mid-1; } int curx = x, cury = y; for(int i = l-1; i >= 0; i--){ if(curx > cury)curx -= a[i]; else cury -= a[i]; } if(curx >= 0 && cury >= 0) return l; return 0; }
#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...