Tag: problem: (C) Karen and Supermarket Solve In C/C++

Codeforces Round #419 (Div. 1), problem: (C) Karen and Supermarket Solution In C/C++

#include<cstdio> #include<algorithm> #include<queue> using namespace std; const int N=5010; int n,m,c,d,fa; int w,head,next; void add(int f,int t){ static int cnt=0; w=t; next=head; head=cnt; } int f,g,size; //f,g表示在子树i中买j件物品的最小代价 //其中g要求购买从根到i的物品 void dfs(int x){ for (int i=1;i<=n;i++)...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!