結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-01-19 00:57:40 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 2,000 ms |
| コード長 | 291 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-06-12 00:27:53 |
| 合計ジャッジ時間 | 2,049 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
n=gets.to_i.digits(2).reverse
i=0
if n.count{|e| e==1}==1 then
puts "-1 -1 -1"
else
as=["","",""]
i=0
n.each{|e|
s="000"
if e==0 then
elsif i%2==0
s="110"
i+=1
else
s="101"
i+=1
end
3.times{|i|
as[i]+=s[i]
}
}
puts as.map{|e| e.to_i(2)}.sort.join(" ")
end
horiesiniti