# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
387170 | talant117408 | 자매 도시 (APIO20_swap) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//~ #include "swap.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) int((v).size())
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define OK cout << "OK" << endl;
const int N = 1e5+7;
vector <pii> graph[N];
int mx;
bool less3 = 1, less2 = 0;
void init(int n, int m, vector<int> U, vector<int> V, vector<int> W) {
for (int i = 0; i < m; i++) {
graph[U[i]].pb(mp(V[i], W[i]));
graph[V[i]].pb(mp(U[i], W[i]));
}
for (int i = 0; i < n; i++) {
if (sz(graph[i]) > 2) less3 = 0;
}
if (less3) {
for (int i = 0; i < n; i++) {
if (sz(graph[i]) == 1) less2 = 1;
}
if (!less2) mx = *max_element(all(W));
}
}
int getMinimumFuelCapacity(int X, int Y) {
if (less3) {
if (less2) return -1;
return mx;
}
}