結果
| 問題 | No.186 中華風 (Easy) |
| コンテスト | |
| ユーザー |
しらっ亭
|
| 提出日時 | 2015-08-10 20:33:31 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 629 bytes |
| 記録 | |
| コンパイル時間 | 50 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2026-11-10 18:47:04 |
| 合計ジャッジ時間 | 8,119 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 TLE * 1 -- * 12 |
ソースコード
def gcd(a, b):
m, n = min(a, b), max(a, b)
while n != 0:
m, n = n, m % n
return m
def lcm(a, b):
return a * b // gcd(a, b)
def solve():
x1, y1 = list(map(int, input().split()))
x2, y2 = list(map(int, input().split()))
x3, y3 = list(map(int, input().split()))
lcm12 = lcm(y1, y2)
for a in range(y2):
p = a * y1 + x1
if p % y2 == x2:
for b in range(1 if p == 0 else 0, y3):
q = b * lcm12 + p
if q % y3 == x3:
print(q)
return
print(-1)
if __name__ == '__main__':
solve()
しらっ亭