e367. 區間Xor - 高中生程式解題系統

本文最後更新於:2024年1月12日 下午

Zerojudge
解題紀錄

e367. 區間Xor - 高中生程式解題系統

Zerojudge-e367.py

# Author : ysh
# 08/16/2022 Tue 16:53:37.42
b = []
llast = 0
last = 0
for i in range(100001):
    last = last ^ i
    llast = llast ^ last
    b.append(llast)
    # last = last ^ i 
# print(b[:10])
while True:
    try:
        a = [int(i) for i in input().split()]
        if a[1] < a[0]:
            tmp = a[0]
            a[0] = a[1]
            a[1] = tmp
        print(b[a[1]] ^ b[a[0] - 1])
    except:
        break
quit()

e367. 區間Xor - 高中生程式解題系統
http://mysh212.github.io/algosolution/Zerojudge-e367.py/
作者
ysh
發布於
2022年8月16日
更新於
2024年1月12日
許可協議