結果
| 問題 | 
                            No.358 も~っと!門松列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-29 13:08:45 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 41 ms / 1,000 ms | 
| コード長 | 390 bytes | 
| コンパイル時間 | 181 ms | 
| コンパイル使用メモリ | 82,300 KB | 
| 実行使用メモリ | 53,528 KB | 
| 最終ジャッジ日時 | 2024-11-14 05:37:19 | 
| 合計ジャッジ時間 | 2,059 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 | 
ソースコード
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)