結果
| 問題 | No.1352 Three Coins |
| コンテスト | |
| ユーザー |
GER_chen
|
| 提出日時 | 2021-01-17 17:55:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 2,000 ms |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 61,952 KB |
| 最終ジャッジ日時 | 2024-12-23 09:38:46 |
| 合計ジャッジ時間 | 3,471 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#yuki-1352
from math import gcd
A, B, C = sorted(map(int, input().split()))
b = A//gcd(A, B)
c = A//gcd(A, C)
if gcd(A, gcd(B, C)) > 1:
print('INF')
exit()
#mod Aで頑張る
mex = [float('inf')]*A
mex[0] = 0
for i in range(b):
for j in range(c):
R = i*B+j*C
r = R%A
mex[r] = min(R, mex[r])
ans = [m//A for m in mex]
print(sum(ans))
GER_chen