結果

問題 No.358 も~っと!門松列
コンテスト
ユーザー Kohei
提出日時 2026-08-22 21:10:14
言語 PyPy3
(7.3.23)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 57 ms / 1,000 ms
+ 854µs
コード長 383 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 291 ms
コンパイル使用メモリ 96,096 KB
実行使用メモリ 79,104 KB
最終ジャッジ日時 2026-08-22 21:10:20
合計ジャッジ時間 3,071 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

a, b, c = map(int, input().split())

def kadomatsu(a, b, c):
    if a == b or b == c or c == a:
        return False
    else:
        M = max(a, b, c)
        m = min(a, b, c)
        return b == M or b == m

if kadomatsu(a, b, c):
    exit(print('INF'))

ans = 0
for p in range(1, 1000 + 1):
    a2, b2, c2 = a%p, b%p, c%p
    if kadomatsu(a2, b2, c2):
        ans += 1
print(ans)
0