結果
問題 | No.420 mod2漸化式 |
ユーザー |
|
提出日時 | 2019-05-16 17:14:48 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 176 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 109,348 KB |
最終ジャッジ日時 | 2024-09-17 05:34:30 |
合計ジャッジ時間 | 6,114 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 TLE * 1 -- * 1 |
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - k Syntax OK
ソースコード
X = gets.to_idef comb(n,r)k=n-r if 2*r > nreturn 1 if r == 0((n-r+1)..n).reduce(&:*)/((1..r).reduce(&:*))endc = comb(31, X)puts "#{c} #{X * c / 31 * (2**31-1)}"