結果
問題 |
No.437 cwwゲーム
|
ユーザー |
|
提出日時 | 2020-08-06 09:19:15 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 501 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 82,100 KB |
実行使用メモリ | 88,908 KB |
最終ジャッジ日時 | 2024-09-19 07:20:12 |
合計ジャッジ時間 | 11,105 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 TLE * 1 -- * 31 |
ソースコード
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))