結果
| 問題 | 
                            No.45 回転寿司
                             | 
                    
| ユーザー | 
                             popketle
                         | 
                    
| 提出日時 | 2019-12-20 16:04:39 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 324 bytes | 
| コンパイル時間 | 210 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 21,248 KB | 
| 最終ジャッジ日時 | 2024-07-08 11:29:09 | 
| 合計ジャッジ時間 | 12,830 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 4 | 
| other | TLE * 1 -- * 29 | 
ソースコード
n=int(input())
V=list(map(int,input().split()))
ans=0
for i in range(2**n):
    tmp,flag=0,False
    for j in range(n):
        if i>>j&1:
            if flag:
                continue
            else:
                tmp+=V[j]
                flag=True
        else:
            flag=False
    ans=max(ans,tmp)
print(ans)
            
            
            
        
            
popketle