[algogeeks] Re: DP equation for interval problem

2013-02-28 Thread marti
Please reply ...what changes? On Thursday, January 24, 2013 1:35:38 PM UTC+5:30, emmy wrote: please help me with the following problem: http://www.spoj.com/problems/JUICE/ bit mask will require very large memory. If I sort the intervals in decreasing order of their start time.. I still

Re: [algogeeks] Re: DP equation for interval problem

2013-02-28 Thread foram lakhani
in the sorted array, if suppose fr[i].start==fr[i+1].start then u only consider a cut at f[i+1] (that means ith fruit is also cut with the (i+1)th fruit. Thus u keep on incrementing the sorted array until u find sm j s.t. f[j].start!=f[j+1].start Then u check for the condition :

[algogeeks] help with o/p why 0 comes???

2013-02-28 Thread Shubham Sandeep
code snippet: *int main() { printf (%d\n,(float)((int)(3.5/2))); return 0; }* -- Regards, SHUBHAM SANDEEP IT 3rd yr. NIT ALD. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it,

Re: [algogeeks] help with o/p why 0 comes???

2013-02-28 Thread gmagog...@gmail.com
I think this is because of type mismatch. You are enforcing your program to read a floating point number in the way of reading a integer. And they have totally different format. If you have -Wall turned on, you should see a warning. Yanan Cao On Thu, Feb 28, 2013 at 1:41 PM, Shubham Sandeep

Re: [algogeeks] help with o/p why 0 comes???

2013-02-28 Thread Shubham Sandeep
thank you for pointing out that format was the key point. On Fri, Mar 1, 2013 at 1:19 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: I think this is because of type mismatch. You are enforcing your program to read a floating point number in the way of reading a integer. And they have

Re: [algogeeks] help with o/p why 0 comes???

2013-02-28 Thread Karthikeyan V.B
O/p will not be 0. 1.00 is the result which when read as %d takes the decimal value of float 1.00 stored in memory - it will not be 1.00 or 0. Since float is not stored as direct binary in memory as integer is stored, instead there's a separate procedure for storing float as binary