結果
| 問題 |
No.814 ジジ抜き
|
| コンテスト | |
| ユーザー |
simamumu
|
| 提出日時 | 2019-04-12 23:27:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,031 bytes |
| コンパイル時間 | 211 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 110,592 KB |
| 最終ジャッジ日時 | 2024-09-15 06:20:45 |
| 合計ジャッジ時間 | 14,900 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 3 |
| other | MLE * 23 |
ソースコード
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)
simamumu