結果

問題 No.135 とりあえず1次元の問題
ユーザー mencottonmencotton
提出日時 2017-12-29 21:04:43
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 985 ms
コンパイル使用メモリ 111,024 KB
実行使用メモリ 32,112 KB
最終ジャッジ日時 2024-06-01 06:42:04
合計ジャッジ時間 3,209 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
29,992 KB
testcase_01 AC 31 ms
25,132 KB
testcase_02 AC 31 ms
25,376 KB
testcase_03 WA -
testcase_04 AC 31 ms
25,264 KB
testcase_05 AC 32 ms
25,252 KB
testcase_06 AC 31 ms
25,260 KB
testcase_07 AC 32 ms
25,268 KB
testcase_08 AC 32 ms
25,528 KB
testcase_09 AC 32 ms
27,420 KB
testcase_10 AC 31 ms
25,252 KB
testcase_11 AC 31 ms
25,128 KB
testcase_12 AC 36 ms
27,748 KB
testcase_13 AC 31 ms
25,380 KB
testcase_14 AC 36 ms
25,504 KB
testcase_15 AC 35 ms
23,472 KB
testcase_16 AC 36 ms
25,764 KB
testcase_17 AC 36 ms
25,508 KB
testcase_18 AC 35 ms
25,508 KB
testcase_19 AC 36 ms
27,676 KB
testcase_20 AC 36 ms
25,764 KB
testcase_21 AC 84 ms
32,112 KB
testcase_22 AC 93 ms
31,952 KB
evil01.txt AC 92 ms
31,724 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;

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