結果

問題 No.135 とりあえず1次元の問題
ユーザー mencottonmencotton
提出日時 2017-12-25 23:31:14
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 105,216 KB
実行使用メモリ 28,032 KB
最終ジャッジ日時 2024-05-10 01:12:20
合計ジャッジ時間 2,868 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
27,264 KB
testcase_01 AC 29 ms
19,200 KB
testcase_02 WA -
testcase_03 AC 29 ms
19,456 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 33 ms
19,840 KB
testcase_13 AC 30 ms
19,072 KB
testcase_14 AC 33 ms
19,840 KB
testcase_15 AC 33 ms
19,840 KB
testcase_16 WA -
testcase_17 AC 35 ms
19,712 KB
testcase_18 AC 34 ms
19,968 KB
testcase_19 AC 33 ms
19,584 KB
testcase_20 AC 33 ms
19,584 KB
testcase_21 WA -
testcase_22 WA -
evil01.txt AC 91 ms
27,904 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.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace template
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 1) Console.WriteLine(0);
            else
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                Array.Sort(x);
                int ret = int.MaxValue;
                for (int i = 1; i < n; i++)
                {
                    ret = Math.Min(ret, x[i] - x[i - 1]);
                }
                Console.WriteLine(ret);
            }
        }
    }
}
0