답안 #82475

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
82475 2018-10-31T02:52:12 Z namps Commuter Pass (JOI18_commuter_pass) C++14
0 / 100
77 ms 1448 KB
#include <bits/stdc++.h>

using namespace std;
int n,m,s,t,u,v;
int l,r,h;
int kq;
int dp[305][305];
int main()
{
  //  freopen("vao.inp","r",stdin);
    cin>>n>>m;
    cin>>s>>t;
    cin>>u>>v;
    for (int i=1;i<=n;i++)
    for (int j=1;j<=n;j++) dp[i][j]=1000000000;
    for (int i=1;i<=n;i++) dp[i][i]=0;
    while (m--)
    {
        cin>>l>>r>>h;
        dp[l][r]=min(dp[l][r],h);
        dp[r][l]=dp[l][r];
    }
    for (int k=1;k<=n;k++)
    for (int i=1;i<=n;i++)
    for (int j=1;j<=n;j++)
    {
        dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j]);
    }
    kq=1000000000;
    for (int i=1;i<=n;i++)
    for (int j=1;j<=n;j++)
    {
        if (dp[s][t]==dp[s][i]+dp[i][j]+dp[j][t])
        {
            kq=min(kq,dp[i][u]+dp[j][v]);
        }
    }
    cout<<kq;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 1272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 4 ms 1344 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 77 ms 1448 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 1272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -