結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
14,808 KB
testcase_01 AC 34 ms
10,444 KB
testcase_02 AC 33 ms
10,428 KB
testcase_03 AC 175 ms
10,948 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)]

#N = 1
#KLD = [[7,5,2]]

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
    #print(A,B)
    bit = 0
    while True :
        if bit == 0:
            if A%2 == 1 and (K+1)//2%2 == 1:
                tmp ^= 1<<(bit+D)
                #print(bit,1)
            elif A%2 == 0 and (K//2)%2 == 1:
                tmp ^= 1<<(bit+D)
                #print(bit,1)
            else:
                nyan = 1
                #print(bit,0)
        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
            #print(bit,azunyan)
            tmp ^= azunyan%2<<(bit+D)

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

print(tmp)
0