結果
問題 |
No.135 とりあえず1次元の問題
|
ユーザー |
![]() |
提出日時 | 2018-08-07 10:19:17 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 131 ms / 5,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 796 ms |
コンパイル使用メモリ | 111,436 KB |
実行使用メモリ | 32,768 KB |
最終ジャッジ日時 | 2024-09-19 18:25:00 |
合計ジャッジ時間 | 3,520 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { Console.ReadLine(); var va = Console.ReadLine().Split().Select(int.Parse); var vb = va.Distinct().OrderBy(n => n).ToList(); int nn = (vb.Count() <= 1) ? 0 : vb.Skip(1).Select((n, i) => n - vb[i]).Min(); Console.WriteLine(nn); //Console.ReadLine(); } } }