結果

問題 No.358 も~っと!門松列
ユーザー ThetaTheta
提出日時 2022-11-02 13:37:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 610 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 10,012 KB
最終ジャッジ日時 2023-09-24 03:15:55
合計ジャッジ時間 2,745 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,908 KB
testcase_01 AC 28 ms
9,684 KB
testcase_02 AC 28 ms
9,956 KB
testcase_03 AC 27 ms
9,972 KB
testcase_04 AC 27 ms
10,012 KB
testcase_05 AC 28 ms
9,972 KB
testcase_06 AC 27 ms
9,996 KB
testcase_07 AC 28 ms
10,000 KB
testcase_08 AC 28 ms
9,832 KB
testcase_09 AC 28 ms
9,928 KB
testcase_10 AC 29 ms
9,796 KB
testcase_11 AC 27 ms
9,928 KB
testcase_12 AC 27 ms
9,904 KB
testcase_13 AC 26 ms
9,832 KB
testcase_14 AC 27 ms
9,860 KB
testcase_15 AC 27 ms
9,692 KB
testcase_16 AC 27 ms
9,792 KB
testcase_17 AC 27 ms
9,836 KB
testcase_18 AC 28 ms
9,688 KB
testcase_19 AC 26 ms
9,724 KB
testcase_20 AC 29 ms
9,864 KB
testcase_21 AC 26 ms
9,692 KB
testcase_22 AC 28 ms
9,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from typing import Sequence


def is_kadomatsu(numbers: Sequence[int]) -> bool:
    assert len(numbers) == 3
    if numbers[0] == numbers[2]:
        return False

    if numbers[0] < numbers[1] and numbers[1] > numbers[2]:
        return True
    if numbers[0] > numbers[1] and numbers[1] < numbers[2]:
        return True

    return False


def main():
    A = list(map(int, input().split()))
    if is_kadomatsu(A):
        print("INF")
        return

    print(sum(map(is_kadomatsu,
                  [list(map(lambda num: num % p, A)) for p in range(1, 1001)])))


if __name__ == "__main__":
    main()
0