結果

問題 No.1895 Mod 2
ユーザー ThetaTheta
提出日時 2022-10-11 19:57:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 433 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 17,244 KB
最終ジャッジ日時 2023-09-07 20:57:15
合計ジャッジ時間 7,419 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

from math import sqrt


def is_odd_divisor_sum(num: int) -> bool:
    str_bin_num = bin(num)
    num_divide_by_2 = int(str_bin_num[:str_bin_num.rfind("1")+1], 0)
    return sqrt(num_divide_by_2) - sqrt(num_divide_by_2) ** 2 < 1e-3


def main():
    T = int(input())
    for _ in range(T):
        L, R = map(int, input().split())
        print(sum(map(is_odd_divisor_sum, range(L, R+1))) % 2)


if __name__ == "__main__":
    main()
0