結果
問題 |
No.814 ジジ抜き
|
ユーザー |
![]() |
提出日時 | 2020-03-25 02:05:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 555 bytes |
コンパイル時間 | 466 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 77,216 KB |
最終ジャッジ日時 | 2025-01-01 19:14:02 |
合計ジャッジ時間 | 24,398 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 MLE * 13 |
ソースコード
#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np N = int(readline()) KLD = np.array(read().split(), np.int64) K = KLD[::3] L = KLD[1::3] D = KLD[2::3] D2 = 1 << D def test(x): # x 以下が奇数個ある return np.minimum(K, np.maximum(0, (x - L) // D2 + 1)).sum() % 2 == 1 left = -1 right = 10 ** 18 + 10 while left + 1 < right: x = (left + right) // 2 if test(x): right = x else: left = x print(right)