結果

問題 No.814 ジジ抜き
ユーザー simamumusimamumu
提出日時 2019-04-12 23:27:01
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 1,031 bytes
コンパイル時間 1,170 ms
コンパイル使用メモリ 87,480 KB
実行使用メモリ 116,300 KB
最終ジャッジ日時 2023-10-13 09:13:26
合計ジャッジ時間 19,162 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 MLE -
testcase_02 MLE -
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 MLE -
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime,random
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N = int(input())
KLD = [inpl() for _ in range(N)]

tmp = 0
for K,L,D in KLD:
    if K%2 == 1:
        tmp ^= ((1<<D)-1)&L
    # A -> A+K-1=B
    A = L >> D
    B = A + K-1
    bit = 0
    while True :
        if bit == 0:
            if A%2 == 1 and (K+1)//2%2 == 1:
                tmp ^= 1<<(bit+D)
            elif A%2 == 0 and (K//2)%2 == 1:
                tmp ^= 1<<(bit+D)
            else:
                nyan = 1
        else:
            azunyan = 0
            if (A>>bit) & 1:
                azunyan +=  (1<<bit) - (A-(1<<bit))%(1<<(bit+1))
            if (B>>bit) & 1:
                azunyan += (B-(1<<bit))%(1<<(bit+1)) + 1
            tmp ^= azunyan%2<<(bit+D)

        if (1<<bit) > B:
            break
        bit += 1

print(tmp)
0