結果

問題 No.638 Sum of "not power of 2"
コンテスト
ユーザー ciel
提出日時 2018-01-28 20:39:46
言語 Ruby
(4.0.2)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
WA  
実行時間 -
コード長 117 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 188 ms
コンパイル使用メモリ 9,216 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2026-06-03 19:35:58
合計ジャッジ時間 1,877 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 7 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: ambiguous first argument; put parentheses or a space even after `-` operator
Syntax OK

ソースコード

diff #
raw source code

h={};[*0..64].map{|i|h[1<<i]=1}
n=gets.to_i
(1..999).map{|i|
	if !h[i]&&!h[n-i]
		puts [i,n-i]*' '
		exit
	end
}
p -1
0