| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 428536 | snasibov05 | 자매 도시 (APIO20_swap) | C++14 | 2050 ms | 524292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "swap.h"
#include <vector>
#include <queue>
using namespace std;
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define oo 1000000001
vector<vector<pii>> ed;
struct data{
int u, v;
int cost;
bool operator>(data d) const{
if (cost != d.cost) return cost > d.cost;
else if (u != d.u) return u > d.u;
else return v > d.v;
}
};
void init(int n, int m, vector<int> u, vector<int> v, vector<int> w) {
ed.resize(n);
for (int i = 0; i < m; ++i) {
ed[u[i]].pb({v[i], w[i]});
ed[v[i]].pb({u[i], w[i]});
}
}
int getMinimumFuelCapacity(int x, int y) {
int n = ed.size();
vector<vector<int>> cost(n, vector<int>(n, oo));
vector<vector<bool>> visited(n, vector<bool>(n));
cost[x][y] = 0;
priority_queue<data, vector<data>, greater<data>> pq;
pq.push({x, y, 0});
while (!pq.empty()){
data cur = pq.top();
pq.pop();
if (visited[cur.u][cur.v]) continue;
visited[cur.u][cur.v] = true;
cost[cur.u][cur.v] = min(cost[cur.u][cur.v], cur.cost);
for (auto [to, w] : ed[cur.u]){
if (visited[to][cur.v]) continue;
if (to == cur.v) continue;
cost[to][cur.v] = min(cost[to][cur.v], max(cost[cur.u][cur.v], w));
pq.push({to, cur.v, cost[to][cur.v]});
}
for (auto [to, w] : ed[cur.v]){
if (visited[cur.u][to]) continue;
if (to == cur.u) continue;
cost[cur.u][to] = min(cost[cur.u][to], max(cost[cur.u][cur.v], w));
pq.push({cur.u, to, cost[cur.u][to]});
}
}
if (cost[y][x] == oo) cost[y][x] = -1;
return cost[y][x];
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
