結果
| 問題 | No.572 妖精の演奏 |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-07 07:50:13 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
RE
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 539 bytes |
| 記録 | |
| コンパイル時間 | 516 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 34,424 KB |
| 最終ジャッジ日時 | 2026-10-18 01:04:46 |
| 合計ジャッジ時間 | 10,190 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 RE * 1 |
ソースコード
#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
# %%
N = int(readline())
M = int(readline())
A = np.array(read().split(), np.int64).reshape(M, M)
# %%
def merge(A, B):
return (A[:, :, None] + B[None, :, :]).max(axis=1)
# %%
def power(A, n):
if n == 1:
return A
B = power(A, n // 2)
B = merge(B, B)
if n % 2 == 0:
return B
return merge(A, B)
# %%
print(power(A, N - 1).max())
maspy