結果

問題 No.437 cwwゲーム
ユーザー H3PO4
提出日時 2020-08-06 09:17:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 501 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,568 KB
最終ジャッジ日時 2024-09-19 07:18:15
合計ジャッジ時間 15,355 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 1 -- * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N = [int(x) for x in list(input())]


def rec(n):
    if len(n) < 2:
        return 0
    res = 0
    for selector in itertools.combinations(range(len(n)), 3):
        num = [x for i, x in enumerate(n) if i in selector]
        cww = 0
        if num[0] and num[0] != num[1] == num[2]:
            cww = num[0] * 100 + num[1] * 10 + num[2]

        remains = [x for i, x in enumerate(n) if i not in selector]
        res = max(res, cww + rec(remains))
    return res


print(rec(N))
0