結果

問題 No.437 cwwゲーム
ユーザー H3PO4H3PO4
提出日時 2020-08-06 09:19:15
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 501 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 85,604 KB
最終ジャッジ日時 2023-10-19 11:10:24
合計ジャッジ時間 13,393 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
56,680 KB
testcase_01 AC 40 ms
53,524 KB
testcase_02 AC 174 ms
76,828 KB
testcase_03 AC 42 ms
56,644 KB
testcase_04 AC 45 ms
56,644 KB
testcase_05 AC 1,373 ms
84,712 KB
testcase_06 AC 1,435 ms
85,604 KB
testcase_07 AC 1,335 ms
83,552 KB
testcase_08 AC 1,310 ms
84,460 KB
testcase_09 AC 1,341 ms
83,552 KB
testcase_10 AC 1,271 ms
82,984 KB
testcase_11 AC 879 ms
77,524 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
権限があれば一括ダウンロードができます

ソースコード

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