結果
問題 | No.688 E869120 and Constructing Array 2 |
ユーザー |
|
提出日時 | 2018-05-18 22:51:41 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 102 ms / 1,000 ms |
コード長 | 289 bytes |
コンパイル時間 | 57 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-07-07 13:32:27 |
合計ジャッジ時間 | 2,073 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
K = gets.to_i case K when 0 p 1, 0 when 1 p 2, 1, 1 when 2 p 3, 0, 1, 1 else s = 0 a = (1..30).map{|j| s += j } a.each.with_index(2){|b, i| n = Math.log2(K / b).floor if b * 2**n == K p i + n n.times{p 0} i.times{p 1} exit end } end