题面:https://www.luogu.org/problem/P1016
本题直接贪心之后dfs即可,注意dfs要讨论两种情况.
Code:
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int N=10005;
int n,f;
double ans=100000000.00,d1,c,d2,d[N],p[N],dis[N];
void dfs(int now,double oil,double cost){
if(now==n+1){
if(cost