# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1059008 | Tonyl | Jobs (BOI24_jobs) | C++17 | 66 ms | 22956 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;
using ll = long long;
#define int ll
using vi = vector<int>;
using pi = pair<ll,ll>;
#define REP(i,n) for (int i = 0; i < n; i++)
#define trav(a,x) for (auto& a : x)
#define D(x) //cerr << #x << ": " << x << endl;
#define all(x) (x).begin(), (x).end()
const int MAX_N = 3*1e5+3;
int n; ll s;
vi children[MAX_N];
int values[MAX_N];
bool done[MAX_N];
priority_queue<pi, vector<pi>, greater<pi>> q;
ll mineq = 0;
void dfs(int i, ll neq, ll pos, bool prev_pos) {
assert(!done[i]);
done[i] = 1;
if (values[i] >= 0) pos += values[i];
if (pos > neq) {
q.push({max(mineq,neq), pos-neq});
mineq = max(mineq,neq);
pos = 0;
# | 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... |