結果

問題 No.358 も~っと!門松列
ユーザー yumechi
提出日時 2016-04-25 00:08:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 342 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,508 KB
実行使用メモリ 62,848 KB
最終ジャッジ日時 2024-10-04 15:40:08
合計ジャッジ時間 1,639 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

a = [int(i) for i in input().split()]
res = 0
for i in range(1, max(a)+1):
    b = [e % i for e in a]
    if len(b) != len(set(b)):
        continue
    if b[1] == max(b) or b[1] == min(b):
        res += 1
b = [e % (max(a)+1) for e in a]
if len(b) == len(set(b)) and (b[1] == max(b) or b[1] == min(b)):
    print("INF")
else:
    print(res)
0