結果

問題 No.2682 Visible Divisible
ユーザー PNJPNJ
提出日時 2024-03-20 21:34:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 293 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 110,640 KB
最終ジャッジ日時 2024-03-20 21:34:42
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 278 ms
110,304 KB
testcase_01 AC 278 ms
110,472 KB
testcase_02 AC 280 ms
110,536 KB
testcase_03 AC 279 ms
110,632 KB
testcase_04 AC 276 ms
110,200 KB
testcase_05 AC 272 ms
110,192 KB
testcase_06 AC 258 ms
110,640 KB
testcase_07 AC 250 ms
109,076 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 37 ms
53,460 KB
testcase_11 AC 288 ms
110,440 KB
testcase_12 AC 276 ms
110,380 KB
testcase_13 AC 275 ms
110,168 KB
testcase_14 AC 288 ms
110,524 KB
testcase_15 AC 274 ms
109,172 KB
testcase_16 AC 293 ms
110,472 KB
権限があれば一括ダウンロードができます

ソースコード

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)

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