結果

問題 No.814 ジジ抜き
ユーザー simamumusimamumu
提出日時 2019-04-12 23:33:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 1,031 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 11,172 KB
実行使用メモリ 69,132 KB
最終ジャッジ日時 2023-10-13 09:14:26
合計ジャッジ時間 6,209 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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