제출 #1117032

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
11170322024-11-22 19:01:32pedroslrey여행하는 상인 (APIO17_merchant)C++17
33 / 100
91 ms1104 KiB
#include <bits/stdc++.h>
using namespace std;
using lli = long long;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<vector<int>> bs(n, vector<int>(k)), ss(n, vector<int>(k));
for (int i = 0; i < n; ++i)
for (int j = 0; j < k; ++j)
cin >> bs[i][j] >> ss[i][j];
vector<vector<lli>> dist(n, vector<lli>(n, 1e18));
for (int i = 0; i < m; ++i) {
int u, v, w;
cin >> u >> v >> w;
dist[u - 1][v - 1] = w;
}
for (int i = 0; i < n; ++i)
dist[i][i] = 0;
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j)
for (int z = 0; z < n; ++z)
if (dist[j][z] > dist[j][i] + dist[i][z])
dist[j][z] = dist[j][i] + dist[i][z];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...