結果

問題 No.500 階乗電卓
ユーザー motimoti
提出日時 2018-05-22 23:58:36
言語 Perl
(5.38.0)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 5,180 KB
最終ジャッジ日時 2023-09-11 01:25:00
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,108 KB
testcase_01 AC 5 ms
5,096 KB
testcase_02 AC 5 ms
5,080 KB
testcase_03 AC 4 ms
5,076 KB
testcase_04 AC 5 ms
4,848 KB
testcase_05 AC 5 ms
5,080 KB
testcase_06 AC 5 ms
4,964 KB
testcase_07 AC 4 ms
4,836 KB
testcase_08 AC 5 ms
5,092 KB
testcase_09 AC 5 ms
5,080 KB
testcase_10 AC 5 ms
5,076 KB
testcase_11 AC 5 ms
4,848 KB
testcase_12 AC 5 ms
5,140 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 5 ms
4,984 KB
testcase_16 AC 5 ms
5,124 KB
testcase_17 AC 5 ms
4,860 KB
testcase_18 AC 5 ms
5,072 KB
testcase_19 AC 5 ms
5,180 KB
testcase_20 AC 5 ms
4,956 KB
testcase_21 AC 5 ms
4,840 KB
testcase_22 AC 5 ms
5,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my $n = <>; chomp $n;
my %h;
$h{1} = 1;
for (my $i = 2; $i < 50; $i++) {
  $h{$i} = ($h{$i - 1} * $i) % 1000000000000;
}

if ($n >= 50) {
  print "000000000000\n";
} else {
  printf("%d\n", $h{$n});
}
0