結果

問題 No.437 cwwゲーム
ユーザー 👑 KazunKazun
提出日時 2021-01-04 17:16:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 73,332 KB
最終ジャッジ日時 2024-04-23 03:12:53
合計ジャッジ時間 3,382 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
56,248 KB
testcase_01 AC 40 ms
55,044 KB
testcase_02 AC 46 ms
63,632 KB
testcase_03 AC 40 ms
55,324 KB
testcase_04 AC 38 ms
55,584 KB
testcase_05 AC 45 ms
57,072 KB
testcase_06 AC 47 ms
62,896 KB
testcase_07 AC 71 ms
73,332 KB
testcase_08 AC 47 ms
56,528 KB
testcase_09 AC 67 ms
73,012 KB
testcase_10 AC 50 ms
66,708 KB
testcase_11 AC 44 ms
55,920 KB
testcase_12 AC 40 ms
55,296 KB
testcase_13 AC 43 ms
57,284 KB
testcase_14 AC 43 ms
56,656 KB
testcase_15 AC 52 ms
66,388 KB
testcase_16 AC 46 ms
61,604 KB
testcase_17 AC 42 ms
55,884 KB
testcase_18 AC 46 ms
56,148 KB
testcase_19 AC 42 ms
55,044 KB
testcase_20 AC 39 ms
55,112 KB
testcase_21 AC 39 ms
54,856 KB
testcase_22 AC 40 ms
54,996 KB
testcase_23 AC 41 ms
55,324 KB
testcase_24 AC 42 ms
55,196 KB
testcase_25 AC 41 ms
56,372 KB
testcase_26 AC 42 ms
61,452 KB
testcase_27 AC 40 ms
55,888 KB
testcase_28 AC 40 ms
56,436 KB
testcase_29 AC 39 ms
55,156 KB
testcase_30 AC 40 ms
54,792 KB
testcase_31 AC 39 ms
54,840 KB
testcase_32 AC 41 ms
55,564 KB
testcase_33 AC 46 ms
55,828 KB
testcase_34 AC 42 ms
55,428 KB
testcase_35 AC 41 ms
56,652 KB
testcase_36 AC 41 ms
55,996 KB
testcase_37 AC 40 ms
55,124 KB
testcase_38 AC 39 ms
54,852 KB
testcase_39 AC 40 ms
56,144 KB
testcase_40 AC 40 ms
55,376 KB
testcase_41 AC 41 ms
57,256 KB
testcase_42 AC 44 ms
55,300 KB
testcase_43 AC 42 ms
55,760 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] and L[i]!=L[j]:
                    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