結果

問題 No.358 も~っと!門松列
コンテスト
ユーザー ssmkzk
提出日時 2018-08-07 15:40:53
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 97 ms / 1,000 ms
コード長 401 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 566 ms
コンパイル使用メモリ 20,696 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-04-08 06:13:13
合計ジャッジ時間 3,832 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

A1, A2, A3 = map(int, input().split())

if A1 != A2 and A2 != A3 and A3 != A1 and (max(A1,A2,A3) == A2 or min(A1,A2,A3) == A2):
    print("INF")
else:
    count = 0
    for i in range(3,max(A1,A2,A3) + 1):
        B1 = A1 % i
        B2 = A2 % i
        B3 = A3 % i
        if B1 != B2 and B2 != B3 and B3 != B1 and (max(B1,B2,B3) == B2 or min(B1,B2,B3) == B2):
            count += 1
    print(count)
0