結果
| 問題 |
No.21 平均の差
|
| ユーザー |
fujita
|
| 提出日時 | 2023-04-27 17:01:35 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 5,000 ms |
| コード長 | 853 bytes |
| コンパイル時間 | 16,474 ms |
| コンパイル使用メモリ | 167,972 KB |
| 実行使用メモリ | 184,348 KB |
| 最終ジャッジ日時 | 2024-11-16 22:35:03 |
| 合計ジャッジ時間 | 10,762 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (101 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;
namespace yukicoder
{
class Program
{
static void Main(string[] args)
{
int N = int.Parse(Console.ReadLine());
int K = int.Parse(Console.ReadLine());
string[] strings = new string[N];
float[] ints = new float[N];
for (int i = 0; i < N; i++)
{
strings[i] = Console.ReadLine();
}
for(int j = 0; j < strings.Length; j++)
{
ints[j] = float.Parse(strings[j]);
}
Array.Sort(ints);
var hiave = ints[N - 1] / 1;
var lowave = ints[0] / 1;
var ans = Math.Ceiling(hiave - lowave);
Console.WriteLine(ans);
}
}
}
fujita