結果

問題 No.437 cwwゲーム
ユーザー kohei2019kohei2019
提出日時 2022-01-25 00:40:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 712 bytes
コンパイル時間 1,241 ms
コンパイル使用メモリ 86,524 KB
実行使用メモリ 78,616 KB
最終ジャッジ日時 2023-08-21 16:03:19
合計ジャッジ時間 8,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,640 KB
testcase_01 AC 95 ms
71,760 KB
testcase_02 AC 128 ms
77,832 KB
testcase_03 AC 94 ms
71,528 KB
testcase_04 AC 96 ms
71,400 KB
testcase_05 AC 125 ms
77,692 KB
testcase_06 AC 126 ms
77,344 KB
testcase_07 AC 128 ms
77,604 KB
testcase_08 AC 123 ms
77,620 KB
testcase_09 AC 126 ms
77,708 KB
testcase_10 AC 122 ms
77,536 KB
testcase_11 AC 96 ms
71,596 KB
testcase_12 AC 96 ms
71,672 KB
testcase_13 AC 119 ms
77,668 KB
testcase_14 AC 104 ms
76,876 KB
testcase_15 AC 123 ms
77,436 KB
testcase_16 AC 146 ms
78,140 KB
testcase_17 AC 119 ms
77,496 KB
testcase_18 AC 113 ms
77,436 KB
testcase_19 WA -
testcase_20 AC 94 ms
71,576 KB
testcase_21 AC 94 ms
71,472 KB
testcase_22 AC 94 ms
71,612 KB
testcase_23 AC 147 ms
78,616 KB
testcase_24 AC 95 ms
71,608 KB
testcase_25 AC 139 ms
78,076 KB
testcase_26 AC 145 ms
78,348 KB
testcase_27 AC 96 ms
71,616 KB
testcase_28 AC 95 ms
71,392 KB
testcase_29 AC 96 ms
71,760 KB
testcase_30 AC 92 ms
71,608 KB
testcase_31 AC 95 ms
71,392 KB
testcase_32 AC 95 ms
71,688 KB
testcase_33 AC 114 ms
77,372 KB
testcase_34 AC 98 ms
71,580 KB
testcase_35 AC 118 ms
77,460 KB
testcase_36 AC 98 ms
71,296 KB
testcase_37 AC 96 ms
71,540 KB
testcase_38 AC 98 ms
71,396 KB
testcase_39 AC 96 ms
71,848 KB
testcase_40 AC 97 ms
71,536 KB
testcase_41 AC 122 ms
77,564 KB
testcase_42 AC 116 ms
77,660 KB
testcase_43 AC 123 ms
77,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = list(input())
ans = 0
dd = collections.defaultdict(lambda:0)
def func(ls):
    if len(ls) < 3:
        dd[''.join(ls)] = 0
        return 0
    s = ''.join(ls)
    if s in dd:
        return dd[s]
    c = len(ls)
    val = 0
    for i in range(c-2):
        for j in range(i+1,c-1):
            for k in range(j+1,c):
                ls0 = ls[:]
                a0,b0,c0 = ls0[i],ls0[k],ls0[j]
                del ls0[i]
                del ls0[j-1]
                del ls0[k-2]
                if a0!=b0 and b0==c0:
                    val = max(val,func(ls0)+int(a0+b0+c0))
                else:
                    val = max(val,func(ls0))
    dd[s] = val
    return val
print(func(N))
0