結果

問題 No.3276 Make Smaller Popcount
ユーザー 👑 p-adic
提出日時 2025-09-17 10:20:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 532 ms / 2,000 ms
コード長 162 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 76,712 KB
最終ジャッジ日時 2025-09-17 18:43:53
合計ジャッジ時間 16,831 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

R=range
I=input
for t in R(int(I())):
	N=int(I());l=r=-1
	for d in R(31):
		if N>>d&1:
			if l<0:l=d
			else:r=d-l;break
	print(-1 if l<0 or r<0else((1<<r)-1)<<l)
0