結果

問題 No.1895 Mod 2
ユーザー ytftytft
提出日時 2022-04-09 04:27:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-05-06 15:40:37
合計ジャッジ時間 2,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,480 KB
testcase_01 AC 111 ms
76,672 KB
testcase_02 AC 124 ms
76,544 KB
testcase_03 AC 128 ms
76,672 KB
testcase_04 AC 136 ms
76,416 KB
testcase_05 AC 132 ms
76,672 KB
testcase_06 AC 130 ms
76,672 KB
testcase_07 AC 133 ms
76,800 KB
testcase_08 AC 112 ms
76,416 KB
testcase_09 AC 120 ms
76,416 KB
testcase_10 AC 92 ms
76,800 KB
testcase_11 AC 125 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

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