結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
29,432 KB
testcase_01 AC 59 ms
22,772 KB
testcase_02 AC 60 ms
20,672 KB
testcase_03 WA -
testcase_04 AC 59 ms
20,648 KB
testcase_05 AC 59 ms
22,768 KB
testcase_06 AC 60 ms
20,712 KB
testcase_07 AC 60 ms
20,720 KB
testcase_08 AC 59 ms
20,840 KB
testcase_09 AC 60 ms
22,704 KB
testcase_10 AC 60 ms
20,656 KB
testcase_11 AC 59 ms
20,804 KB
testcase_12 AC 67 ms
19,008 KB
testcase_13 AC 59 ms
20,800 KB
testcase_14 AC 68 ms
20,928 KB
testcase_15 AC 67 ms
20,960 KB
testcase_16 AC 67 ms
20,948 KB
testcase_17 AC 67 ms
22,856 KB
testcase_18 AC 66 ms
20,904 KB
testcase_19 AC 67 ms
20,820 KB
testcase_20 AC 67 ms
22,868 KB
testcase_21 AC 111 ms
27,896 KB
testcase_22 AC 125 ms
27,356 KB
evil01.txt AC 121 ms
27,440 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;
                }
            }
            Console.WriteLine(min);

        }

    }
}
0