結果
| 問題 | No.798 コレクション |
| コンテスト | |
| ユーザー |
tomarint2
|
| 提出日時 | 2019-03-15 23:24:48 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 347 bytes |
| 記録 | |
| コンパイル時間 | 452 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 36,300 KB |
| 最終ジャッジ日時 | 2026-03-23 00:41:36 |
| 合計ジャッジ時間 | 20,941 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 RE * 7 TLE * 5 |
ソースコード
N=int(input())
a=[0]*N
b=[0]*N
for i in range(N):
a[i],b[i]=map(int,input().split())
def buy(n, history):
if n == (N+1)*2//3:
return 0
cost = []
for i in range(N):
if (history & (1 << i)) != 0:
continue
cost.append(a[i]+b[i]*n + buy(n+1, history|(1<<i)))
return min(cost)
print(buy(0, 0))
tomarint2