結果

問題 No.276 連続する整数の和(1)
ユーザー code-devocode-devo
提出日時 2016-03-04 21:51:30
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 11,900 KB
実行使用メモリ 21,108 KB
最終ジャッジ日時 2023-10-24 19:50:07
合計ジャッジ時間 1,632 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

FACTORIAL = {}
FACTORIAL[0] = 1
for i in 1..3000 do
  FACTORIAL[i] = FACTORIAL[i-1] * i
end

gets
while line = gets do
  d, x, t = line.split.map(&:to_i)
  r = FACTORIAL[x + d - 1] / FACTORIAL[x] / FACTORIAL[d - 1] #combinationの計算
  puts r <= t ? "AC" : "ZETUBOU"
end
0