| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 64205 | gs14004 | 두 로봇 (KOI18_robot) | C++17 | 148 ms | 59748 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;
using lint = long long;
const int MAXN = 255555;
vector<pi> gph[MAXN];
vector<int> v;
int n, s, e;
int par[MAXN], pae[MAXN];
void dfs(int x, int p){
	for(auto &i : gph[x]){
		if(i.second != p){
			par[i.second] = x;
			pae[i.second] = i.first;
			dfs(i.second, x);
		}
	}
}
int main(){
	scanf("%d %d %d",&n,&s,&e);
	if(s == e){
		puts("0");
		return 0;
	}
	for(int i=0; i<n-1; i++){
		int x, y, v;
		scanf("%d %d %d",&x,&y,&v);
		gph[x].push_back(pi(v, y));
		gph[y].push_back(pi(v, x));
	}
	dfs(s, -1);
	while(e != s){
		v.push_back(pae[e]);
		e = par[e];
	}
	cout << accumulate(v.begin(), v.end(), 0) - *max_element(v.begin(), v.end()) << endl;
}
컴파일 시 표준 에러 (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... | ||||
