제출 #1361719

#제출 시각아이디문제언어결과실행 시간메모리
1361719jackhui100101사이버랜드 (APIO23_cyberland)C++20
0 / 100
9 ms2096 KiB
#include "cyberland.h"

#include <bits/stdc++.h>
using namespace std;
vector<vector<double>> am(3, vector<double> (3));
double solve(int n, int m, int k, int h, vector<int> x, vector<int> y, vector<int> c, vector<int> arr){
    double ans1 = 1e18, ans2 = 1e18;
    for (int i = 0; i < m; i++){
        am[x[i]][y[i]] = c[i];
        am[y[i]][x[i]] = c[i];
    }
    if (h == 1){
        if (am[0][1]) ans1 = am[0][1];
        if (am[0][2] && am[2][1]){
            if (arr[2] == 0) ans2 = am[2][1];
            else if (arr[2] == 1) ans2 = am[0][2] + am[2][1];
            else ans2 = am[0][2] / 2 + am[2][1];
        }
    }
    else{
        if (am[0][2]) ans1 = am[0][2];
        if (am[0][1] && am[1][2]){
            if (arr[1] == 0) ans2 = am[1][2];
            else if (arr[1] == 1) ans2 = am[0][1] + am[1][2];
            else ans2 = am[0][1] / 2 + am[1][2];
        }
    }
    if (ans1 > 1e17 && ans2 > 1e17) return -1;
    return min(ans1, ans2);
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…