結果

問題 No.21 平均の差
ユーザー HiroakiSoftwareHiroakiSoftware
提出日時 2014-11-01 03:00:47
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 799 bytes
コンパイル時間 4,034 ms
コンパイル使用メモリ 103,252 KB
実行使用メモリ 23,484 KB
最終ジャッジ日時 2023-08-29 00:05:06
合計ジャッジ時間 4,511 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,600 KB
testcase_01 AC 56 ms
21,336 KB
testcase_02 AC 57 ms
21,364 KB
testcase_03 AC 56 ms
19,408 KB
testcase_04 AC 56 ms
19,440 KB
testcase_05 AC 55 ms
21,356 KB
testcase_06 AC 56 ms
21,416 KB
testcase_07 AC 57 ms
23,484 KB
testcase_08 AC 57 ms
21,552 KB
testcase_09 AC 56 ms
21,356 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

/*
yukicoder No.21
作成者:ヒロソフ
使用言語:C# Ver.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace yukicoder21cs
{
    class Program
    {
        static void Main(string[] args)
        {
            int N, K;
            int[] Nums;
            N = int.Parse(Console.ReadLine());
            K = int.Parse(Console.ReadLine());
            Nums = new int[N];
            for (int i = 0; i < Nums.Length; i++)   Nums[i] =  int.Parse(Console.ReadLine());
            int Min, Max;
            Min = Nums.Min();        //Min = (from c in Nums select c).Min();
            Max = Nums.Max();    //Max = (from c in Nums select c).Max();
            Console.WriteLine(Max - Min);        
        }
    }
}
 
0