답안 #1069448

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1069448 2024-08-22T00:07:02 Z pawned 자매 도시 (APIO20_swap) C++17
7 / 100
72 ms 16736 KB
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")

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

#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;

#include "swap.h"

const int MAX = 1e5 + 5;

int N, M;

vector<ii> adj[MAX];	// {vertex, dist}

vi wt;

int cost[MAX];

void init(int N_g, int M_g, vi U_g, vi V_g, vi W_g) {
	N = N_g;
	M = M_g;
	for (int i = 0; i < M; i++) {
		adj[U_g[i]].pb({V_g[i], W_g[i]});
		adj[V_g[i]].pb({U_g[i], W_g[i]});
		cost[max(U_g[i], V_g[i])] = W_g[i];
		wt.pb(W_g[i]);
	}
	sort(wt.begin(), wt.end());
}

int getMinimumFuelCapacity(int X, int Y) {
	if (N == 2 || N == 3)
		return -1;
	if (X == 0)
		return max(wt[2], cost[Y]);
	return max(wt[2], max(cost[X], cost[Y]));
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2908 KB Output is correct
4 Incorrect 1 ms 2908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 68 ms 16236 KB Output is correct
4 Correct 63 ms 16428 KB Output is correct
5 Correct 72 ms 16736 KB Output is correct
6 Correct 63 ms 16172 KB Output is correct
7 Correct 66 ms 16712 KB Output is correct
8 Correct 62 ms 16248 KB Output is correct
9 Correct 64 ms 16288 KB Output is correct
10 Correct 64 ms 16260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2908 KB Output is correct
4 Incorrect 1 ms 2908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2908 KB Output is correct
4 Incorrect 1 ms 2908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2908 KB Output is correct
4 Incorrect 1 ms 2908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2904 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2908 KB Output is correct
4 Incorrect 1 ms 2908 KB Output isn't correct
5 Halted 0 ms 0 KB -