# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
798463 | Osplei | Roadside Advertisements (NOI17_roadsideadverts) | C++17 | 1065 ms | 5480 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;
int n, u, v, w, a, b, c, d, e, q, vistos, ans;
vector <pair <int, int>> grafo[50005];
bool visto[50005];
int dfs(int nodo, int suma){
if (vistos==5) return 0;
if (nodo==a || nodo==b || nodo==c || nodo==d || nodo==e) {
vistos++;
ans+=max(suma, 0);
suma=0;
}
visto[nodo]=true;
for (auto i:grafo[nodo]) if (visto[i.first]==false) dfs(i.first, suma+i.second);
return suma=-100000;
}
void SOLVE(){
cin >> n;
# | 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... |