結果

問題 No.917 Make One With GCD
ユーザー hahhohahho
提出日時 2021-04-14 13:09:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 77,560 KB
最終ジャッジ日時 2023-09-13 02:44:42
合計ジャッジ時間 7,124 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
77,076 KB
testcase_01 AC 88 ms
71,440 KB
testcase_02 AC 88 ms
71,864 KB
testcase_03 AC 89 ms
71,796 KB
testcase_04 AC 92 ms
71,776 KB
testcase_05 AC 90 ms
71,880 KB
testcase_06 AC 90 ms
71,776 KB
testcase_07 AC 90 ms
72,112 KB
testcase_08 AC 89 ms
71,612 KB
testcase_09 AC 100 ms
77,176 KB
testcase_10 AC 99 ms
77,468 KB
testcase_11 AC 100 ms
77,528 KB
testcase_12 AC 100 ms
77,560 KB
testcase_13 AC 98 ms
77,336 KB
testcase_14 AC 96 ms
77,332 KB
testcase_15 AC 100 ms
77,252 KB
testcase_16 AC 98 ms
77,508 KB
testcase_17 AC 91 ms
71,992 KB
testcase_18 AC 91 ms
71,804 KB
testcase_19 AC 88 ms
71,532 KB
testcase_20 AC 89 ms
71,876 KB
testcase_21 AC 90 ms
71,648 KB
testcase_22 AC 89 ms
71,808 KB
testcase_23 AC 89 ms
71,644 KB
testcase_24 AC 90 ms
72,060 KB
testcase_25 AC 95 ms
76,636 KB
testcase_26 AC 91 ms
71,804 KB
testcase_27 AC 98 ms
71,664 KB
testcase_28 AC 89 ms
71,748 KB
testcase_29 AC 89 ms
71,660 KB
testcase_30 AC 95 ms
72,028 KB
testcase_31 AC 94 ms
72,028 KB
testcase_32 AC 93 ms
71,648 KB
testcase_33 AC 90 ms
71,664 KB
testcase_34 AC 91 ms
71,776 KB
testcase_35 AC 91 ms
71,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
from collections import defaultdict

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

dp = defaultdict(int)
dp[0] = 1

for v in a:
    for g,c in tuple(dp.items()):
        dp[gcd(v,g)] += c
print(dp[1])
0