結果

問題 No.358 も~っと!門松列
ユーザー turner18_jpturner18_jp
提出日時 2018-03-16 03:54:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,640 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-08-23 11:34:09
合計ジャッジ時間 1,718 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,784 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 15 ms
7,728 KB
testcase_03 AC 15 ms
7,748 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 15 ms
7,836 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,732 KB
testcase_09 WA -
testcase_10 AC 16 ms
7,940 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
7,816 KB
testcase_14 AC 16 ms
7,788 KB
testcase_15 AC 15 ms
7,924 KB
testcase_16 AC 16 ms
7,740 KB
testcase_17 AC 16 ms
7,792 KB
testcase_18 AC 16 ms
7,768 KB
testcase_19 AC 16 ms
7,796 KB
testcase_20 WA -
testcase_21 AC 16 ms
7,768 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def judge(a, b, c):
  if b > a and b > c or b < a and b < c and not a == c:
    return True
  else:
    return False

def f():
  count = 0
  if a == c:
    return '0'
  if judge(a, b, c):
    return 'INF'

  for i in range(1, max(a, b, c)+2):
    if judge(a%i, b%i, c%i):
      count += 1
  return count
print(f())
0