結果

問題 No.1352 Three Coins
ユーザー titiatitia
提出日時 2021-01-17 13:44:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 86,640 KB
実行使用メモリ 76,220 KB
最終ジャッジ日時 2023-08-24 23:03:47
合計ジャッジ時間 8,588 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
75,964 KB
testcase_01 AC 197 ms
76,072 KB
testcase_02 AC 191 ms
75,884 KB
testcase_03 AC 176 ms
76,048 KB
testcase_04 AC 187 ms
75,976 KB
testcase_05 AC 185 ms
76,080 KB
testcase_06 AC 204 ms
76,068 KB
testcase_07 AC 186 ms
76,004 KB
testcase_08 AC 323 ms
75,992 KB
testcase_09 AC 185 ms
76,088 KB
testcase_10 AC 188 ms
76,076 KB
testcase_11 AC 187 ms
75,996 KB
testcase_12 AC 175 ms
75,772 KB
testcase_13 AC 186 ms
76,132 KB
testcase_14 AC 190 ms
76,120 KB
testcase_15 AC 188 ms
76,072 KB
testcase_16 AC 196 ms
75,980 KB
testcase_17 AC 184 ms
75,936 KB
testcase_18 AC 189 ms
75,996 KB
testcase_19 AC 186 ms
76,104 KB
testcase_20 AC 176 ms
76,072 KB
testcase_21 AC 199 ms
76,220 KB
testcase_22 AC 176 ms
76,004 KB
testcase_23 AC 185 ms
76,156 KB
testcase_24 AC 175 ms
76,036 KB
testcase_25 AC 141 ms
76,024 KB
testcase_26 AC 174 ms
76,088 KB
testcase_27 AC 140 ms
75,968 KB
testcase_28 AC 187 ms
75,976 KB
testcase_29 AC 193 ms
76,076 KB
testcase_30 AC 191 ms
76,048 KB
testcase_31 AC 186 ms
75,956 KB
testcase_32 AC 198 ms
76,184 KB
testcase_33 AC 184 ms
75,884 KB
testcase_34 AC 194 ms
75,744 KB
testcase_35 AC 165 ms
75,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

X=sorted(map(int,input().split()))
A,B,C=X

MIN=[1<<31]*A

for i in range(5000):
    for j in range(5000):
        MIN[(B*i+C*j)%A]=min(MIN[(B*i+C*j)%A],B*i+C*j)

ANS=0
for i in range(A):
    if MIN[i]==1<<31:
        print("INF")
        sys.exit()
    ANS+=MIN[i]//A

print(ANS)
0