Submission #321842

# Submission time Handle Problem Language Result Execution time Memory
321842 2020-11-13T12:45:49 Z Pety Jelly Flavours (IOI20_jelly) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <"jelly.h">

using namespace std;

int n, m, dp[1002][1002], dp2[1002][1002], mn[1002];

struct meh {
  int a, b, i;
} obj[1002];

bool cmp (meh a, meh b) {
  return a.a < b.a;
}

int find_maximum_unique(int x, int y, vector<int> a, vector<int> b) {
  int n = a.size();
  int ans = 0;
  for (int i = 0; i < n; i++)
    obj[i + 1] = {a[i], b[i], i};
  sort(obj + 1, obj + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
     mn[i] = 2e9;
    for (int j = 0; j <= x;j++) {
      dp[i][j] = dp[i - 1][j] + obj[i].b;
      if (j >= obj[i].a)
        dp[i][j] = min(dp[i][j], dp[i - 1][j - obj[i].a]);
      mn[i] = min(mn[i], dp[i][j]);
    }
  }
  for (int i = n; i >= 1; i--)
    for (int j = obj[i].b; j <= y; j++)
     dp2[i][j] = min(dp2[i + 1][j], dp2[i][j - obj[i].b] + 1);
  for (int i = 0; i <= n; i++) {
    int cst = y - mn[i];
    if (cst > 0)
      ans = max(ans, i + dp2[i + 1][cst]);
  }
  return ans;
}

Compilation message

jelly.cpp:2:10: fatal error: "jelly.h": No such file or directory
    2 | #include <"jelly.h">
      |          ^~~~~~~~~~~
compilation terminated.