Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 2 |
WA #5, HELP ME PLEASE! ! ! ! | zhiganov_v | 1351. Хороший гнусмас – мёртвый гнусмас | 28 дек 2020 22:49 | 1 |
i have got WA on test #5. Help me please. Thanks |
So nice story | Mahilewets | 1351. Хороший гнусмас – мёртвый гнусмас | 10 май 2017 14:23 | 2 |
[code deleted] My first submit got WA#8, my second WA#9, my third got WA#10 of course. I am going so straight, so incrementally. Maybe author made tests in such an amazing increasing-difficulty way. Edited by moderator 03.12.2019 21:46 I was so stupid not to check the distance in case when arc of fire is zero degrees and gnusmas is on the line. |
Страница 1 |
hint | [RISE] Levon Oganesyan [RAU] | 1351. Хороший гнусмас – мёртвый гнусмас | 8 окт 2014 01:08 | 1 |
hint [RISE] Levon Oganesyan [RAU] 8 окт 2014 01:08 You can solve this problem in integers, without any angles. |
Hard tests | ValentinPerm | 1351. Хороший гнусмас – мёртвый гнусмас | 8 окт 2014 01:06 | 2 |
input#1: 30000 30000 29999 -29999 -30000 12 19999 19996 19999 19997 19999 19998 19999 19999 19999 20000 19999 20001 19999 20002 19999 20003 19998 19996 19998 19997 19998 19998 19998 19999 output#1: YES YES YES NO NO NO NO NO YES YES NO NO input#2: 30000 29999 30000 -30000 -29999 12 19999 19996 19999 19997 19999 19998 19999 19999 19999 20000 19999 20001 19999 20002 19999 20003 19998 19996 19998 19997 19998 19998 19998 19999 ouput#2: NO NO NO NO YES YES YES YES NO NO NO YES |
hint | BaJIuK | 1351. Хороший гнусмас – мёртвый гнусмас | 12 янв 2014 11:55 | 2 |
hint BaJIuK 14 янв 2012 04:02 It's better to count angles like there --> arccos((x1*x2+y1*y2)/(rast(x1,y1)*rast(x2,y2))); Be carefull when cos is ~1. Good luck! This task can be solved without any operations with float values. Just "*", "+" and "compare" operations with Integers. |
Big letters | Lord | 1351. Хороший гнусмас – мёртвый гнусмас | 31 май 2009 20:35 | 1 |
Hahaha I got WA#1 so many times just because i didn't notice that letters should be big)))) |
WA#9 | RASTA | 1351. Хороший гнусмас – мёртвый гнусмас | 14 ноя 2012 21:27 | 5 |
WA#9 RASTA 18 мар 2009 22:19 const eps = 1e-9; var a1, b1, a2, b2, x, y, x1, y1, d, x2, y2: real; i, n: longint; Begin read(d, x1, y1, x2, y2); read(n); a1 := y1; b1 := -x1; a2 := y2; b2 := -x2; for i := 1 to n do begin read(x, y); if (abs(x1 - x2) < eps) and (abs(y1 - y2) < eps) then begin if (abs(a1 * x + b1 * y) < eps) and (x * x + y * y - eps <= d * d) and (abs(sqrt(x * x + y * y) + sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1)) - sqrt(x1 * x1 + y1 * y1)) < eps) then writeln('YES') else writeln('NO') end else if (a1 * x + b1 * y - eps <= 0) and (a2 * x + b2 * y + eps >= 0) and (x * x + y * y - eps <= d * d) then writeln('YES') else writeln('NO'); end; End. I solve this problem with type longint but it makes no difference... try this: 5 1 0 1 0 1 -1 0 corect is NO ...and it is more useful to use Longint instead of real to solve this problem. To compare distances use sqr of distances Re: WA#9 [SPB]Vladimir Kiselev 14 ноя 2012 21:27 This test helped me: 1007 20 25 4 5 1 -16 -20 Answer : NO Edited by author 14.11.2012 21:28 This test helped me 5 0 1 0 1 1 0 1 correct answer: YES |
Slightly wrong tests | Fyodor Menshikov | 1351. Хороший гнусмас – мёртвый гнусмас | 22 янв 2009 18:46 | 5 |
In statement: 1 <= |X1| , |Y1|, |X2|, |Y2| <= 30000 0 <= |Xi|, |Yi| <= 30000 In test 6 there is number with absolute value 30001. This number cannot cause overflow, but it is not good that the test does not correspond to the statement. Re: Fixed (-) Vedernikoff Sergey (HSE: EconomicsForever!) 21 янв 2009 01:53 The term "slightly wrong" sounds funny, especially in sport programming. What if I use hash that relies upon the fact that |X| <= 30000??? Edited by author 21.01.2009 01:53 It would be funny if you use hash in this problem. This is a geometrical problem, the only danger is to exceed int limit. 30001 was definitely not dangerous in this problem. But it hindered defensive programming style of debugging. The code removed after getting AC. Edited by author 25.01.2009 07:03 |
Weak tests | Fyodor Menshikov | 1351. Хороший гнусмас – мёртвый гнусмас | 20 янв 2009 03:28 | 2 |
Test 3: arc of fire is 0 degrees. So arc of fire 0 degrees is pretty legal. But! I know many AC solutions that think that when arc of fire 0 degrees gnusmasses in _opposite_ direction will be killed. Test 100 1 0 1 0 1 -1 0 YES is wrong answer. I suggest to remove test with arc of fire 0 degrees and to write in statement that arc of fire strictly greater than 0. And add to timus problemset problem "Good Gnusmas – Dead Gnusmas. Version 2" without any limitations on size of arc of fire i.e. with limitation [0; 360) degrees. Arc greater than 180 degrees can be defined quite well because we know that first range is left and the second is right. Edited by author 19.01.2009 12:29 Yes, 0 degrees arc is legal in this problem. We added tests with the same idea as your test. Thank you. Edited by author 20.01.2009 03:29 |
Correct statement please | Fyodor Menshikov | 1351. Хороший гнусмас – мёртвый гнусмас | 12 янв 2009 11:31 | 1 |
rus: "координаты точек соответственно на правой и левой границах обстрела." eng: "coordinates of the right and the left bounds of the arc of fire." It is problem from school championship so Russian text is original. Add please word "correspondingly" (or equivalent) in english text. It is _very_ important for some solutions of this problem. Also word "points" would be great because there is no such thing as "coordinates of the bounds". |
Weak tests | Fyodor Menshikov | 1351. Хороший гнусмас – мёртвый гнусмас | 12 янв 2009 16:04 | 2 |
In problem statement: "The arc of fire doesn’t exceed 180 degrees." "Сектор обстрела не превышает 180 градусов." "doesn't excees" is <=, not <. But test set doesn't contain test with arc of fire exactly 180 degrees. Please add test where the arc of fire is 180 degrees. Only solutions that use vectors (and assume that first bound of arc is right and the second is left) will survive it. Solutions that use lines (or do not distinguish left and right bounds) will get wa. Or if you do not want many authors get wa, change the statement: "The arc of fire is strictly less than 180 degrees." "Сектор обстрела строго меньше 180 градусов." Edited by author 11.01.2009 14:29 |
Mistakes in statement | Fyodor Menshikov | 1351. Хороший гнусмас – мёртвый гнусмас | 12 янв 2009 01:39 | 2 |
"расстояние от домика боба" -> "расстояние от домика Боба" and please synchronize пулемет Какашникова Kalashnikov machine gun (3rd letter :-)) |
clarification | Spooky | 1351. Хороший гнусмас – мёртвый гнусмас | 20 окт 2008 21:36 | 1 |
is such a test legal: 5 1 1 1 1 2 1 1 -1 -1 if yes, then what shoud be the answer?.. |
WA#1 ! Please help, I can't understand it ?? | FireHeart | 1351. Хороший гнусмас – мёртвый гнусмас | 7 май 2009 23:04 | 3 |
Here is my code : Const fi='input.txt'; fo='output.txt'; Var Range,a1,b1,a2,b2,x,y,x1,y1,x2,y2:real; n,i,j:integer; f,g:text; {------------------------------------------------------------------------} Begin Assign(f,fi); Reset(f); Assign(g,fo); Rewrite(g); Readln(f,Range,x1,y1,x2,y2); a1:=y1; a2:=y2; b1:=x1*(-1); b2:=x2*(-1); Readln(f,n); for i:=1 to n do Begin Readln(f,x,y); if (sqrt(x*x + y*y)<=Range) then if (x1<>x2) or (y1<>y2) then begin if ((x*a1+y*b1)*(x2*a1+y2*b1)>=0) and ((x*a2+y*b2)*(x1*a2+y1*b2)>=0) then Begin Writeln(g,'YES'); Continue; End; End else if (x1=x2) and (y1=y2) then if (x*a1+y*b1)=0 then Begin Writeln(g,'YES'); Continue; ENd; Writeln(g,'NO'); End; Close(f); Close(g); End. -Nothing- Edited by author 07.05.2009 17:45 Read FAQ! You must use standart Input/Output, not files. |
why does it work in pascal and not in c ???? (source) | radio | 1351. Хороший гнусмас – мёртвый гнусмас | 21 апр 2008 00:43 | 3 |
here's in pascal: my c code: Edited by author 21.04.2008 03:06 because you use writeln('YES') and printf("YES") instead of printf("YES\n"); thank you, hahaha, i feel dumb..... |
WA #9 | denton | 1351. Хороший гнусмас – мёртвый гнусмас | 10 фев 2008 04:56 | 1 |
WA #9 denton 10 фев 2008 04:56 Can anyone please say, what is this test? My program completed all tests from neighbour topics successfully... UPD: rewrote, got AC. Edited by author 05.04.2008 23:36 |
ax+by+c=0 | Shady TKTL | 1351. Хороший гнусмас – мёртвый гнусмас | 13 мар 2007 10:51 | 2 |
Edited by author 13.03.2007 10:53 |
Why WA10 plz | Dembel {AESC USU} | 1351. Хороший гнусмас – мёртвый гнусмас | 15 фев 2011 20:22 | 3 |
If you use Real types of variables, replace it by Extended. in 10th test x1=y1 and x2=y2 |
WHy WA 6 help plz | Tolyan_PP | 1351. Хороший гнусмас – мёртвый гнусмас | 12 июн 2005 02:07 | 4 |
i think you must wright your source code. no wright, write. my mistake ^_^; |
Test №8 | vano_B1 | 1351. Хороший гнусмас – мёртвый гнусмас | 10 янв 2006 04:16 | 2 |
In test №8 {x1,y1} and {x2,y2} sameway vectors. PS I hope, It'll help someone.=) PPS Sorry for my english. Re: Test №8 Maigo Akisame (maigoakisame@yahoo.com.cn) 10 янв 2006 04:16 Thanks, this helped a lot. |