|
|
вернуться в форумWA #3 Sorry, but get tired of it. Are there any suggestions, what checks test #3? Re: WA #3 > each street stretches through the whole city either from west to east or from north to south. Do these directions have any influence? Re: WA #3 I have same problem my code is #include <iostream> #include <math.h> using namespace std; int main() { int x[2],y[2],a[2],b[2]; cin>>x[0]>>x[1]>>y[0]>>y[1]>>a[0]>>a[1]>>b[0]>>b[1]; double e=((y[0]-x[0])*(y[0]-x[0])); double t=((y[1]-x[1])*(y[1]-x[1])); double u=e+t; double qq=sqrt(u); double ww=sqrt(qq); double ee=((b[0]-a[0])*(b[0]-a[0])); double tt=((b[1]-a[1])*(b[1]-a[1])); double uu=ee+tt; double qqq=sqrt(uu); double www=sqrt(qqq); double iga=ceil((www+ww)/2); cout<<iga; return 0; } what to do?help please..... Re: WA #3 Послано Ego 11 апр 2010 18:13 1 1 5 5 2 2 4 4 output should be 4, i think. your program gives 3. Re: WA #3 My algorithms is: make 2 rectangles first with points Dr Dee House and St Paul Cathedral second with points Gallery and Museum next find rectangle which is the intersection of the first 2. the result is width + height of the last rectangle. but still WA on test 3 Re: WA #3 Послано Ego 11 апр 2010 18:36 1 1 5 5 2 4 4 2 output should be 2, i think. your algorythm gives 4 Re: WA #3 yeah, the algorithm is wrong Re: WA #3 I changed it and now WA on test #6 Re: WA #3 Послано Ego 11 апр 2010 19:16 yep. the same. The direction MAKES influnce! 1) 0 0 6 2 0 0 6 2 == 8 2) 0 0 6 2 0 2 6 0 == 6 3) 0 0 2 6 0 6 2 0 == 6 Re: WA #3 thank you. now i understand... Edited by author 12.04.2010 15:34 Edited by author 12.04.2010 15:34 |
|
|