結果

問題 No.358 も~っと!門松列
ユーザー roiti46roiti46
提出日時 2016-10-10 20:22:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 439 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 8,276 KB
最終ジャッジ日時 2024-05-01 19:00:17
合計ジャッジ時間 2,193 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
8,148 KB
testcase_01 AC 24 ms
8,152 KB
testcase_02 AC 24 ms
8,148 KB
testcase_03 AC 25 ms
8,148 KB
testcase_04 AC 25 ms
8,148 KB
testcase_05 AC 24 ms
8,192 KB
testcase_06 AC 23 ms
8,148 KB
testcase_07 AC 25 ms
8,192 KB
testcase_08 AC 23 ms
8,148 KB
testcase_09 AC 24 ms
8,148 KB
testcase_10 AC 24 ms
8,276 KB
testcase_11 AC 25 ms
8,148 KB
testcase_12 AC 24 ms
8,148 KB
testcase_13 AC 25 ms
8,192 KB
testcase_14 AC 24 ms
8,276 KB
testcase_15 AC 24 ms
8,192 KB
testcase_16 AC 25 ms
8,192 KB
testcase_17 AC 24 ms
8,148 KB
testcase_18 AC 24 ms
8,192 KB
testcase_19 AC 24 ms
8,148 KB
testcase_20 AC 23 ms
8,276 KB
testcase_21 AC 25 ms
8,152 KB
testcase_22 AC 24 ms
8,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- 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