結果
| 問題 |
No.688 E869120 and Constructing Array 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-19 09:55:42 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 1,000 ms |
| コード長 | 212 bytes |
| コンパイル時間 | 39 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-07-07 13:56:13 |
| 合計ジャッジ時間 | 1,811 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
Main.rb:5: warning: `*' after local variable or literal is interpreted as binary operator Main.rb:5: warning: even though it seems like argument prefix Syntax OK
ソースコード
k = gets.to_i
1.upto(30) do |one|
0.upto(30) do |zero|
if (2**zero) * ((one *(one - 1))/2) == k
puts ([0]*zero + [1]*one).size
puts ([0]*zero + [1]*one).join(' ')
exit 0
end
end
end