First 8 tests all cords are from -1000 to 1000, maybe it can help somebody) use int instead of double Good Luck to clarify: there is no problem to use doubles for computations, but you must input data as ints and convert it to doubles (10x faster), e.g., using D = double; using V = array<D,2>; V rv(){ int x,y; cin >> x >> y; return V{D(x),D(y)}; } Precision exactly 4 digits (not >= 4). I don't understand the sample. Or I should say I don't understand the meaning of the problem... :( First brushstroke has a point of turn in (0, 1), second - in (2, 1), thrid - in (1, -1), fourth - in (2.5, 0.5). Hope, now you will understand. Thank you very much! I've got accepted with this knowledge:) Why can't the third brushstroke be in (1, 1)? In this case the frame will be smaller, won't be? Why can't the third brushstroke be in (1, 1)? In this case the frame will be smaller, won't be? It said, "90 degrees clockwise". And it would have been much harder. =) Edited by author 01.12.2014 08:39begin end point of turn
42 6 -18 -38 34.0000 -46.0000 -8 -16 18 -16 5.0000 -3.0000 -46 40 4 47 -24.5000 68.5000 22 42 -10 45 4.5000 27.5000 -38 -25 -32 -45 -25.0000 -32.0000 1 -36 -20 26 -40.5000 -15.5000 26 -35 24 -31 23.0000 -34.0000 49 3 -1 23 14.0000 -12.0000 34 47 23 21 41.5000 28.5000 -12 -34 36 45 -27.5000 29.5000 -2 31 -44 27 -21.0000 8.0000 -28 -22 39 -10 -0.5000 17.5000 20 0 22 4 19.0000 3.0000 -43 -5 -30 -4 -37.0000 2.0000 -19 -46 -34 -9 -45.0000 -35.0000 -4 -35 2 29 -33.0000 0.0000 36 43 46 -44 84.5000 4.5000 19 -35 -32 -4 -22.0000 -45.0000 24 7 -46 16 -15.5000 -23.5000 13 -10 10 23 -5.0000 5.0000 I have Wa #8 many times, I don't know what's wrong!!! Can anybody check my code or give me a hint? There is my code, I still have WA #8: #include <iostream> #include <cstdio> #include <cmath> using namespace std; int main() { double x1, x2, y1, y2, Right = -1e9, Left = 1e9, Up = -1e9, Down = 1e9; double x3, y3, x0, y0, n, m; int N = 0; while (cin >> x1 >> y1 >> x2 >> y2) { N ++; x0 = (x1 + x2) / 2.0; y0 = (y1 + y2) / 2.0; n = x1 - x0; m = y1 - y0; x3 = m + x0; y3 = -n + y0; Left = min(Left, min(x1, min(x2, x3))); Right = max(Right, max(x1, max(x2, x3))); Up = max(Up, max(y1, max(y2, y3))); Down = min(Down, min(y1, min(y2, y3))); } if (N == 0) printf("%0.4f %0.4f", 0, 0); else printf("%0.4f %0.4f", fabs(Right - Left), fabs(Up - Down)); return 0; } Try empty input. If you use Java - don't use Scanner. His hasNextDouble()/hasNextInt(), nextDouble()/nextInt() are too slow for large input. Use StreamTokenizer. Edited by author 31.10.2010 23:46 Test #14 is the first test where number 10000 appears Edited by author 28.05.2011 00:10 how solve this fucking problem Edited by author 10.09.2005 16:23 I don't know But don't say taboo words!!!!!!!!!!!!!!!!!!!!!! really, it's a fuckin problem!! There are trailing spaces in some lines of input in test 11. Please, check this. Edited by author 25.12.2007 02:47 Please, give me answer, don't ignore my request...(( Now N <= 100000, Time Limit is 1 sec. All tests with trailing spaces are fixed. 1601167 17:42:40 2 апр 2007 PSV 1373 Pascal Accepted 1.968 140 КБ Cool time!!! PS. Be carryfull with rotation and parallel moving vectors - that was my misstakes and firstly I take WA9,WA10,WA7, but as soon as I check misstakes in some formulas - AC as well [code deleted] Edited by moderator 13.02.2007 20:57 while (cin >> x1 >> ... >> ...) { } Thanks! Now I have TLE#17! I used cin.get(...), but it's not helped. Give me this test!!!!Plz!!! There is a strange thing about Test 8. The first code I've written had this function: void update(double x,double y) { if (x<xmin) xmin=x; if (x>xmax) xmax=x; if (y<ymin) ymin=y; if (y>ymax) ymax=y; return ; } And I just called it three times for every line in the input. But I got TLE17, so I tried to rewrite the code and omit this function. But I got WA8. I have changed nothing else, just put a fragment in my code like 'x=bla1; y=bla2;' and copied the body of the function... So, what's the matter about the test? I have problems with test 17. When I use standart min() and max() functions i get TLE, and when I use if (x<xmin) xmin = x; instead I get WA 17 !!! It is really mysterious. I read: ... while not (seekeof) do readln(x1,y1,x2,y2); .... Why WA#1? Please help me or give some me tests. I think it's simple problem, but it WA. Could you help, please. Edited by author 12.12.2005 23:37 Check empty input. (answer should be 0.0000 0.0000) Thank you! Now, of couse, I have AC. i think it's a mistake in test#8...Plese Fix it!!!! |
|