結果

問題 No.358 も~っと!門松列
ユーザー pluto77pluto77
提出日時 2016-05-31 18:42:16
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 453 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 6,716 KB
実行使用メモリ 6,124 KB
最終ジャッジ日時 2023-07-29 15:31:42
合計ジャッジ時間 1,590 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,920 KB
testcase_01 AC 11 ms
5,952 KB
testcase_02 AC 11 ms
5,956 KB
testcase_03 AC 11 ms
5,960 KB
testcase_04 AC 12 ms
6,028 KB
testcase_05 AC 12 ms
5,884 KB
testcase_06 AC 11 ms
5,884 KB
testcase_07 AC 11 ms
5,884 KB
testcase_08 AC 11 ms
5,944 KB
testcase_09 AC 11 ms
6,076 KB
testcase_10 AC 11 ms
5,888 KB
testcase_11 AC 12 ms
5,884 KB
testcase_12 AC 11 ms
5,956 KB
testcase_13 AC 11 ms
5,956 KB
testcase_14 AC 12 ms
6,124 KB
testcase_15 AC 11 ms
5,884 KB
testcase_16 AC 11 ms
5,836 KB
testcase_17 AC 11 ms
6,064 KB
testcase_18 AC 11 ms
5,944 KB
testcase_19 AC 11 ms
6,020 KB
testcase_20 AC 12 ms
5,948 KB
testcase_21 AC 11 ms
6,024 KB
testcase_22 AC 11 ms
5,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
#yuki358
import sys

a=map(int,raw_input().split())
if (not a[0]==a[2]) and ((a[1]<a[0] and a[1]<a[2]) or (a[1]>a[0] and a[1]>a[2])):
 print "INF"
 sys.exit()
if a[0]==a[1] or a[1]==a[2] or a[0]==a[2]:
 print 0
 sys.exit()

p=max(a)+1
cnt=0
b=[0 for i in xrange(3)]
for i in xrange(2,p):
 b[0]=a[0]%i
 b[1]=a[1]%i
 b[2]=a[2]%i
 if (b[1]==max(b) or b[1]==min(b)) and not (b[0]==b[1] or b[1]==b[2] or b[0]==b[2]):
  cnt+=1
else:
 print cnt
0