| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1046356 | 12345678 | Cheap flights (LMIO18_pigus_skrydziai) | C++17 | 3069 ms | 208672 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int nx=5e3+5;
#define ll long long
ll n, m, dist[nx][nx], u, v, w, dp[nx], mx;
vector<tuple<ll, ll, ll>> d;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>m;
for (int i=1; i<=m; i++) cin>>u>>v>>w, dist[u][v]=w, dist[v][u]=w, d.push_back({u, v, w}), dp[u]+=w, dp[v]+=w;
for (int i=1; i<=n; i++) mx=max(mx, dp[i]);
for (auto [u, v, w]:d) for (int i=1; i<=n; i++) if (dist[u][i]!=0&&dist[v][i]!=0) mx=max(mx, w+dist[u][i]+dist[v][i]);
cout<<mx;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
