#include "swap.h"
#include <bits/stdc++.h>
using namespace std;
vector <vector <pair <int, int>>> adj;
int n, m, mn = 1e9;
void init(int N, int M, vector<int> U, vector<int> V, vector<int> W) {
adj.resize(N+1);
n = N;
m = M;
for (int i = 0; i < M; i++) {
adj[U[i]].push_back({V[i], W[i]});
mn = min(mn, W[i]);
}
}
int getMinimumFuelCapacity(int x, int y) {
if (x == 0 || y == 0)
return max(mn, adj[max(x, y)][0].second);
return max({mn, adj[x][0].second, adj[y][0].second});
}
// int main() {
// int N, M;
// cin >> N >> M;
// vector <int> u(M), v(M), w(M);
// for (int i = 0; i < M; i++)
// cin >> u[i] >> v[i] >> w[i];
// init(N, M, u, v, w);
// int q;
// cin >> q;
// while (q--) {
// int x, y;
// cin >> x >> y;
// cout << getMinimumFuelCapacity(x, y) << '\n';
// }
// }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |