結果

問題 No.542 1円玉と5円玉
ユーザー motimoti
提出日時 2018-05-20 09:09:35
言語 Perl
(5.38.2)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 5,096 KB
最終ジャッジ日時 2023-09-10 23:54:20
合計ジャッジ時間 987 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,960 KB
testcase_01 AC 5 ms
5,012 KB
testcase_02 AC 5 ms
5,032 KB
testcase_03 AC 5 ms
5,036 KB
testcase_04 AC 6 ms
5,096 KB
testcase_05 AC 5 ms
4,972 KB
testcase_06 AC 5 ms
4,940 KB
testcase_07 AC 6 ms
4,888 KB
testcase_08 AC 6 ms
4,996 KB
testcase_09 AC 6 ms
5,032 KB
testcase_10 AC 5 ms
5,012 KB
testcase_11 AC 5 ms
5,076 KB
testcase_12 AC 7 ms
4,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my %h;
my ($n, $m) = split / /,<>; chomp$m;
for (my $i = 0; $i <= $n; $i++) {
  for (my $j = 0; $j <= $m; $j++) {
    next if ($i == 0 && $j == 0);
    $h{$i + $j * 5} = 1;
  }
}
my @vs;
while (my ($k, $v) = each(%h)) {
  push @vs, $k;
}
print $_ . "\n" for sort {$a <=> $b} @vs;
0