結果

問題 No.1987 Sandglass Inconvenience
ユーザー titan23titan23
提出日時 2022-06-24 21:51:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 54,108 KB
最終ジャッジ日時 2024-04-26 05:05:03
合計ジャッジ時間 2,087 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,196 KB
testcase_01 AC 38 ms
52,996 KB
testcase_02 AC 37 ms
53,940 KB
testcase_03 AC 38 ms
53,760 KB
testcase_04 AC 37 ms
53,240 KB
testcase_05 AC 38 ms
53,076 KB
testcase_06 AC 38 ms
52,520 KB
testcase_07 AC 37 ms
53,020 KB
testcase_08 AC 42 ms
53,000 KB
testcase_09 AC 38 ms
53,624 KB
testcase_10 AC 38 ms
52,620 KB
testcase_11 AC 37 ms
53,760 KB
testcase_12 AC 38 ms
52,080 KB
testcase_13 AC 38 ms
52,328 KB
testcase_14 AC 38 ms
54,108 KB
testcase_15 AC 39 ms
53,668 KB
testcase_16 AC 39 ms
53,824 KB
testcase_17 AC 39 ms
53,196 KB
testcase_18 AC 38 ms
53,472 KB
testcase_19 AC 37 ms
52,452 KB
testcase_20 AC 38 ms
52,628 KB
testcase_21 AC 37 ms
52,380 KB
testcase_22 AC 37 ms
52,492 KB
testcase_23 AC 38 ms
53,132 KB
testcase_24 AC 38 ms
52,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = lambda: sys.stdin.readline().rstrip()

#  -----------------------  #

A = list(map(int, input().split()))
x = int(input())
if x in A:
  print('Yes')
  exit()

gcd = []
for i in range(len(A)):
  for j in range(i+1, len(A)):
    gcd.append(math.gcd(A[i], A[j]))
    for k in range(j+1, len(A)):
      gcd.append(math.gcd(math.gcd(A[i], A[j]), A[k]))
# print(gcd)

for g in gcd:
  if x % g == 0:
    print('Yes')
    break
else:
  print('No')
0