Search found 2 matches

by rahat089
Thu Jun 25, 2009 6:35 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 51499

Re: 102, WA

#include<stdio.h> int bin[3][3]={0}; int moves[6]={0}; int main() { int min,i,index; while(scanf("%d%d%d%d%d%d%d%d%d",&bin[0][0],&bin[0][1],&bin[0][2],&bin[1][0],&bin[1][1],&bin[1][2],&bin[2][0],&bin[2][1],&bin[2][2])==9) { min=0; moves[0]=bin[0][1]+bin[0][2]+bin[1][0]+bin[1][2]+bin[2][0]+bin[2][1];...
by rahat089
Mon May 11, 2009 7:43 pm
Forum: Volume 1 (100-199)
Topic: 136 - Ugly Numbers
Replies: 156
Views: 19409

Re: 136 Ugly number WA

i am gettin wrong ans with this code...can anyone plz help me out with this??? #include<stdio.h> int p; int q; int r; int ugly[1501]={0}; int main() { int P,Q,R; ugly[0]=1; p=q=r=0; int i=1; while(ugly[1499]==0) { P=(ugly[p])*2; Q=(ugly[q])*3; R=(ugly[r])*5; if((P<Q)&&(P<R)) { ugly =P; i++; p++; } e...

Go to advanced search