| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 950469 | ALTAKEXE | Jelly Flavours (IOI20_jelly) | C++14 | 36 ms | 772 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>
#define ll long long int
#define f first
#define s second
#define pii pair<ll, ll>
using namespace std;
int find_maximum_unique(int x, int y, vector<int> a, vector<int> b)
{
ll n = a.size();
vector<pii> v(n);
for (ll i = 0; i < n; i++)
v.push_back({a[i], b[i]});
sort(v.begin(), v.end());
vector<ll> dp;
vector<ll> umn(x + 1, 0);
umn[0] = 0;
ll i;
for (ll i = 0; i < n; i++)
{
ll ok = 0;
dp = vector<ll>(x + 1, INT_MAX);
ll A = v[i].f, B = v[i].s;
for (ll j = 0; j <= x; j++)
{
dp[j] = umn[j] + B;
if (j - A >= 0)
dp[j] = min(dp[j], umn[j - A]);
ok |= (dp[j] <= y);
}
if (!ok)
break;
swap(dp, umn);
}
return i;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
