結果

問題 No.437 cwwゲーム
ユーザー 👑 KazunKazun
提出日時 2021-01-04 17:04:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 79,308 KB
最終ジャッジ日時 2023-08-05 04:41:14
合計ジャッジ時間 7,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
72,328 KB
testcase_01 AC 101 ms
72,244 KB
testcase_02 WA -
testcase_03 AC 99 ms
72,328 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 153 ms
79,092 KB
testcase_08 AC 102 ms
72,284 KB
testcase_09 AC 158 ms
79,308 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 101 ms
72,244 KB
testcase_13 AC 106 ms
77,900 KB
testcase_14 AC 98 ms
72,364 KB
testcase_15 AC 135 ms
78,896 KB
testcase_16 AC 103 ms
77,408 KB
testcase_17 WA -
testcase_18 AC 101 ms
72,288 KB
testcase_19 WA -
testcase_20 AC 95 ms
72,548 KB
testcase_21 WA -
testcase_22 AC 99 ms
72,552 KB
testcase_23 AC 97 ms
72,348 KB
testcase_24 AC 97 ms
72,372 KB
testcase_25 AC 101 ms
76,568 KB
testcase_26 AC 99 ms
76,828 KB
testcase_27 AC 98 ms
72,344 KB
testcase_28 AC 96 ms
72,476 KB
testcase_29 AC 94 ms
72,472 KB
testcase_30 AC 97 ms
72,632 KB
testcase_31 AC 101 ms
72,372 KB
testcase_32 AC 99 ms
72,380 KB
testcase_33 AC 100 ms
72,456 KB
testcase_34 AC 99 ms
72,360 KB
testcase_35 AC 99 ms
72,348 KB
testcase_36 AC 104 ms
72,560 KB
testcase_37 AC 99 ms
72,444 KB
testcase_38 AC 105 ms
72,452 KB
testcase_39 AC 99 ms
72,472 KB
testcase_40 AC 97 ms
72,324 KB
testcase_41 AC 97 ms
72,476 KB
testcase_42 AC 98 ms
72,448 KB
testcase_43 AC 100 ms
72,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache

@lru_cache(maxsize=10**6)
def f(L):
    X=0
    N=len(L)
    for i in range(N):
        if L[i]=="0":
            continue

        for j in range(i+1,N):
            for k in range(j+1,N):
                if L[j]==L[k]:
                    B=L[:i]+L[i+1:j]+L[j+1:k]+L[k+1:]
                    X=max(100*int(L[i])+11*int(L[j])+f(B),X)
    return X

S=input()
print(f(S))
0