10203 - Snow Clearing

All about problems in Volume 102. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Rony
New poster
Posts: 16
Joined: Wed Jun 30, 2004 6:46 am
Location: Dhaka
Contact:

Post by Rony »

[quote="
Rony
New poster
Posts: 16
Joined: Wed Jun 30, 2004 6:46 am
Location: Dhaka
Contact:

Post 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]
tan_Yui
Experienced poster
Posts: 155
Joined: Sat Jul 10, 2004 12:41 am

Re: 10203

Post 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.
daveon
Experienced poster
Posts: 229
Joined: Tue Aug 31, 2004 2:41 am
Location: TORONTO, CANADA

Post by daveon »

Hmmmm... seems like changing hypot() to sqrt() gets you AC.
kwedeer
New poster
Posts: 44
Joined: Thu Dec 15, 2005 11:28 pm

Post 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?
898989
Learning poster
Posts: 83
Joined: Wed Feb 01, 2006 12:59 pm
Location: (Fci-cu) Egypt
Contact:

Post 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
Sleep enough after death, it is the time to work.
Mostafa Saad
Post Reply

Return to “Volume 102 (10200-10299)”