結果

問題 No.437 cwwゲーム
ユーザー pluto77
提出日時 2017-07-21 09:22:21
言語 Python2
(2.7.18)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2024-10-12 08:44:12
合計ジャッジ時間 2,094 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_437

def f(s,n):
 res=n
 for i in xrange(len(s)):
  for j in xrange(i+1,len(s)):
   for k in xrange(j+1,len(s)):
    if s[i]!='0' and s[i]!=s[j] and s[j]==s[k]:
     res=max(res,f(s[:i]+s[i+1:j]+s[j+1:k],n+int(s[i]+s[j]+s[k])))
 return res

print f(raw_input(),0)
0