結果

問題 No.1352 Three Coins
ユーザー pluto77
提出日時 2021-03-11 10:58:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 98,872 KB
最終ジャッジ日時 2024-10-13 00:44:55
合計ジャッジ時間 4,281 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1352
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