結果

問題 No.1352 Three Coins
ユーザー nasubi24nasubi24
提出日時 2021-01-17 13:41:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 114,532 KB
最終ジャッジ日時 2023-08-24 23:03:31
合計ジャッジ時間 6,546 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
113,488 KB
testcase_01 AC 119 ms
113,984 KB
testcase_02 AC 137 ms
114,060 KB
testcase_03 AC 121 ms
114,360 KB
testcase_04 AC 139 ms
114,064 KB
testcase_05 AC 140 ms
114,228 KB
testcase_06 AC 138 ms
114,260 KB
testcase_07 AC 71 ms
71,044 KB
testcase_08 AC 139 ms
114,316 KB
testcase_09 AC 135 ms
114,220 KB
testcase_10 AC 136 ms
114,272 KB
testcase_11 AC 136 ms
114,220 KB
testcase_12 AC 71 ms
70,988 KB
testcase_13 AC 137 ms
114,224 KB
testcase_14 AC 137 ms
114,500 KB
testcase_15 AC 138 ms
114,432 KB
testcase_16 AC 71 ms
71,260 KB
testcase_17 AC 138 ms
114,368 KB
testcase_18 AC 139 ms
114,272 KB
testcase_19 AC 71 ms
71,096 KB
testcase_20 AC 71 ms
70,892 KB
testcase_21 AC 137 ms
114,348 KB
testcase_22 AC 73 ms
70,712 KB
testcase_23 AC 71 ms
71,196 KB
testcase_24 AC 134 ms
114,188 KB
testcase_25 AC 71 ms
71,044 KB
testcase_26 AC 72 ms
71,180 KB
testcase_27 AC 120 ms
114,252 KB
testcase_28 AC 138 ms
114,268 KB
testcase_29 AC 120 ms
114,532 KB
testcase_30 AC 135 ms
114,340 KB
testcase_31 AC 136 ms
114,060 KB
testcase_32 AC 126 ms
114,464 KB
testcase_33 AC 75 ms
71,048 KB
testcase_34 AC 120 ms
114,292 KB
testcase_35 AC 118 ms
114,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
a,b,c=map(int,input().split())
if math.gcd(math.gcd(a,b),c)!=1:
    print("INF")
else:
    cnt=[0]*(5*10**6)
    cnt[0]=1
    for i in range(len(cnt)-max(a,b,c)):
        if cnt[i]==1:
            cnt[i+a]=1
            cnt[i+b]=1
            cnt[i+c]=1
    print(cnt.count(0))
0