# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
570487 | groshi | 구슬과 끈 (APIO14_beads) | C++17 | 183 ms | 32608 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define int long long
int inf=1e9;
struct wi{
vector<int> Q;
long long dp[4]={0,0,0,0};///0->srodek i zost, 1->srodek i gora, 2->pocz, 3-> kon
long long do_ojca=0;
}*w;
void dfs(int x,int ojc)
{
if(w[x].Q.size()==2 && ojc!=0)
return;
long long a=-inf,b=-inf,c=-inf,d=-inf,e=-inf;
int gdzie1,gdzie2,skad1,skad2;
long long suma=0;
for(int i=0;i<w[x].Q.size();i+=2)
{
int pom=w[x].Q[i];
int koszt=w[x].Q[i+1];
if(pom==ojc)
continue;
w[pom].do_ojca=koszt;
dfs(pom,x);
long long teraz=max(w[pom].dp[0],w[pom].dp[2]);
suma+=teraz;
long long srodek=max(w[pom].dp[1],w[pom].dp[3])-teraz;
if(srodek>e)
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |