結果

問題 No.358 も~っと!門松列
ユーザー ch1channn
提出日時 2022-12-12 14:05:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 594 bytes
コンパイル時間 1,549 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 53,544 KB
最終ジャッジ日時 2024-11-06 12:05:16
合計ジャッジ時間 2,129 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
	

A1, A2, A3 = map(int, input().split())

ans = 0

if A1 == A3:
    
    print(0)
    exit()
    
if (A1 > A2 and A3 > A2) or (A1 < A2 and A3 < A2):
    
    print('INF')
    exit()
    
for i in range(2, 1000 + 1):
    
    B1 = A1 % i
    B2 = A2 % i
    B3 = A3 % i
    
    if B1 != B3 and ((B1 > B2 and B3 > B2) or (B1 < B2 and B3 < B2)):
        
        ans += 1
        
print(ans)
0