結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
mrc1031
|
| 提出日時 | 2016-10-12 13:39:28 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 563 bytes |
| コンパイル時間 | 1,116 ms |
| コンパイル使用メモリ | 109,516 KB |
| 実行使用メモリ | 25,924 KB |
| 最終ジャッジ日時 | 2024-11-22 02:38:50 |
| 合計ジャッジ時間 | 1,522 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 10 |
コンパイルメッセージ
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;
class Program
{
static void Main(string[] args)
{
// No.21 平均の差
int n = int.Parse(Console.ReadLine());
var k = Console.ReadLine();
int num, min, max;
min = int.Parse(Console.ReadLine());
max = min;
for (int i = 1; i <= n - 1; i++)
{
num = int.Parse(Console.ReadLine());
if (min > num) min = num;
if (num > max) max = num;
}
Console.WriteLine();
Console.WriteLine(max - min);
}
}
mrc1031