# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
400882 | 2021-05-08T19:11:08 Z | Divanny | Jelly Flavours (IOI20_jelly) | C++14 | 0 ms | 0 KB |
#include jelly.h #include <bits/stdc++.h> using namespace std; int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) { int n = a.size(); sort(a.begin(), a.end()); int i = 0, cont = 0; while (x - a[i] >= 0 && i < n) { if (x - a[i] >= 0) { cont++; x -= a[i]; } i++; } return cont; }