結果

問題 No.21 平均の差
ユーザー sironekotorosironekotoro
提出日時 2019-01-16 14:18:44
言語 Perl
(5.38.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 241 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,820 KB
最終ジャッジ日時 2023-09-10 08:50:30
合計ジャッジ時間 1,161 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,820 KB
testcase_01 AC 3 ms
4,628 KB
testcase_02 AC 2 ms
4,636 KB
testcase_03 AC 3 ms
4,632 KB
testcase_04 AC 3 ms
4,748 KB
testcase_05 AC 2 ms
4,556 KB
testcase_06 AC 2 ms
4,632 KB
testcase_07 AC 2 ms
4,532 KB
testcase_08 AC 2 ms
4,576 KB
testcase_09 AC 3 ms
4,560 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use v5.16.3;

my $N = <>;
my $K = <>;
my @a = <>;

chomp ($N,$K);


my $max = 1;
my $min = 1000;

for my $n (@a) {
    chomp $n;
    $min = $n if $n <= $min;
    $max = $n if $n >= $max;
}
# say $min;
# say $max;
say int( ( $max - $min ) );
0