結果

問題 No.1895 Mod 2
ユーザー gr1msl3y
提出日時 2022-04-16 18:37:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 264 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 77,556 KB
最終ジャッジ日時 2024-12-25 22:06:13
合計ジャッジ時間 4,322 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

def count(x):
    if x == 0:
        return 0
    return (int(x**0.5)+1)//2+count(x//2)


def solve(l, r):
    return (count(r)-count(l-1)) % 2


T = int(input())
ans = []
for _ in range(T):
    L, R = map(int, input().split())
    ans.append(solve(L, R))

print(*ans, sep='\n')
0