結果

問題 No.1895 Mod 2
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-04-08 22:55:56
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 430 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 630,352 KB
最終ジャッジ日時 2024-05-06 08:36:57
合計ジャッジ時間 6,942 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

cnt = 1
n = 10 ** 15
memo = []
while cnt ** 2 <= n:
    val = cnt ** 2
    cnt2 = 1
    while cnt2 * val <= n:
        memo.append(cnt2 * val)
        cnt2 *= 2
    cnt += 1
memo = list(sorted(set(memo)))
import bisect
for _ in range(int(input())):
    l,r = map(int,input().split())
    a = (bisect.bisect(memo,l-1))
    b = (bisect.bisect(memo,r))
#     print(a,b)
    if (a - b) & 1:
        print(1)
    else:
        print(0)
0