結果

問題 No.1298 OR XOR
ユーザー kcz146kcz146
提出日時 2020-11-27 21:24:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 11,160 KB
実行使用メモリ 15,260 KB
最終ジャッジ日時 2023-10-01 04:31:59
合計ジャッジ時間 2,903 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,020 KB
testcase_01 AC 83 ms
15,196 KB
testcase_02 AC 82 ms
15,208 KB
testcase_03 AC 82 ms
15,120 KB
testcase_04 AC 83 ms
15,016 KB
testcase_05 AC 82 ms
15,252 KB
testcase_06 AC 80 ms
15,024 KB
testcase_07 AC 80 ms
15,068 KB
testcase_08 AC 83 ms
15,260 KB
testcase_09 AC 83 ms
15,096 KB
testcase_10 AC 81 ms
15,120 KB
testcase_11 AC 81 ms
15,152 KB
testcase_12 AC 82 ms
15,256 KB
testcase_13 AC 83 ms
15,088 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
a = n
if n.to_s(2).count(?1) == 1
  puts '-1 -1 -1'
  exit(0)
end
b = 1<<n.to_s(2).reverse.index(?1)
c = a^b
puts [a, b, c].join(' ')
0