結果
問題 |
No.437 cwwゲーム
|
ユーザー |
|
提出日時 | 2021-03-14 10:53:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 296 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 78,140 KB |
最終ジャッジ日時 | 2024-10-15 20:08:03 |
合計ジャッジ時間 | 5,144 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 1 |
ソースコード
N=input() pt=[] for i in range(len(N)): for j in range(i+1,len(N)): for k in range(j+1,len(N)): if N[i]!=N[j] and N[j]==N[k]: pt.append((i,j,k)) from copy import deepcopy def ans(his,nu): if his.count(0)<3: return nu maximum=nu for i,j,k in pt: if all([his[i]==0,his[j]==0,his[k]==0]): his_c=deepcopy(his) his_c[i]=1;his_c[j]=1;his_c[k]=1 maximum=max(maximum,ans(his_c,nu+int(N[i])*100+int(N[j])*11)) return maximum print(ans([0]*len(N),0))