結果
| 問題 |
No.1352 Three Coins
|
| コンテスト | |
| ユーザー |
nasubi24
|
| 提出日時 | 2021-01-17 13:41:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 2,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 357 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 98,880 KB |
| 最終ジャッジ日時 | 2024-12-23 09:33:37 |
| 合計ジャッジ時間 | 3,838 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
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))
nasubi24