結果

問題 No.1352 Three Coins
ユーザー pluto77pluto77
提出日時 2021-03-11 10:58:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,056 KB
実行使用メモリ 97,752 KB
最終ジャッジ日時 2024-04-21 02:14:53
合計ジャッジ時間 4,804 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
97,108 KB
testcase_01 AC 100 ms
96,896 KB
testcase_02 AC 124 ms
97,080 KB
testcase_03 AC 99 ms
97,152 KB
testcase_04 AC 122 ms
97,024 KB
testcase_05 AC 116 ms
97,024 KB
testcase_06 AC 119 ms
97,428 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 115 ms
97,024 KB
testcase_09 AC 118 ms
96,640 KB
testcase_10 AC 118 ms
96,944 KB
testcase_11 AC 116 ms
96,896 KB
testcase_12 AC 40 ms
52,096 KB
testcase_13 AC 119 ms
97,024 KB
testcase_14 AC 117 ms
97,428 KB
testcase_15 AC 118 ms
97,024 KB
testcase_16 AC 38 ms
51,712 KB
testcase_17 AC 117 ms
96,768 KB
testcase_18 AC 116 ms
97,076 KB
testcase_19 AC 37 ms
51,712 KB
testcase_20 AC 37 ms
51,712 KB
testcase_21 AC 117 ms
97,024 KB
testcase_22 AC 39 ms
52,456 KB
testcase_23 AC 38 ms
52,224 KB
testcase_24 AC 115 ms
97,752 KB
testcase_25 AC 38 ms
51,968 KB
testcase_26 AC 39 ms
52,224 KB
testcase_27 AC 102 ms
96,816 KB
testcase_28 AC 115 ms
97,280 KB
testcase_29 AC 100 ms
97,408 KB
testcase_30 AC 111 ms
97,476 KB
testcase_31 AC 116 ms
97,024 KB
testcase_32 AC 108 ms
97,664 KB
testcase_33 AC 38 ms
51,968 KB
testcase_34 AC 98 ms
96,768 KB
testcase_35 AC 96 ms
96,896 KB
権限があれば一括ダウンロードができます

ソースコード

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