結果

問題 No.1930 XOR of Two Range
ユーザー roarisroaris
提出日時 2022-06-10 03:10:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 75,960 KB
最終ジャッジ日時 2023-10-21 04:35:34
合計ジャッジ時間 1,946 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,484 KB
testcase_01 AC 112 ms
75,960 KB
testcase_02 AC 122 ms
75,920 KB
testcase_03 AC 121 ms
75,888 KB
権限があれば一括ダウンロードができます

ソースコード

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