# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
545514 | mat50013 | Parkovi (COCI22_parkovi) | C++11 | 1031 ms | 34832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int NMAX(200005);
const ll MAXX(1e16);
vector<pair<int, int> > G[NMAX];
vector<int> aux;
int n, k, fr[NMAX];
ll dis[NMAX];
inline pair<ll, ll> DFS(int nod, int tata, ll cat, ll dUnd)
{
pair<ll, ll> sol = {MAXX, -MAXX};
for(auto it: G[nod])
if(it.first != tata)
{
auto ce = DFS(it.first, nod, cat, it.second);
if(ce.first != MAXX)
sol.first = min(sol.first, ce.first + it.second);
if(ce.second != -MAXX)
sol.second = max(sol.second, ce.second + it.second);
}
if(sol.first > cat && sol.second < 0)
{
sol.first = MAXX;
sol.second = 0;
}
if(sol.first != MAXX && sol.second != -MAXX && sol.first + sol.second <= cat)
# | 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... |