結果

問題 No.500 階乗電卓
ユーザー rickythetarickytheta
提出日時 2017-04-07 22:23:33
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 146 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-09-23 00:14:25
合計ジャッジ時間 2,934 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,264 KB
testcase_01 AC 80 ms
15,116 KB
testcase_02 AC 81 ms
15,080 KB
testcase_03 AC 81 ms
15,260 KB
testcase_04 AC 79 ms
15,260 KB
testcase_05 AC 83 ms
15,248 KB
testcase_06 AC 80 ms
15,028 KB
testcase_07 AC 80 ms
15,284 KB
testcase_08 AC 80 ms
15,304 KB
testcase_09 AC 82 ms
15,292 KB
testcase_10 AC 80 ms
15,356 KB
testcase_11 AC 80 ms
15,088 KB
testcase_12 AC 81 ms
15,160 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 79 ms
15,084 KB
testcase_16 AC 79 ms
15,032 KB
testcase_17 AC 79 ms
15,156 KB
testcase_18 AC 79 ms
15,344 KB
testcase_19 AC 80 ms
15,080 KB
testcase_20 AC 78 ms
15,244 KB
testcase_21 AC 78 ms
15,144 KB
testcase_22 AC 79 ms
15,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
ans = 1
mod = 10**12
for i in 1..n
  ans = ans * i % mod
  if ans == 0
    puts "000000000000"
    exit(0)
  end
end
puts ans
0