結果

問題 No.682 Average
ユーザー motimoti
提出日時 2018-05-20 09:22:37
言語 Perl
(5.38.2)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 5,104 KB
最終ジャッジ日時 2023-09-10 23:54:22
合計ジャッジ時間 967 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,992 KB
testcase_01 AC 5 ms
5,104 KB
testcase_02 AC 4 ms
5,020 KB
testcase_03 AC 4 ms
4,848 KB
testcase_04 AC 5 ms
5,068 KB
testcase_05 AC 5 ms
4,964 KB
testcase_06 AC 5 ms
4,948 KB
testcase_07 AC 4 ms
4,904 KB
testcase_08 AC 5 ms
4,848 KB
testcase_09 AC 5 ms
4,972 KB
testcase_10 AC 5 ms
4,968 KB
testcase_11 AC 5 ms
5,020 KB
testcase_12 AC 4 ms
5,016 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my ($x, $y) = split / /,<>; chomp $y;
my $count = 0;
for (my $i = $x; $i <= $y; $i++) {
  my $ave = ($i + $x + $y) / 3;
  if ($ave == int($ave)) {
    $count++;
  }
}
print $count;
0