結果

問題 No.716 距離
ユーザー NoNo
提出日時 2018-08-24 23:54:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 3,238 ms
コンパイル使用メモリ 105,180 KB
実行使用メモリ 25,728 KB
最終ジャッジ日時 2023-09-05 15:50:18
合計ジャッジ時間 7,505 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
21,672 KB
testcase_01 AC 71 ms
21,832 KB
testcase_02 AC 70 ms
19,840 KB
testcase_03 AC 70 ms
21,608 KB
testcase_04 AC 70 ms
19,828 KB
testcase_05 AC 71 ms
21,672 KB
testcase_06 AC 71 ms
25,728 KB
testcase_07 AC 62 ms
23,568 KB
testcase_08 AC 62 ms
19,612 KB
testcase_09 AC 61 ms
21,532 KB
testcase_10 AC 70 ms
21,672 KB
testcase_11 AC 69 ms
21,800 KB
testcase_12 AC 70 ms
21,696 KB
testcase_13 AC 70 ms
21,612 KB
testcase_14 AC 61 ms
23,644 KB
testcase_15 AC 70 ms
23,708 KB
testcase_16 AC 70 ms
23,728 KB
testcase_17 AC 71 ms
23,764 KB
testcase_18 AC 61 ms
21,524 KB
testcase_19 AC 69 ms
21,752 KB
testcase_20 AC 62 ms
21,464 KB
testcase_21 AC 69 ms
23,788 KB
testcase_22 AC 70 ms
21,920 KB
testcase_23 AC 62 ms
23,564 KB
testcase_24 AC 69 ms
23,776 KB
testcase_25 AC 69 ms
21,708 KB
testcase_26 AC 70 ms
23,712 KB
testcase_27 AC 69 ms
21,804 KB
testcase_28 AC 63 ms
23,592 KB
testcase_29 AC 69 ms
21,744 KB
testcase_30 AC 69 ms
23,796 KB
testcase_31 AC 69 ms
21,732 KB
testcase_32 AC 69 ms
21,864 KB
testcase_33 AC 69 ms
21,692 KB
testcase_34 AC 68 ms
21,796 KB
testcase_35 AC 62 ms
23,584 KB
testcase_36 AC 69 ms
21,760 KB
testcase_37 AC 61 ms
21,668 KB
testcase_38 AC 71 ms
23,912 KB
testcase_39 AC 70 ms
21,708 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;
namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            Array.Sort(a);

            int m = int.MaxValue;
            for (int i = 0; i < n - 1; i++)
            {
                if (a[i + 1] - a[i] < m)
                {
                    m = a[i + 1] - a[i];
                }
            }
            Console.WriteLine(m);
            Console.WriteLine(a[n - 1] - a[0]);
        }
    }
}
0