# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
624219 | MatesV13 | Jelly Flavours (IOI20_jelly) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int find_maximum_unique(int x, int y, int a[], int b[]){
int maks = 0; int n = sizeof(a)/sizeof(a[0]);
for (int i=0; i<pow(3, n); i++){
int tempi = i;
int tempx = x;
int tempy = y;
int br=0;
for (int j=0; j<n; j++){
if (tempi%3){
if (tempi%3==1) tempx -= a[j];
else tempy -= b[j];
br++;
} tempi /= 3;
}
if (tempx >= 0 and tempy >= 0)
maks = max(maks, br);
}
return maks;
}