結果

問題 No.1450 nahco314's First Problem
ユーザー magurofly
提出日時 2021-03-31 16:04:01
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 127 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-11-08 14:18:40
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

X = gets.to_i
(0..62).each do |m|
    n = X ^ m
    if n.to_s(2).count(?1) == m
        puts n
        exit
    end
end
puts -1
0