結果

問題 No.135 とりあえず1次元の問題
ユーザー bluemeganebluemegane
提出日時 2018-10-24 20:17:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 481 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 103,748 KB
実行使用メモリ 29,720 KB
最終ジャッジ日時 2023-08-12 06:58:54
合計ジャッジ時間 5,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
29,288 KB
testcase_01 AC 59 ms
22,744 KB
testcase_02 AC 59 ms
22,788 KB
testcase_03 AC 57 ms
22,788 KB
testcase_04 AC 58 ms
20,800 KB
testcase_05 AC 60 ms
18,636 KB
testcase_06 AC 59 ms
22,724 KB
testcase_07 AC 59 ms
20,792 KB
testcase_08 AC 59 ms
20,688 KB
testcase_09 AC 61 ms
22,724 KB
testcase_10 AC 61 ms
22,720 KB
testcase_11 AC 61 ms
20,692 KB
testcase_12 AC 66 ms
22,852 KB
testcase_13 AC 59 ms
20,816 KB
testcase_14 AC 67 ms
22,860 KB
testcase_15 AC 66 ms
20,800 KB
testcase_16 AC 67 ms
20,884 KB
testcase_17 AC 67 ms
20,816 KB
testcase_18 AC 65 ms
22,904 KB
testcase_19 AC 67 ms
20,908 KB
testcase_20 AC 66 ms
22,960 KB
testcase_21 AC 110 ms
29,720 KB
testcase_22 AC 122 ms
27,320 KB
evil01.txt AC 118 ms
27,284 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using static System.Math;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        Array.Sort(a);
        var ans = 10000000;
        for (int i = 1; i < n; i++)
            if (a[i] != a[i - 1]) ans = Min(ans, a[i] - a[i - 1]);
        Console.WriteLine(ans == 10000000 ? 0 : ans);
    }
}
0