結果

問題 No.716 距離
ユーザー kmtrc130kmtrc130
提出日時 2019-03-15 16:56:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 699 bytes
コンパイル時間 2,478 ms
コンパイル使用メモリ 104,368 KB
実行使用メモリ 24,088 KB
最終ジャッジ日時 2023-09-14 12:34:12
合計ジャッジ時間 7,886 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
21,956 KB
testcase_01 AC 75 ms
21,968 KB
testcase_02 AC 75 ms
21,932 KB
testcase_03 AC 76 ms
21,932 KB
testcase_04 AC 75 ms
24,008 KB
testcase_05 AC 77 ms
23,940 KB
testcase_06 AC 76 ms
23,984 KB
testcase_07 AC 67 ms
21,936 KB
testcase_08 AC 67 ms
19,732 KB
testcase_09 AC 67 ms
21,744 KB
testcase_10 AC 76 ms
21,868 KB
testcase_11 AC 76 ms
21,936 KB
testcase_12 AC 75 ms
21,920 KB
testcase_13 AC 75 ms
24,020 KB
testcase_14 AC 68 ms
21,908 KB
testcase_15 AC 76 ms
22,024 KB
testcase_16 AC 75 ms
21,956 KB
testcase_17 AC 76 ms
21,964 KB
testcase_18 AC 68 ms
21,844 KB
testcase_19 AC 77 ms
23,976 KB
testcase_20 AC 67 ms
21,776 KB
testcase_21 AC 74 ms
19,928 KB
testcase_22 AC 76 ms
24,012 KB
testcase_23 AC 67 ms
23,912 KB
testcase_24 AC 76 ms
24,052 KB
testcase_25 AC 74 ms
19,884 KB
testcase_26 AC 76 ms
21,944 KB
testcase_27 AC 75 ms
23,992 KB
testcase_28 AC 68 ms
21,760 KB
testcase_29 AC 76 ms
21,908 KB
testcase_30 AC 75 ms
21,944 KB
testcase_31 AC 75 ms
22,076 KB
testcase_32 AC 75 ms
21,932 KB
testcase_33 AC 76 ms
21,960 KB
testcase_34 AC 76 ms
22,004 KB
testcase_35 AC 67 ms
21,748 KB
testcase_36 AC 75 ms
24,000 KB
testcase_37 AC 68 ms
21,764 KB
testcase_38 AC 75 ms
24,088 KB
testcase_39 AC 76 ms
21,952 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.Linq;
using System.Collections.Generic;

class Program
{
    public void Solve()
    {
        int N = int.Parse(Console.ReadLine());
        List<int> a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();

        int min = int.MaxValue;
        int prePoint = a.Min();
        foreach (var point in a.OrderBy(x => x).Skip(1))
        {
            var diff = Math.Abs(point - prePoint);
            min = (diff < min ? diff : min);
            prePoint = point;
        }
        Console.WriteLine(min);
        Console.WriteLine(a.Max() - a.Min());
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0