結果

問題 No.358 も~っと!門松列
ユーザー iad_2889iad_2889
提出日時 2019-05-21 02:00:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,912 KB
実行使用メモリ 10,184 KB
最終ジャッジ日時 2023-10-17 10:16:49
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,156 KB
testcase_01 AC 27 ms
10,156 KB
testcase_02 AC 28 ms
10,156 KB
testcase_03 AC 27 ms
10,156 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 27 ms
10,156 KB
testcase_07 WA -
testcase_08 AC 27 ms
10,156 KB
testcase_09 WA -
testcase_10 AC 27 ms
10,156 KB
testcase_11 AC 27 ms
10,156 KB
testcase_12 AC 28 ms
10,156 KB
testcase_13 AC 27 ms
10,156 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_kadomatsu(lst):
    if len(set(lst)) != 3:
        return False
    return min(lst) == lst[1] or max(lst) == lst[1]

lst = list(map(int,input().split()))
i = 2
cnt = 0
t_chain = 0
f_chain = 0
while True:
    if is_kadomatsu([x % i for x in lst]):
        cnt+=1
        t_chain+=1
        f_chain = 0
    else:
        f_chain+=1
        t_chain = 0
    if t_chain >= 100 or f_chain >= 100:
        break
    i+=1
if t_chain >= 100:
    ans = "INF"
else:
    ans = cnt
print(ans)
0