結果

問題 No.917 Make One With GCD
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-11 18:42:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 77,184 KB
最終ジャッジ日時 2023-09-09 21:05:43
合計ジャッジ時間 6,366 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
77,132 KB
testcase_01 AC 97 ms
71,796 KB
testcase_02 AC 91 ms
71,592 KB
testcase_03 AC 93 ms
71,456 KB
testcase_04 AC 93 ms
71,400 KB
testcase_05 AC 93 ms
71,224 KB
testcase_06 AC 94 ms
71,368 KB
testcase_07 AC 91 ms
71,372 KB
testcase_08 AC 92 ms
71,372 KB
testcase_09 AC 102 ms
77,052 KB
testcase_10 AC 101 ms
76,952 KB
testcase_11 AC 101 ms
77,040 KB
testcase_12 AC 101 ms
76,956 KB
testcase_13 AC 100 ms
77,136 KB
testcase_14 AC 99 ms
77,184 KB
testcase_15 AC 102 ms
76,984 KB
testcase_16 AC 100 ms
76,944 KB
testcase_17 AC 93 ms
71,748 KB
testcase_18 AC 92 ms
71,780 KB
testcase_19 AC 92 ms
71,720 KB
testcase_20 AC 94 ms
71,368 KB
testcase_21 AC 94 ms
71,712 KB
testcase_22 AC 93 ms
71,432 KB
testcase_23 AC 94 ms
71,368 KB
testcase_24 AC 93 ms
71,764 KB
testcase_25 AC 100 ms
76,968 KB
testcase_26 AC 92 ms
71,860 KB
testcase_27 AC 92 ms
71,512 KB
testcase_28 AC 92 ms
71,176 KB
testcase_29 AC 96 ms
71,436 KB
testcase_30 AC 95 ms
71,728 KB
testcase_31 AC 96 ms
71,456 KB
testcase_32 AC 93 ms
71,576 KB
testcase_33 AC 92 ms
71,532 KB
testcase_34 AC 91 ms
71,584 KB
testcase_35 AC 93 ms
71,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

import math
from collections import Counter
dp = Counter()
dp[0] = 1
for a in A:
    nx = Counter()
    for g, v in dp.items():
        nx[g] += v
        nx[math.gcd(a, g)] += v
    dp = nx
print(dp[1])
0