結果

問題 No.21 平均の差
ユーザー togaerrortogaerror
提出日時 2015-05-14 19:38:19
言語 Perl
(5.38.2)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 231 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 5,044 KB
最終ジャッジ日時 2023-09-20 07:50:09
合計ジャッジ時間 733 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,804 KB
testcase_01 AC 5 ms
4,948 KB
testcase_02 AC 5 ms
4,872 KB
testcase_03 AC 5 ms
4,808 KB
testcase_04 AC 5 ms
5,000 KB
testcase_05 AC 5 ms
5,012 KB
testcase_06 AC 5 ms
4,880 KB
testcase_07 AC 5 ms
5,044 KB
testcase_08 AC 5 ms
4,796 KB
testcase_09 AC 5 ms
4,800 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my $n = <>;
my $k = <>;
my @array;
for(my $i = 0; $i < $n; $i++) {
	$array[$i] = <>;
}
@array = sort {$a <=> $b} @array;

my $ans = $array[$#array] - $array[0];
print "$ans\n";

exit;
0