結果

問題 No.1344 Typical Shortest Path Sum
ユーザー keymoonkeymoon
提出日時 2021-01-17 00:34:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 1,145 bytes
コンパイル時間 3,155 ms
コンパイル使用メモリ 104,936 KB
実行使用メモリ 24,080 KB
最終ジャッジ日時 2023-08-19 02:51:07
合計ジャッジ時間 11,839 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
21,976 KB
testcase_01 AC 65 ms
21,900 KB
testcase_02 AC 64 ms
21,860 KB
testcase_03 AC 66 ms
21,960 KB
testcase_04 AC 65 ms
24,028 KB
testcase_05 AC 65 ms
23,924 KB
testcase_06 AC 62 ms
21,896 KB
testcase_07 AC 63 ms
22,048 KB
testcase_08 AC 67 ms
21,940 KB
testcase_09 AC 65 ms
21,996 KB
testcase_10 AC 64 ms
22,016 KB
testcase_11 AC 63 ms
21,896 KB
testcase_12 AC 64 ms
21,824 KB
testcase_13 AC 64 ms
24,076 KB
testcase_14 AC 64 ms
24,048 KB
testcase_15 AC 65 ms
23,940 KB
testcase_16 AC 66 ms
21,996 KB
testcase_17 AC 63 ms
24,080 KB
testcase_18 AC 64 ms
24,020 KB
testcase_19 AC 65 ms
23,944 KB
testcase_20 AC 68 ms
21,988 KB
testcase_21 AC 67 ms
23,932 KB
testcase_22 AC 66 ms
22,020 KB
testcase_23 AC 67 ms
22,108 KB
testcase_24 AC 66 ms
21,788 KB
testcase_25 AC 67 ms
23,896 KB
testcase_26 AC 64 ms
24,036 KB
testcase_27 AC 63 ms
19,804 KB
testcase_28 AC 64 ms
19,948 KB
testcase_29 AC 63 ms
21,996 KB
testcase_30 AC 64 ms
19,856 KB
testcase_31 AC 62 ms
21,964 KB
testcase_32 AC 65 ms
22,004 KB
testcase_33 AC 67 ms
21,836 KB
testcase_34 AC 64 ms
21,892 KB
testcase_35 AC 67 ms
21,792 KB
testcase_36 AC 65 ms
23,980 KB
testcase_37 AC 65 ms
22,024 KB
testcase_38 AC 65 ms
23,932 KB
testcase_39 AC 63 ms
23,876 KB
testcase_40 AC 69 ms
21,900 KB
testcase_41 AC 75 ms
21,964 KB
testcase_42 AC 74 ms
23,964 KB
testcase_43 AC 70 ms
22,112 KB
testcase_44 AC 69 ms
24,048 KB
testcase_45 AC 71 ms
24,048 KB
testcase_46 AC 70 ms
21,968 KB
testcase_47 AC 71 ms
21,840 KB
testcase_48 AC 69 ms
21,904 KB
testcase_49 AC 69 ms
21,984 KB
testcase_50 AC 68 ms
23,948 KB
testcase_51 AC 68 ms
21,832 KB
testcase_52 AC 69 ms
21,920 KB
testcase_53 AC 73 ms
22,048 KB
testcase_54 AC 70 ms
21,880 KB
testcase_55 AC 71 ms
23,968 KB
testcase_56 AC 69 ms
19,904 KB
testcase_57 AC 72 ms
21,968 KB
testcase_58 AC 71 ms
23,976 KB
testcase_59 AC 71 ms
21,892 KB
testcase_60 AC 63 ms
19,968 KB
testcase_61 AC 62 ms
21,856 KB
testcase_62 AC 67 ms
22,056 KB
testcase_63 AC 67 ms
23,948 KB
testcase_64 AC 65 ms
23,940 KB
testcase_65 AC 70 ms
23,948 KB
testcase_66 AC 70 ms
23,940 KB
testcase_67 AC 67 ms
24,016 KB
testcase_68 AC 65 ms
23,944 KB
testcase_69 AC 66 ms
23,932 KB
testcase_70 AC 65 ms
21,996 KB
testcase_71 AC 63 ms
21,920 KB
testcase_72 AC 63 ms
24,056 KB
testcase_73 AC 64 ms
22,036 KB
testcase_74 AC 62 ms
19,980 KB
testcase_75 AC 63 ms
21,904 KB
testcase_76 AC 66 ms
21,988 KB
testcase_77 AC 64 ms
23,908 KB
testcase_78 AC 62 ms
21,892 KB
testcase_79 AC 64 ms
19,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var n = nm[0];
        var m = nm[1];
        long[][] mat = Enumerable.Repeat(0, n).Select(_ => Enumerable.Repeat(long.MaxValue / 2, n).ToArray()).ToArray();
        for (int i = 0; i < n; i++) mat[i][i] = 0;
        for (int i = 0; i < m; i++)
        {
            var st = Console.ReadLine().Split().Select(x => long.Parse(x)).ToArray();
            mat[st[0] - 1][st[1] - 1] = Min(mat[st[0] - 1][st[1] - 1], st[2]);
        }
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                for (int k = 0; k < n; k++)
                    mat[j][k] = Min(mat[j][k], mat[j][i] + mat[i][k]);
        for (int i = 0; i < n; i++) Console.WriteLine(mat[i].Sum(x => long.MaxValue / 4 < x ? 0 : x));
    }
}
0