check my earlier post.shahedcsenu wrote:i cNT UNDERStand the problem...when light on and when off .;.plz anyone can explain it??
Search found 4 matches
- Wed Nov 09, 2011 9:53 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10110 - Light, more light
- Replies: 76
- Views: 39738
Re: 10110 - Light, More Light
- Fri Nov 12, 2010 9:15 am
- Forum: Volume 101 (10100-10199)
- Topic: 10130 - SuperSale
- Replies: 76
- Views: 35458
Re: 10130 - SuperSales
some people are running the knapsack DP G times which is eventually slowing down their program. for each case, you should run the the DP only once for that person who has the highest maximal weight. the others will be solved as a sub-problem! it only took me 0.028 secs! 
regards
sauro

regards
sauro
- Fri Nov 12, 2010 7:23 am
- Forum: Volume 101 (10100-10199)
- Topic: 10110 - Light, more light
- Replies: 76
- Views: 39738
Re: 10110 - Light, More Light
hello nb2,
first of all, i think you should declare a bigger variable as long isn't sufficient enough to hold an integer of size (2^32-1) . . unsigned long will be enough.
2ndly, you are simulating the whole program where the problem is all about simple math! try checking whether the number is a ...
first of all, i think you should declare a bigger variable as long isn't sufficient enough to hold an integer of size (2^32-1) . . unsigned long will be enough.
2ndly, you are simulating the whole program where the problem is all about simple math! try checking whether the number is a ...
- Tue Aug 31, 2010 12:16 am
- Forum: Volume 5 (500-599)
- Topic: 594 - One Little, Two Little, Three Little Endians
- Replies: 46
- Views: 23261
Re: 594 : about negative number
I don't understand why I keep getting WA in this . . . please someday help me out! :(
[c]
#include <stdio.h>
union
{
long data;
char bit[4];
}x,y;
int main()
{
int i;
while(scanf("%ld",&x.data)==1)
{
for(i=0;i<4;i++)
{
y.bit[3-i]=x.bit[i];
}
printf("%ld converts to %ld\n",x.data,y ...
[c]
#include <stdio.h>
union
{
long data;
char bit[4];
}x,y;
int main()
{
int i;
while(scanf("%ld",&x.data)==1)
{
for(i=0;i<4;i++)
{
y.bit[3-i]=x.bit[i];
}
printf("%ld converts to %ld\n",x.data,y ...