結果
| 問題 | No.1352 Three Coins | 
| コンテスト | |
| ユーザー |  GER_chen | 
| 提出日時 | 2021-01-17 17:54:55 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 369 bytes | 
| コンパイル時間 | 334 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 21,632 KB | 
| 最終ジャッジ日時 | 2024-11-29 22:28:40 | 
| 合計ジャッジ時間 | 12,088 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 32 TLE * 2 | 
ソースコード
#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))
            
            
            
        