結果
| 問題 |
No.944 煎っぞ!
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2023-07-22 15:46:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 567 ms / 3,000 ms |
| コード長 | 477 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 93,124 KB |
| 最終ジャッジ日時 | 2024-09-22 15:28:37 |
| 合計ジャッジ時間 | 21,669 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
A = np.fromstring(read(), np.int64, sep=' ')[1:]
Acum = np.cumsum(A)
S = Acum[-1]
x = np.arange(1, int(S**.5)+1, dtype=np.int64)
div = x[S%x == 0]
div = np.union1d(div, S // div)
exists = np.zeros(S+1, np.bool_)
exists[Acum] = 1
for d in div:
if np.all(exists[np.arange(d,S,d)]):
answer = S // d
break
print(answer)
maspy