結果

問題 No.2682 Visible Divisible
ユーザー harurunharurun
提出日時 2024-03-20 22:25:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 110,536 KB
最終ジャッジ日時 2024-03-20 22:25:26
合計ジャッジ時間 5,018 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 208 ms
110,204 KB
testcase_01 AC 210 ms
110,372 KB
testcase_02 AC 229 ms
110,436 KB
testcase_03 AC 211 ms
110,528 KB
testcase_04 AC 129 ms
105,616 KB
testcase_05 AC 153 ms
105,612 KB
testcase_06 AC 188 ms
110,536 KB
testcase_07 AC 207 ms
109,100 KB
testcase_08 AC 37 ms
53,588 KB
testcase_09 AC 37 ms
53,588 KB
testcase_10 AC 37 ms
53,588 KB
testcase_11 AC 201 ms
110,212 KB
testcase_12 AC 240 ms
110,276 KB
testcase_13 AC 206 ms
109,932 KB
testcase_14 AC 187 ms
110,296 KB
testcase_15 AC 206 ms
109,188 KB
testcase_16 AC 135 ms
105,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def lcm(x,y):
  return x//math.gcd(x,y)*y
def main():
  N,K=map(int,input().split())
  A=list(map(int,input().split()))
  ans=A[0]
  for i in range(1,N):
    ans=lcm(ans,A[i])
    ans%=K
  if ans==0:
    print("Yes")
  else:
    print("No")
  return

main()
0