結果
| 問題 |
No.1250 汝は倍数なりや?
|
| コンテスト | |
| ユーザー |
toshiro_yanagi
|
| 提出日時 | 2022-07-09 12:21:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 527 bytes |
| コンパイル時間 | 477 ms |
| コンパイル使用メモリ | 82,308 KB |
| 実行使用メモリ | 95,744 KB |
| 最終ジャッジ日時 | 2024-12-30 14:03:28 |
| 合計ジャッジ時間 | 5,839 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 48 WA * 1 |
ソースコード
bufio_scanner = []
def main():
n, h = [int(fmt_scan()) for _ in range(2)]
a = [int(x) for x in input().split()]
for _, v in enumerate(a):
if v % gcd(h, v) == 0:
h //= gcd(h, v)
print("YES" if h == 1 else "NO")
def fmt_scan() -> str:
sc = bufio_scanner
if len(sc) == 0:
for v in reversed(input().split()):
sc.append(v)
return sc.pop()
def gcd(a, b) -> int:
a, b = max(a, b), min(a, b)
while b > 0:
a, b = b, a % b
return a
main()
toshiro_yanagi