# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1037726 | 2024-07-29T07:25:13 Z | fv3 | 봉쇄 시간 (IOI23_closing) | C++17 | 79 ms | 26196 KB |
#include "closing.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1ll << 60ll; int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) { vector<vector<pair<int, ll>>> adj(N); for (int i = 0; i < U.size(); i++) { adj[U[i]].push_back({V[i], W[i]}); adj[V[i]].push_back({U[i], W[i]}); } priority_queue<pair<ll, int>> q; q.push({0, X}); q.push({0, Y}); vector<int> visited(N); vector<ll> dist(N, INF); dist[X] = 0; dist[Y] = 0; int res = 0; while (!q.empty()) { int s = q.top().second; q.pop(); if (visited[s]) continue; visited[s] = 1; K -= dist[s]; if (K < 0) break; res++; for (auto node : adj[s]) { if (!visited[node.first] && dist[s] + node.second < dist[node.first]) { dist[node.first] = dist[s] + node.second; q.push({-dist[node.first], node.first}); } } } return res; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 62 ms | 22356 KB | Output is correct |
2 | Correct | 79 ms | 26196 KB | Output is correct |
3 | Correct | 43 ms | 5460 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 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 | 0 ms | 344 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 | 0 ms | 344 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 | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |