結果

問題 No.1930 XOR of Two Range
ユーザー roaris
提出日時 2022-06-10 03:10:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 76,756 KB
最終ジャッジ日時 2024-09-21 05:41:22
合計ジャッジ時間 1,918 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

for _ in range(int(input())):
    L, R = map(int, input().split())
    
    if (R-L)%2==0:
        if ((R-L)//2+1)%2==0:
            print(((R-L)//2+1)//2%2)
        else:
            print(((R-L)//2+1)//2%2+L+R)
    else:
        print(((R-L+1)//2+1)//2%2)
0