結果

問題 No.21 平均の差
ユーザー CroweaCrowea
提出日時 2019-02-01 23:25:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 521 bytes
コンパイル時間 1,972 ms
コンパイル使用メモリ 64,808 KB
実行使用メモリ 22,768 KB
最終ジャッジ日時 2023-08-16 02:09:11
合計ジャッジ時間 3,155 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,768 KB
testcase_01 AC 55 ms
20,696 KB
testcase_02 AC 57 ms
20,652 KB
testcase_03 AC 55 ms
20,652 KB
testcase_04 AC 56 ms
20,648 KB
testcase_05 AC 55 ms
20,660 KB
testcase_06 AC 56 ms
20,668 KB
testcase_07 AC 56 ms
22,596 KB
testcase_08 AC 55 ms
22,664 KB
testcase_09 AC 56 ms
20,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        int k = int.Parse(Console.ReadLine());
        var lst = new List<int>();

        var min = 1000;
        var max = 1;
        for (int i = 0; i < n; i++)
        {
            var input = int.Parse(Console.ReadLine());
            max = Math.Max(max, input);
            min = Math.Min(min, input);
        }
        Console.WriteLine(max - min);
    }
}


0