結果

問題 No.638 Sum of "not power of 2"
コンテスト
ユーザー ciel
提出日時 2018-01-28 20:39:46
言語 Ruby
(4.0.7 + ACL)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
WA  
実行時間 -
コード長 117 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9 ms
コンパイル使用メモリ 8,832 KB
実行使用メモリ 14,464 KB
最終ジャッジ日時 2026-10-09 13:13:18
合計ジャッジ時間 1,847 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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