結果

問題 No.3276 Make Smaller Popcount
ユーザー sasa8uyauya
提出日時 2025-09-19 21:36:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 655 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 78,488 KB
最終ジャッジ日時 2025-09-19 21:37:31
合計ジャッジ時間 19,554 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
	n=int(input())
	if n.bit_count()==1:
		print(-1)
		continue
	p=[]
	for i in range(30):
		if (n>>i)&1:
			p+=[i]
		if len(p)==2:
			break
	p1,p2=p
	print(int("1"*(p2-p1)+"0"*p1,2))
0