結果

問題 No.437 cwwゲーム
ユーザー kohei2019kohei2019
提出日時 2022-01-25 00:40:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 712 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 76,760 KB
最終ジャッジ日時 2024-12-15 05:14:17
合計ジャッジ時間 3,796 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,508 KB
testcase_01 AC 43 ms
53,880 KB
testcase_02 AC 62 ms
71,104 KB
testcase_03 AC 40 ms
53,428 KB
testcase_04 AC 39 ms
53,884 KB
testcase_05 AC 65 ms
72,008 KB
testcase_06 AC 67 ms
74,160 KB
testcase_07 AC 71 ms
76,188 KB
testcase_08 AC 63 ms
72,124 KB
testcase_09 AC 71 ms
76,244 KB
testcase_10 AC 63 ms
73,176 KB
testcase_11 AC 39 ms
55,580 KB
testcase_12 AC 40 ms
55,168 KB
testcase_13 AC 57 ms
69,704 KB
testcase_14 AC 46 ms
62,248 KB
testcase_15 AC 66 ms
71,764 KB
testcase_16 AC 89 ms
76,760 KB
testcase_17 AC 59 ms
69,748 KB
testcase_18 AC 56 ms
67,672 KB
testcase_19 WA -
testcase_20 AC 38 ms
54,996 KB
testcase_21 AC 37 ms
54,744 KB
testcase_22 AC 38 ms
54,800 KB
testcase_23 AC 88 ms
76,428 KB
testcase_24 AC 38 ms
55,252 KB
testcase_25 AC 84 ms
76,452 KB
testcase_26 AC 94 ms
76,596 KB
testcase_27 AC 38 ms
54,304 KB
testcase_28 AC 40 ms
54,568 KB
testcase_29 AC 39 ms
54,024 KB
testcase_30 AC 38 ms
55,320 KB
testcase_31 AC 40 ms
55,192 KB
testcase_32 AC 42 ms
54,380 KB
testcase_33 AC 52 ms
66,012 KB
testcase_34 AC 39 ms
54,664 KB
testcase_35 AC 57 ms
69,968 KB
testcase_36 AC 38 ms
55,236 KB
testcase_37 AC 37 ms
54,552 KB
testcase_38 AC 38 ms
54,420 KB
testcase_39 AC 38 ms
54,660 KB
testcase_40 AC 39 ms
53,744 KB
testcase_41 AC 62 ms
69,940 KB
testcase_42 AC 59 ms
67,852 KB
testcase_43 AC 66 ms
70,856 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