結果

問題 No.944 煎っぞ!
ユーザー maspymaspy
提出日時 2023-07-22 15:46:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 515 ms / 3,000 ms
コード長 477 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 92,280 KB
最終ジャッジ日時 2023-10-23 22:08:38
合計ジャッジ時間 22,204 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 468 ms
47,956 KB
testcase_01 AC 469 ms
47,956 KB
testcase_02 AC 470 ms
47,964 KB
testcase_03 AC 471 ms
47,960 KB
testcase_04 AC 472 ms
47,956 KB
testcase_05 AC 470 ms
47,964 KB
testcase_06 AC 464 ms
47,964 KB
testcase_07 AC 469 ms
47,960 KB
testcase_08 AC 466 ms
47,956 KB
testcase_09 AC 467 ms
47,964 KB
testcase_10 AC 460 ms
42,548 KB
testcase_11 AC 470 ms
50,796 KB
testcase_12 AC 468 ms
47,428 KB
testcase_13 AC 463 ms
42,556 KB
testcase_14 AC 472 ms
50,796 KB
testcase_15 AC 468 ms
46,436 KB
testcase_16 AC 459 ms
42,544 KB
testcase_17 AC 460 ms
42,568 KB
testcase_18 AC 473 ms
50,796 KB
testcase_19 AC 473 ms
50,796 KB
testcase_20 AC 498 ms
92,280 KB
testcase_21 AC 493 ms
92,280 KB
testcase_22 AC 470 ms
46,448 KB
testcase_23 AC 466 ms
46,440 KB
testcase_24 AC 475 ms
46,436 KB
testcase_25 AC 473 ms
46,444 KB
testcase_26 AC 479 ms
46,444 KB
testcase_27 AC 515 ms
87,920 KB
testcase_28 AC 467 ms
42,516 KB
testcase_29 AC 465 ms
42,520 KB
testcase_30 AC 508 ms
92,008 KB
testcase_31 AC 463 ms
42,524 KB
testcase_32 AC 478 ms
42,524 KB
testcase_33 AC 483 ms
60,096 KB
testcase_34 AC 482 ms
58,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0