답안 #1082681

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1082681 2024-09-01T06:24:50 Z HappyCapybara 봉쇄 시간 (IOI23_closing) C++17
8 / 100
71 ms 20560 KB
#include "closing.h"
#include<bits/stdc++.h>
using namespace std;

#define ll long long

int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W){
    vector<vector<pair<int,int>>> g(N);
    for (int i=0; i<N-1; i++){
        g[U[i]].push_back({V[i], W[i]});
        g[V[i]].push_back({U[i], W[i]});
    }
    int res = 0;
    priority_queue<pair<int,int>> pq;
    vector<bool> seen(N, false);
    pq.push({0, X});
    pq.push({0, Y});
    while (!pq.empty()){
        int cur = pq.top().second, d = -pq.top().first;
        pq.pop();
        if (seen[cur]) continue;
        seen[cur] = true;
        if (d > K) break;
        res++;
        K -= d;
        for (pair<int,int> next : g[cur]) pq.push({-(d+next.second), next.first});
    }
    return res;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 20560 KB Output is correct
2 Correct 71 ms 20448 KB Output is correct
3 Correct 47 ms 5208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '30', found: '17'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '30', found: '17'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '30', found: '17'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '6', found: '5'
2 Halted 0 ms 0 KB -