結果

問題 No.1987 Sandglass Inconvenience
ユーザー FromBooskaFromBooska
提出日時 2023-06-19 22:54:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 86,352 KB
実行使用メモリ 72,352 KB
最終ジャッジ日時 2023-09-09 18:07:14
合計ジャッジ時間 5,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
72,064 KB
testcase_01 AC 104 ms
72,064 KB
testcase_02 AC 106 ms
71,972 KB
testcase_03 AC 104 ms
72,196 KB
testcase_04 AC 101 ms
72,352 KB
testcase_05 AC 105 ms
71,812 KB
testcase_06 AC 106 ms
72,152 KB
testcase_07 AC 103 ms
71,992 KB
testcase_08 AC 104 ms
72,128 KB
testcase_09 AC 104 ms
72,224 KB
testcase_10 AC 105 ms
72,012 KB
testcase_11 AC 103 ms
71,988 KB
testcase_12 AC 104 ms
72,012 KB
testcase_13 AC 105 ms
72,224 KB
testcase_14 AC 103 ms
72,320 KB
testcase_15 AC 105 ms
71,816 KB
testcase_16 AC 105 ms
72,316 KB
testcase_17 AC 103 ms
71,944 KB
testcase_18 AC 105 ms
72,248 KB
testcase_19 AC 106 ms
72,216 KB
testcase_20 AC 106 ms
72,016 KB
testcase_21 AC 107 ms
72,016 KB
testcase_22 AC 111 ms
72,216 KB
testcase_23 AC 106 ms
72,136 KB
testcase_24 AC 106 ms
72,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# ABC297Eのようにできるか、違うと思う、何回であきらめるかが決定できない
# gcd的にやるか
# 差をとっていって、Xのgcdとなる差ができればYesか

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]
GCD = functools.reduce(math.gcd, D)
if X%GCD == 0:
    print('Yes')
else:
    print('No')
#print(GCD)
0