Page 2 of 2

Posted: Sat Feb 26, 2005 8:54 am
by Rony
[quote="

Posted: Sun Feb 27, 2005 8:34 am
by Rony
Hi,
Turjo . Thanks . At last i got Acc after 10 WA's . If any one need any help plz mail me.

Regards
Rony(rony15bg@yahoo.com).
[[*Depressed*]]
[/quote]

Re: 10203

Posted: Mon Jun 27, 2005 3:58 pm
by tan_Yui
WR wrote:What's wrong with the following results?

And - if nothings's wrong, why do I get WA?

I've tried int, long and double as co-ordinate types (in C).
My Accepted code outputs same answer as you.

I read all coordinates as double type number, and sum all distances as double type.
After calculate total distance, convert to long type number.
Then,

Code: Select all

    long total;
    double hour, minute;
...
...
...
    total = (long)(calc_distances());   /* convert to long */
    total *= 2;
    hour = (double)(total / 20000);
    total -= 20000 * hour;
    minute = (double)total / (double)20000 * 60;

    if((int)ceil(minute)==60) {
      minute = 0;
      hour += 1;
    }
    printf("%d:", (int)hour);
    if(minute<10) printf("0");
    printf("%d\n", (int)ceil(minute));
There might be a lot of uselessness in this code.

Best regards.

Posted: Sun Aug 28, 2005 10:42 pm
by daveon
Hmmmm... seems like changing hypot() to sqrt() gets you AC.

Posted: Mon Aug 29, 2005 1:36 am
by valar2006

Posted: Wed May 03, 2006 11:37 pm
by kwedeer
I know that these are pretty bad thoughts and offtopic in any case... but what was meant by
official solution from Waterloo
? Does something valuable can be found on web?

Posted: Fri Jul 14, 2006 8:34 pm
by 898989
Please i need a help...
I am sure that i got the right distance but does this output is right

Code: Select all

long double sec = (2*dist*60)/20000.0;
		sec = ceil(sec);
		

		long long minutes = sec  / 60;		
		long long seconds = sec  - minutes*60;

		
		cout<<minutes<<":";
		if(seconds<9)
			cout<<"0";
		cout<<seconds;
		if(cases != 0)
			cout<<"\n\n";
I am sure the problem in converting total seconds to nearest minute