답안 #287152

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
287152 2020-08-31T12:47:40 Z Tangent Detecting Molecules (IOI16_molecules) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#ifdef TEST
#include "molecules.h"
#else
#include "grader.h"
#endif

using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// find_by_order(), order_of_key()

typedef long long ll;
typedef long double dd;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<dd, dd> pdd;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<dd> vdd;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdd;
typedef vector<vii> vvii;
typedef vector<vll> vvll;
typedef vector<vdd> vvdd;
typedef vector<vpii> vvpii;
typedef vector<vpll> vvpll;
typedef vector<vpdd> vvpdd;
typedef vector<bool> vb;

const int inf = 1 << 30;

#define rep(i, n) for (ll i = 0; i < n; i++)
#define ffor(i, a, b) for(ll i = a; i < b; i++)
#define forin(x, a) for (auto &x: a)
#define all(x) x.begin(), x.end()

#ifdef TEST
#define dbg(x) cout << #x << ": " << x << '\n';
#define dbgc(x) cout << #x << ":"; forin(a, x) { cout << " " << a; } cout << endl;
#define tassert(x) assert(x);
#else
#define dbg(x)
#define dbgc(x)
#define tassert(x)
#endif

std::vector<int> find_subset(int l, int u, std::vector<int> w) {
  vpii nums;
  ll tot = 0;
  rep(i, w.size()) {
    nums.emplace_back(w[i], i);
    tot += w[i];
  }
  if (tot < l) {
    return vii();
  }

  sort(nums.rbegin(), nums.rend());
  map<ll, int> reached;
  reached[0] = -1;
  for (auto &[num, i]: nums) {
    vpll toadd;
    for (auto it = reached.cbegin(); it != reached.cend();) {
      if (it->first < l - tot) {
        reached.erase(it++);
      } else {
        ll k = it->first + num;
        if (reached.find(k) == reached.end()) {
          if (k > u) {
            break;
          }
          toadd.emplace_back(k, i);
        }
        it++;
      }
    }
    for (auto &[num, i]: toadd) {
      reached[num] = i;
    }
    if (reached.rbegin()->first >= l) {
      break;
    }
    tot -= num;
  }
  vii res;
  if (reached.rbegin()->first >= l) {
    int curr = reached.rbegin()->first;
    while (curr) {
      res.emplace_back(reached[curr]);
      curr -= w[reached[curr]];
    }
  }
  return res;
}

Compilation message

molecules.cpp:5:10: fatal error: grader.h: No such file or directory
    5 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.