結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
poke_repe_reg
|
| 提出日時 | 2019-06-24 10:34:42 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 5,000 ms |
| コード長 | 1,037 bytes |
| コンパイル時間 | 923 ms |
| コンパイル使用メモリ | 108,888 KB |
| 実行使用メモリ | 26,320 KB |
| 最終ジャッジ日時 | 2025-01-02 18:30:58 |
| 合計ジャッジ時間 | 1,704 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
class Program
{
static void Main(string[] args)
{
string n = Console.ReadLine();
string k = Console.ReadLine();
int num = int.Parse(n);
int group = int.Parse(k);
int[] ary = new int[num];
for (int i = 0; i < num; i++)
{
var line = Console.ReadLine();
ary[i] = int.Parse(line);
}
for (int i = 0; i < ary.Length; i++)
{
for (int j = i + 1; j < ary.Length; j++)
{
if (ary[i] < ary[j])
{
int temp = ary[i];
ary[i] = ary[j];
ary[j] = temp;
}
}
}
Console.WriteLine(ary[0] - ary[ary.Length - 1]);
}
}
}
poke_repe_reg