結果

問題 No.2682 Visible Divisible
ユーザー PNJPNJ
提出日時 2024-03-20 21:33:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 328 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 110,624 KB
最終ジャッジ日時 2024-03-20 21:34:02
合計ジャッジ時間 10,554 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 461 ms
110,296 KB
testcase_01 AC 1,629 ms
110,456 KB
testcase_02 AC 1,448 ms
110,528 KB
testcase_03 AC 1,404 ms
110,624 KB
testcase_04 AC 258 ms
110,188 KB
testcase_05 AC 271 ms
110,180 KB
testcase_06 AC 251 ms
110,496 KB
testcase_07 AC 254 ms
109,068 KB
testcase_08 WA -
testcase_09 AC 38 ms
53,460 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 WA -
testcase_12 AC 259 ms
110,372 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 406 ms
109,156 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def Map():
  return list(map(int,input().split()))

def gcd(a, b):
  while a != 0:
    b %= a
    if b == 0: return a
    a %= b
  return b

N,K = Map()
A = Map()
for i in range(N):
  A[i] = gcd(A[i],K)

g = A[0]
l = A[0]
for i in range(1,N):
  g = gcd(g,A[i])
  l *= A[i]
  l //= g
if l == K:
  print('Yes')
else:
  print('No')
0