Posted: Sat Feb 26, 2005 8:54 am
[quote="
[/quote]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*]]
My Accepted code outputs same answer as you.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).
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));
? Does something valuable can be found on web?official solution from Waterloo
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";