結果

問題 No.814 ジジ抜き
ユーザー simamumusimamumu
提出日時 2019-04-12 23:33:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
MLE  
実行時間 -
コード長 1,031 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 71,040 KB
最終ジャッジ日時 2024-09-15 06:22:01
合計ジャッジ時間 6,070 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 MLE * 1 -- * 21
権限があれば一括ダウンロードができます

ソースコード

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