結果

問題 No.1895 Mod 2
ユーザー ytft
提出日時 2022-04-09 04:27:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-11-28 23:19:42
合計ジャッジ時間 2,720 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,math
input=lambda:sys.stdin.readline().rstrip()
def solve():
	L,R=map(float,input().split())
	ans=0
	while R>0.5:
		right=math.floor((pow(R,0.5)+1)/2)
		left=math.ceil((pow(L,0.5)+1)/2)
		ans^=(right-left+1)%2
		R/=2
		L/=2
	print(ans)
T=int(input())
for i in range(T):
	solve()
0