結果

問題 No.688 E869120 and Constructing Array 2
ユーザー kuririnkuririn
提出日時 2018-05-23 00:26:40
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 138 bytes
コンパイル時間 664 ms
コンパイル使用メモリ 11,492 KB
実行使用メモリ 19,920 KB
最終ジャッジ日時 2023-09-21 20:41:50
合計ジャッジ時間 4,204 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

k=gets.to_i
(0..2**30).each{ |s|
	d = s.to_s(2)
	a = d.count( "0" )
	b = d.count( "1" )
	if 2**a*b*~-b/2==k
		p a+b
		puts d
		exit
	end
}
0