设f[s][i]为已经买了集合s,当前在商店i,转移的话就是枚举新买的物品,两种情况,一种是在原商店买,不用付路费,另一种是从其他商店过来,这种再枚举从那个商店过来是不行的,记一个mn[s]为已经买了集合s的最小代价,直接用这个转移第二种情况即可 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int n,m,b[N],d[N],a[N…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
#include<bits/stdc++.h> using namespace std; #define ll long long #define pi (4*atan(1.0)) #define eps 1e-14 ,M=4e6+,inf=1e9+,mod=1e9+; ; struct is { int x; int pos; }a[N]; int cmp1(is a,is b) { if(a.x!=b.x) return a.x<b.x; return a.pos<b.pos;…
Stock Prices Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 987 Accepted Submission(s): 397 Problem Description Buy low, sell high. That is what one should do to make profit in the stock ma…