#include#include #include using namespace std; vector T[100010]; double p,r; double total_sales=0; void dfs(int root,int depth){ if(T[root].size()==1 && T[root][0]<0){ total_sales+=(-T[root][0])*p*pow(1+0.01*r,depth); return; } for(int i=0;i 0) while(tmp_n--){ scanf("%d",&tmp_t); T[i].push_back(tmp_t); } else{ scanf("%d",&tmp_t); T[i].push_back(-tmp_t);//是零售商[叶子结点]时,直接存成负的,节约一点空间 } } dfs(0,0); printf("%.1f",total_sales); return 0; }



