結果

問題 No.358 も~っと!門松列
コンテスト
ユーザー roiti46
提出日時 2016-10-10 20:22:38
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 194 ms / 1,000 ms
コード長 439 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 193 ms
コンパイル使用メモリ 77,716 KB
最終ジャッジ日時 2025-12-03 21:58:00
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

def is_kadomatsu(a, b, c):
    return a != b and b != c and c != a and (max((a, b, c)) == b or min((a, b, c)) == b)

A1, A2, A3 = map(int, raw_input().split())
ans = 0
for p in xrange(1, 1005):
    B1, B2, B3 = A1%p, A2%p, A3%p
    if is_kadomatsu(B1, B2, B3):
        ans += 1
print ans if not is_kadomatsu(A1, A2, A3) else "INF"
0