結果
| 問題 | No.1352 Three Coins | 
| コンテスト | |
| ユーザー |  GER_chen | 
| 提出日時 | 2021-01-17 13:15:18 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 361 bytes | 
| コンパイル時間 | 201 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 11,136 KB | 
| 最終ジャッジ日時 | 2024-11-29 20:03:59 | 
| 合計ジャッジ時間 | 2,132 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 11 WA * 23 | 
ソースコード
#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(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))
            
            
            
        