結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー | abL8ZLsTbF |
提出日時 | 2016-08-21 02:20:21 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 2,351 ms |
コンパイル使用メモリ | 103,996 KB |
実行使用メモリ | 35,464 KB |
最終ジャッジ日時 | 2023-09-02 00:28:16 |
合計ジャッジ時間 | 5,630 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 164 ms
35,464 KB |
testcase_01 | AC | 64 ms
21,664 KB |
testcase_02 | RE | - |
testcase_03 | AC | 63 ms
23,848 KB |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | AC | 74 ms
24,012 KB |
testcase_13 | AC | 67 ms
23,716 KB |
testcase_14 | AC | 74 ms
22,036 KB |
testcase_15 | AC | 73 ms
23,880 KB |
testcase_16 | RE | - |
testcase_17 | AC | 74 ms
23,992 KB |
testcase_18 | AC | 72 ms
23,916 KB |
testcase_19 | AC | 73 ms
21,976 KB |
testcase_20 | AC | 74 ms
24,016 KB |
testcase_21 | RE | - |
testcase_22 | RE | - |
evil01.txt | AC | 160 ms
35,360 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; public class Program { public static void Main() { int N = int.Parse(Console.ReadLine()); int[] X = Console.ReadLine().Split().Select(i => int.Parse(i)) .Distinct().OrderBy(i => i).ToArray(); if (X.Length == 1) { Console.WriteLine(0); return; } int ans = int.MaxValue; for (int i = 1; i < N; i++) { ans = Math.Min(ans, X[i] - X[i - 1]); } Console.WriteLine(ans); } }