結果
問題 |
No.917 Make One With GCD
|
ユーザー |
![]() |
提出日時 | 2021-04-20 04:45:58 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 241 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 60,928 KB |
最終ジャッジ日時 | 2024-07-04 05:15:05 |
合計ジャッジ時間 | 3,030 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 32 |
ソースコード
from collections import defaultdict from math import gcd n = int(input()) *a, = map(int,input().split()) d = defaultdict(int) d[0] = 1 for ai in a: nd = d.copy() for k,v in d.items(): nd[gcd(ai,k)] += v d = nd print(d[1])