# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
209424 | model_code | Solar Storm (NOI20_solarstorm) | C++17 | 527 ms | 148288 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;
const int N = 1e6 + 5;
#define ll long long
ll A[N], prefix[N];
int V[N];
int nxt[N], before[N], parent[N];
vector<int> adj[N];
int n, s, ans_start;
ll ans = 0;
vector<int> LOL;
void dfs(int u) {
LOL.push_back(u);
if(u != n) {
int l = before[u];
int r = nxt[LOL[max(0, (int)LOL.size() - s)]] - 1;
ll candidate = prefix[r] - (l == -1 ? 0 : prefix[l]);
//cout<<"DBG --> "<<u<<" : "<<l<<" "<<r<<" : "<<candidate<<endl;
if(candidate > ans) {
ans = candidate;
ans_start = u;
}
}
for(auto v : adj[u]) {
dfs(v);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |