2012年3月26日星期一

Dr Dre BeatsType: greedy B: having a machine

Type: greedy B: having a machine, it blocks, if meet being processed block length is l weight is w,Moncler Down Jackets, if the next block length L = l & > & w = w > it does not require the processing time, if you do not meet this condition,UGG Boots Clearance, need to deal with time 1minute find the sequence shortest processing time.
Ideas: first on L sequencing,Vibram Five Fingers, which can satisfy the first condition, pay attention to, if l = = L 'by w to sort, and then enumerates all the sticks, if it sticks than it heavy, updating the weights, to join wood.
Until cannot add date, enumerate a block # include < iostream> include < #; algorithm> using namespace STD; struct s {int x; int y; bool visted;} a [6000]; bool CMP (struct s a, struct s b) {if (a.
x = = b.x) return a.y < b.y else return; a.x < b.x;} int main () {int, N,Dr Dre Headphones, I, t, J, min,Dr Dre Beats, K; cin> > n; for (k = 0; K < n; K + +) {int CNT = 0; cin> > t; for (J = 0; J < t; j + +) a [J].
Visted = false; for (J = 0; J < t; j + +)Cin> > a [J]. X> > a [J]. Y; sort (a, a+t, CMP); for (I = 0; I < t; I + +) {if (a [i]. Visted) continue; min = a [i]. Y; for (J = I + 1; J < t; j + +) {if (a [J] visted a [J].
Related articles:

没有评论:

发表评论