답안 #840914

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
840914 2023-08-31T21:11:23 Z study 봉쇄 시간 (IOI23_closing) C++17
0 / 100
82 ms 17124 KB
#include "closing.h"

#include <bits/stdc++.h>
using namespace std;

int max_score(int N, int X, int Y, long long K,
              std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
        vector<vector<pair<int,int>>> adj(N);
        for (int i=0; i<N; ++i){
                adj[U[i]].emplace_back(V[i],W[i]);
                adj[V[i]].emplace_back(U[i],W[i]);
        }
        vector<bool> vu(N);
        multiset<pair<int,int>> st;
        st.emplace(0,X);
        st.emplace(0,Y);
        vu[X] = vu[Y] = 1;
        int ans = 0;
        while (!st.empty()){
                auto [w,u] = *st.begin();
                st.erase(st.begin());
                if (K >= w){
                        K -= w;
                        ++ans;
                }
                for (auto [v,w2]:adj[u])
                        if (!vu[v]){
                                vu[v] = true;
                                st.emplace(w2+w,v);
                        }
        }
        return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 82 ms 17124 KB 1st lines differ - on the 1st token, expected: '451', found: '175384'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -