結果

問題 No.1987 Sandglass Inconvenience
ユーザー FromBooskaFromBooska
提出日時 2023-06-19 22:56:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 72,596 KB
最終ジャッジ日時 2023-09-09 18:07:24
合計ジャッジ時間 3,979 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
72,188 KB
testcase_01 AC 104 ms
72,056 KB
testcase_02 AC 104 ms
72,496 KB
testcase_03 AC 104 ms
72,256 KB
testcase_04 AC 104 ms
72,236 KB
testcase_05 AC 102 ms
72,276 KB
testcase_06 AC 106 ms
72,296 KB
testcase_07 AC 103 ms
72,404 KB
testcase_08 AC 102 ms
72,368 KB
testcase_09 AC 104 ms
72,252 KB
testcase_10 AC 103 ms
72,304 KB
testcase_11 AC 102 ms
72,268 KB
testcase_12 AC 102 ms
72,304 KB
testcase_13 AC 103 ms
72,544 KB
testcase_14 AC 102 ms
72,596 KB
testcase_15 AC 103 ms
72,528 KB
testcase_16 AC 103 ms
72,260 KB
testcase_17 AC 104 ms
72,244 KB
testcase_18 AC 103 ms
72,136 KB
testcase_19 AC 101 ms
72,372 KB
testcase_20 AC 101 ms
72,168 KB
testcase_21 AC 103 ms
72,140 KB
testcase_22 AC 102 ms
72,540 KB
testcase_23 AC 104 ms
72,568 KB
testcase_24 AC 103 ms
72,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# ABC297Eのようにできるか、違うと思う、何回であきらめるかが決定できない
# gcd的にやるか
# 差をとっていって、Xのgcdとなる差ができればYesか
# 通ったがAB, AC, BCは不必要だったようなので変更

A, B, C = map(int, input().split())
X = int(input())

import math
import functools
#AB = abs(A-B)
#AC = abs(A-C)
#BC = abs(B-C)
#D = [A, B, C, AB, AC, BC]
D = [A, B, C]
GCD = functools.reduce(math.gcd, D)
if X%GCD == 0:
    print('Yes')
else:
    print('No')
#print(GCD)
0