結果

問題 No.135 とりあえず1次元の問題
ユーザー funakoshifunakoshi
提出日時 2019-06-25 13:44:02
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,181 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 102,888 KB
実行使用メモリ 29,924 KB
最終ジャッジ日時 2023-09-05 03:08:31
合計ジャッジ時間 5,113 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
27,572 KB
testcase_01 AC 58 ms
18,708 KB
testcase_02 AC 59 ms
20,636 KB
testcase_03 WA -
testcase_04 AC 60 ms
22,776 KB
testcase_05 AC 62 ms
20,588 KB
testcase_06 AC 61 ms
20,820 KB
testcase_07 AC 60 ms
20,720 KB
testcase_08 AC 59 ms
20,844 KB
testcase_09 AC 60 ms
22,764 KB
testcase_10 AC 59 ms
22,768 KB
testcase_11 AC 60 ms
20,720 KB
testcase_12 AC 67 ms
20,916 KB
testcase_13 AC 59 ms
20,792 KB
testcase_14 AC 66 ms
21,056 KB
testcase_15 AC 67 ms
21,100 KB
testcase_16 AC 67 ms
18,948 KB
testcase_17 AC 67 ms
20,956 KB
testcase_18 AC 65 ms
18,876 KB
testcase_19 AC 67 ms
21,096 KB
testcase_20 AC 67 ms
20,992 KB
testcase_21 AC 112 ms
29,924 KB
testcase_22 AC 122 ms
29,396 KB
evil01.txt AC 121 ms
29,660 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 yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string N = Console.ReadLine();
            string X = Console.ReadLine();
            string[] kyoristr = X.Split(' ');
            int[] kyori = new int[int.Parse(N)];
            int min = 1000000;

            for (int i = 0; i < kyori.Length; i++)
            {
                kyori[i] = int.Parse(kyoristr[i]);
            }

            Array.Sort(kyori);
            Array.Reverse(kyori);

            for (int i = 0; i < kyori.Length - 1; i++)
            {
                if (kyori[i] == kyori[i + 1])
                {
                    continue;
                }
                int temp = kyori[i] - kyori[i + 1];
                if (min > temp)
                {
                    min = temp;
                }
            }
            if (int.Parse(N) == 0)
            {
                Console.WriteLine("0");
            }
            else
            {
                Console.WriteLine(min);
            }
        }

    }
}
0