結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
ayaoni
|
| 提出日時 | 2020-12-04 09:26:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 865 bytes |
| コンパイル時間 | 267 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 78,504 KB |
| 最終ジャッジ日時 | 2024-09-14 19:53:13 |
| 合計ジャッジ時間 | 11,897 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 13 |
ソースコード
import sys
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())
N = I()
A,B = LI(),LI()
A = [A[i]<<11 for i in range(N)]
B = [B[i]//2 for i in range(N)]
B = B+B
ans = 10**18
for i in range(N):
X = A
heapify(X)
for j in range(N):
n = heappop(X)
n0,n1 = divmod(n,1<<11)
n0 += B[i+j]
n1 += 1
heappush(X,(n0<<11)+n1)
ans = min(ans,max(X[i] % (1<<11) for i in range(N)))
print(ans)
ayaoni