結果

問題 No.358 も~っと!門松列
ユーザー pofpof
提出日時 2019-07-14 12:53:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 1,000 ms
コード長 377 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-24 00:28:42
合計ジャッジ時間 1,720 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

def isKadomatu(a1,a2,a3):
    if len({a1,a2,a3})==3 and (max(a1,a2,a3)==a2 or min(a1,a2,a3)==a2):
        return True
    else:
        return False


a1,a2,a3 = map(int,input().split())
if isKadomatu(a1,a2,a3):
    print("INF")
else:
    r=0
    for p in range(1,max(a1,a2,a3)+1):
        b1,b2,b3=a1%p,a2%p,a3%p
        if isKadomatu(b1,b2,b3):
            r+=1
    print(r)
0