hoses专题

Arpa's weak amphitheater and Mehrdad's valuable Hoses

背包问题?!+并查集 一组朋友之中最多只能有一个人去,所以需要在写0-1背包时需要调整for循环的顺序 错解: for(int i=1;i<=n;i++){sum_b=0,sum_w=0;if(pre[i]==i){for(int j=0;j<vn[i].size();j++){sum_b+=bn[vn[i][j]];sum_w+=wn[vn[i][j]];for(int k=w;k>=

Arpa's weak amphitheater and Mehrdad's valuable Hoses CodeForces - 742D

Arpa’s weak amphitheater and Mehrdad’s valuable Hoses CodeForces - 742D 题目描述 Just to remind, girls in Arpa’s land are really nice. Mehrdad wants to invite some Hoses to the palace for a dancing par