結果

問題 No.3624 Product
コンテスト
ユーザー Unbakedbread
提出日時 2026-08-14 22:29:02
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 213 ms / 2,000 ms
+ 621µs
コード長 215 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 582 ms
コンパイル使用メモリ 95,848 KB
実行使用メモリ 85,048 KB
最終ジャッジ日時 2026-08-14 22:29:51
合計ジャッジ時間 3,524 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

for _ in range(int(input())):
	L, R = map(int, input().split())
	
	if R == 0:
		print(0)
		continue
	
	t = 0
	while R >> t:
		t += 1
	
	if 1 << (t - 1) <= L:
		print(-1)
	else:
		print((2 ** (t - 1) - 1) << (t - 1))
0