結果
問題 | No.57 ミリオンダイス |
ユーザー |
|
提出日時 | 2017-09-14 01:26:37 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 89 ms / 5,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 268 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-07 21:04:43 |
合計ジャッジ時間 | 1,910 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
class MillionDies attr_reader :n def initialize(n: 0) @n = n end def cause begin @n = Integer(gets.chomp) rescue end end def result puts (@n % 2 == 0)? (@n * 3.5).to_i : (@n * 3.5) end def run cause result end end if $0 == __FILE__ MillionDies.new.run end