結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
27,444 KB
testcase_01 AC 59 ms
22,760 KB
testcase_02 AC 59 ms
20,720 KB
testcase_03 AC 58 ms
20,816 KB
testcase_04 AC 60 ms
20,724 KB
testcase_05 AC 60 ms
20,804 KB
testcase_06 AC 60 ms
20,716 KB
testcase_07 AC 60 ms
22,828 KB
testcase_08 AC 60 ms
20,872 KB
testcase_09 AC 61 ms
22,768 KB
testcase_10 AC 62 ms
20,660 KB
testcase_11 AC 59 ms
22,752 KB
testcase_12 AC 66 ms
20,864 KB
testcase_13 AC 60 ms
22,812 KB
testcase_14 AC 67 ms
20,924 KB
testcase_15 AC 67 ms
20,980 KB
testcase_16 AC 68 ms
20,928 KB
testcase_17 AC 69 ms
21,008 KB
testcase_18 AC 68 ms
23,072 KB
testcase_19 AC 68 ms
20,988 KB
testcase_20 AC 67 ms
18,840 KB
testcase_21 WA -
testcase_22 AC 122 ms
27,312 KB
evil01.txt AC 119 ms
27,368 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 (min == 1000000)
            {
                Console.WriteLine("0");
            }
            else
            {
                Console.WriteLine(min);
            }
        }

    }
}
0