結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 455 ms
110,256 KB
testcase_01 AC 1,644 ms
110,460 KB
testcase_02 AC 1,451 ms
110,528 KB
testcase_03 AC 1,420 ms
110,620 KB
testcase_04 AC 257 ms
110,184 KB
testcase_05 AC 258 ms
110,184 KB
testcase_06 AC 251 ms
110,504 KB
testcase_07 AC 251 ms
109,068 KB
testcase_08 WA -
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 38 ms
53,460 KB
testcase_11 WA -
testcase_12 AC 258 ms
110,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 408 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(2,N):
  g = gcd(g,A[i])
  l *= A[i]
  l //= g
if l == K:
  print('Yes')
else:
  print('No')
0