結果
問題 | No.814 ジジ抜き |
ユーザー |
![]() |
提出日時 | 2022-06-23 14:30:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 608 bytes |
コンパイル時間 | 287 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 66,684 KB |
最終ジャッジ日時 | 2024-11-07 05:12:40 |
合計ジャッジ時間 | 31,110 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 MLE * 2 |
ソースコード
import sysreadline=sys.stdin.readlinedef Bisect_Int(ok,ng,is_ok):while abs(ok-ng)>1:mid=(ok+ng)//2if is_ok(mid):ok=midelse:ng=midreturn okimport numpy as npN=int(readline())K,L,D=[],[],[]for _ in range(N):k,l,d=map(int,readline().split())K.append(k)L.append(l)D.append(d)K=np.array(K,dtype=np.int64)L=np.array(L,dtype=np.int64)D=np.array(D,dtype=np.int64)def is_ok(ans):where=np.where(ans>=L)[0]return np.sum(np.minimum(K[where],(ans-L[where]>>D[where])+1)%2)%2ans=Bisect_Int(1<<60,-1,is_ok)print(ans)