Show all threads Hide all threads Show all messages Hide all messages |
WA #5, HELP ME PLEASE! ! ! ! | zhiganov_v | 1351. Good Gnusmas – Dead Gnusmas | 28 Dec 2020 22:49 | 1 |
i have got WA on test #5. Help me please. Thanks |
So nice story | Mahilewets | 1351. Good Gnusmas – Dead Gnusmas | 10 May 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. |
Why WA on #4 ??? Please help! | hey, dude! | 1351. Good Gnusmas – Dead Gnusmas | 19 Feb 2016 07:17 | 12 |
const e = 1e-8; o = 50000; var i,n : longint; d,x1,y1,x2,y2,x,y : extended; procedure vvod; begin {assign(input,'1.txt'); reset(input);} read(d,x1,y1,x2,y2,n); x1 := x1*o; y1 := y1*o; x2 := x2*o; y2 := y2*o; end; function kill(x,y : extended) : boolean; begin kill := false; if ((x*y1-x1*y)*(x*y2-x2*y) < 0) and (sqrt(x*x+y*y)-d < e) then kill := true; if (abs(x*y1-x1*y) < e) and (abs(sqrt(x*x+y*y)+sqrt(sqr(x1-x)+sqr(y1-y))-sqrt(x1*x1+y1*y1)) < e) and (sqrt(x*x+y*y)-d < e) then kill := true; if (abs(x*y2-x2*y) < e) and (abs(sqrt(x*x+y*y)+sqrt(sqr(x2-x)+sqr(y2-y))-sqrt(x2*x2+y2*y2)) < e) and (sqrt(x*x+y*y)-d < e) then kill := true; end; procedure find; begin for i := 1 to n do begin read(x,y); if kill(x,y) then writeln('YES') else writeln('NO'); end; end; procedure vivod; begin {NOTHING} end; begin vvod; find; vivod; end. I do not Why but I have WA in #4 test to. I think i have WA when gnumus in 4 chetvert and avtomat can fire in 1 chetvert. how did you managed it? I have WA #4 too... I do not understand why I have WA on #4. Please, who get AC, give me some tests!!! Edited by author 24.03.2005 15:12 First my solution gives WA on such test : 5 1 0 0 1 1 -1 -1 My prog said that bibr kill gnusmus... Then I understood that my solution was wrong and wrote a new one. Now I check : 1) if we go from first vector (right frontier of fire) to vector of gnusmus and to left frontier in counterclockwise order. 2) if we go from second vector (left frontier of fire) to vector of gnusmus and to right frontier in clockwise order. If this two things are true then gnusmus is in the sector of fire => writeln('YES') That is all :-). Here is a code : [code deleted] Edited by moderator 03.12.2019 21:37 I think your solution won't work for the test: 1000 0 5 5 0 1 -1 1 It should be: YES [your x1*y2-x2*y1 = -25 which makes b1 = false.] I'm afraid this test is illegal The angle of fire arc in your test is 270 degrees, while the prob states it doesn't exceed 180 degress. Also recommend to try this one 5 0 -5 0 5 1 1 -1 ---input 2 -30000 -1 30000 0 8 -1 0 -1 1 0 1 1 1 1 0 1 -1 0 -1 -1 -1 ---output NO NO NO NO YES YES YES YES My output is same. But I have WA#1 (>_<) |
hint | [RISE] Levon Oganesyan [RAU] | 1351. Good Gnusmas – Dead Gnusmas | 8 Oct 2014 01:08 | 1 |
hint [RISE] Levon Oganesyan [RAU] 8 Oct 2014 01:08 You can solve this problem in integers, without any angles. |
Hard tests | ValentinPerm | 1351. Good Gnusmas – Dead Gnusmas | 8 Oct 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. Good Gnusmas – Dead Gnusmas | 12 Jan 2014 11:55 | 2 |
hint BaJIuK 14 Jan 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. |
WA#9 | RASTA | 1351. Good Gnusmas – Dead Gnusmas | 14 Nov 2012 21:27 | 5 |
WA#9 RASTA 18 Mar 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 Nov 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 |
Why WA10 plz | Dembel {AESC USU} | 1351. Good Gnusmas – Dead Gnusmas | 15 Feb 2011 20:22 | 3 |
If you use Real types of variables, replace it by Extended. in 10th test x1=y1 and x2=y2 |
Big letters | Lord | 1351. Good Gnusmas – Dead Gnusmas | 31 May 2009 20:35 | 1 |
Hahaha I got WA#1 so many times just because i didn't notice that letters should be big)))) |
WA#1 ! Please help, I can't understand it ?? | FireHeart | 1351. Good Gnusmas – Dead Gnusmas | 7 May 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. |
Slightly wrong tests | Fyodor Menshikov | 1351. Good Gnusmas – Dead Gnusmas | 22 Jan 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 Jan 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. Good Gnusmas – Dead Gnusmas | 20 Jan 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 |
Weak tests | Fyodor Menshikov | 1351. Good Gnusmas – Dead Gnusmas | 12 Jan 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 |
Correct statement please | Fyodor Menshikov | 1351. Good Gnusmas – Dead Gnusmas | 12 Jan 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". |
Mistakes in statement | Fyodor Menshikov | 1351. Good Gnusmas – Dead Gnusmas | 12 Jan 2009 01:39 | 2 |
"расстояние от домика боба" -> "расстояние от домика Боба" and please synchronize пулемет Какашникова Kalashnikov machine gun (3rd letter :-)) |
clarification | Spooky | 1351. Good Gnusmas – Dead Gnusmas | 20 Oct 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?.. |
why does it work in pascal and not in c ???? (source) | radio | 1351. Good Gnusmas – Dead Gnusmas | 21 Apr 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. Good Gnusmas – Dead Gnusmas | 10 Feb 2008 04:56 | 1 |
WA #9 denton 10 Feb 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. Good Gnusmas – Dead Gnusmas | 13 Mar 2007 10:51 | 2 |
Edited by author 13.03.2007 10:53 |
Test №8 | vano_B1 | 1351. Good Gnusmas – Dead Gnusmas | 10 Jan 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 Jan 2006 04:16 Thanks, this helped a lot. |