結果

問題 No.1930 XOR of Two Range
ユーザー hir355hir355
提出日時 2022-05-06 21:54:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 343 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 78,924 KB
最終ジャッジ日時 2023-09-20 02:46:39
合計ジャッジ時間 2,283 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,268 KB
testcase_01 AC 331 ms
77,696 KB
testcase_02 AC 340 ms
78,492 KB
testcase_03 AC 343 ms
78,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
for _ in range(t):
    l, r = map(int, input().split())
    x = (((l + r) - (l * 2) + 3) // 4) % 2
    if (l + r) % 2 == 1:
        print(x)
    else:
        if (((l + r) - (l * 2)) // 2 + 1) % 2 == 0:
            print(x)
        else:
            print((l + r) ^ x)
0