답안 #985398

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
985398 2024-05-17T18:06:01 Z kkkkkkkk 사이버랜드 (APIO23_cyberland) C++17
0 / 100
1563 ms 2097152 KB
#include <bits/stdc++.h>

using namespace std;

vector<pair<int,int> > G[100005];
double rez;

void dfs(int teme, int kraj, int p, double vreme) {
    if (teme==kraj) {
        rez=vreme;
        return;
    }
    for (auto x:G[teme]) {
        int next=x.first;
        if (p!=next)
            dfs(next, kraj, p, vreme+x.second);
    }
}

double solve(int n, int m, int k, int h, vector<int> a, vector<int> b, vector<int> c, vector<int> arr) {
    for (int i=0;i<m;i++) {
        G[a[i]].push_back({b[i],c[i]});
        G[b[i]].push_back({a[i],c[i]});
    }
    dfs(0,h,-1,0);
    return rez;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1563 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1263 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1268 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1253 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1316 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1272 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1286 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1299 ms 2097152 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -