結果

問題 No.1895 Mod 2
ユーザー AEnAEn
提出日時 2022-12-27 18:55:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,433 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 82,336 KB
実行使用メモリ 316,060 KB
最終ジャッジ日時 2024-05-01 22:00:03
合計ジャッジ時間 15,672 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 822 ms
301,040 KB
testcase_01 AC 1,117 ms
315,852 KB
testcase_02 AC 1,109 ms
315,944 KB
testcase_03 AC 1,143 ms
315,948 KB
testcase_04 AC 1,034 ms
315,756 KB
testcase_05 AC 1,293 ms
315,332 KB
testcase_06 AC 1,433 ms
315,800 KB
testcase_07 AC 1,288 ms
315,312 KB
testcase_08 AC 1,090 ms
315,392 KB
testcase_09 AC 1,094 ms
315,932 KB
testcase_10 AC 1,020 ms
315,796 KB
testcase_11 AC 1,141 ms
316,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right as br

a = []
for i in range(1,10**15,2):
    if i*i>10**15:break
    a.append(i*i)

p = [1<<i for i in range(51)]
T = int(input())
# T = 10000
for i in range(T):
    L, R = map(int, input().split())
    # L, R = 1, 10**15
    res = 0
    for j in range(51):
        n = br(a,R//p[j])-br(a,(L-1)//p[j])
        res += n
        res %= 2
    print(res)
0