結果

問題 No.358 も~っと!門松列
ユーザー 👑 yumechiyumechi
提出日時 2016-04-25 00:08:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 342 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 62,736 KB
最終ジャッジ日時 2024-04-15 04:25:32
合計ジャッジ時間 1,717 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,336 KB
testcase_01 AC 38 ms
52,752 KB
testcase_02 AC 39 ms
53,276 KB
testcase_03 AC 40 ms
58,624 KB
testcase_04 AC 40 ms
61,512 KB
testcase_05 AC 42 ms
62,348 KB
testcase_06 AC 40 ms
59,924 KB
testcase_07 AC 42 ms
59,372 KB
testcase_08 AC 40 ms
59,668 KB
testcase_09 AC 43 ms
60,900 KB
testcase_10 AC 34 ms
53,356 KB
testcase_11 AC 35 ms
52,948 KB
testcase_12 AC 35 ms
53,460 KB
testcase_13 AC 39 ms
58,044 KB
testcase_14 AC 42 ms
62,420 KB
testcase_15 AC 47 ms
62,232 KB
testcase_16 AC 43 ms
62,736 KB
testcase_17 AC 42 ms
60,776 KB
testcase_18 AC 45 ms
62,028 KB
testcase_19 AC 42 ms
60,632 KB
testcase_20 AC 46 ms
61,920 KB
testcase_21 AC 43 ms
62,524 KB
testcase_22 AC 43 ms
61,236 KB
権限があれば一括ダウンロードができます

ソースコード

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