結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
29,368 KB
testcase_01 AC 59 ms
20,752 KB
testcase_02 AC 59 ms
20,724 KB
testcase_03 AC 59 ms
20,640 KB
testcase_04 AC 59 ms
20,812 KB
testcase_05 AC 59 ms
20,780 KB
testcase_06 AC 60 ms
20,832 KB
testcase_07 AC 59 ms
20,716 KB
testcase_08 AC 59 ms
22,628 KB
testcase_09 AC 59 ms
20,780 KB
testcase_10 AC 60 ms
20,720 KB
testcase_11 AC 59 ms
22,852 KB
testcase_12 AC 66 ms
20,924 KB
testcase_13 AC 59 ms
20,724 KB
testcase_14 AC 67 ms
21,012 KB
testcase_15 AC 67 ms
18,828 KB
testcase_16 AC 68 ms
21,044 KB
testcase_17 AC 68 ms
22,968 KB
testcase_18 AC 66 ms
20,800 KB
testcase_19 AC 67 ms
22,856 KB
testcase_20 AC 66 ms
21,040 KB
testcase_21 AC 111 ms
29,788 KB
testcase_22 AC 122 ms
27,424 KB
evil01.txt AC 120 ms
27,532 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 = 10000000;

            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 == 10000000)
            {
                Console.WriteLine("0");
            }
            else
            {
                Console.WriteLine(min);
            }
        }

    }
}
0