結果

問題 No.1895 Mod 2
ユーザー gr1msl3ygr1msl3y
提出日時 2022-04-16 18:37:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 82,236 KB
最終ジャッジ日時 2023-08-26 20:13:53
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,688 KB
testcase_01 AC 199 ms
78,640 KB
testcase_02 AC 274 ms
81,056 KB
testcase_03 AC 186 ms
78,216 KB
testcase_04 AC 176 ms
80,064 KB
testcase_05 AC 236 ms
79,272 KB
testcase_06 AC 242 ms
81,416 KB
testcase_07 AC 238 ms
78,792 KB
testcase_08 AC 229 ms
82,236 KB
testcase_09 AC 194 ms
78,576 KB
testcase_10 AC 172 ms
79,276 KB
testcase_11 AC 207 ms
80,580 KB
権限があれば一括ダウンロードができます

ソースコード

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