結果

問題 No.358 も~っと!門松列
コンテスト
ユーザー yomo3
提出日時 2020-02-20 18:44:57
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 20 ms / 1,000 ms
+ 981µs
コード長 331 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 54 ms
コンパイル使用メモリ 15,232 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-09-12 05:26:28
合計ジャッジ時間 2,149 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

A, B, C = map(int, input().split())

if A==B or B==C or C==A:
    print(0)
elif (B < A and B < C) or (B > A and B > C):
    print('INF')
else:
    ans = 0
    for p in range(2, max(A, C) + 1):
        a, b, c = A % p, B % p, C % p
        if a != c and ((b < a and b < c) or (b > a and b > c)):
            ans += 1
    print(ans)
0