結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 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).reversei=0if n.count{|e| e==1}==1 thenputs "-1 -1 -1"elseas=["","",""]i=0n.each{|e|s="000"if e==0 thenelsif i%2==0s="110"i+=1elses="101"i+=1end3.times{|i|as[i]+=s[i]}}puts as.map{|e| e.to_i(2)}.sort.join(" ")end