結果
| 問題 | No.716 距離 | 
| コンテスト | |
| ユーザー |  kmtrc130 | 
| 提出日時 | 2019-03-15 16:56:24 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 39 ms / 2,000 ms | 
| コード長 | 699 bytes | 
| コンパイル時間 | 1,666 ms | 
| コンパイル使用メモリ | 106,496 KB | 
| 実行使用メモリ | 19,840 KB | 
| 最終ジャッジ日時 | 2024-07-01 20:00:57 | 
| 合計ジャッジ時間 | 4,534 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 40 | 
コンパイルメッセージ
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;
using System.Collections.Generic;
class Program
{
    public void Solve()
    {
        int N = int.Parse(Console.ReadLine());
        List<int> a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
        int min = int.MaxValue;
        int prePoint = a.Min();
        foreach (var point in a.OrderBy(x => x).Skip(1))
        {
            var diff = Math.Abs(point - prePoint);
            min = (diff < min ? diff : min);
            prePoint = point;
        }
        Console.WriteLine(min);
        Console.WriteLine(a.Max() - a.Min());
    }
    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
            
            
            
        