Show all threads Hide all threads Show all messages Hide all messages | WA #5 | Kropt | 1444. Elephpotamus | 13 Mar 2024 11:13 | 1 | WA #5 Kropt 13 Mar 2024 11:13 | #WA 8. Reasons. | vtalgo17_EN | 1444. Elephpotamus | 26 Mar 2022 17:25 | 2 | Please, give me some test! Or, may be, give some advices about this test. if you are dividing something by something, make sure to account for the case where, due to precision double,dividing of two different points gives the same result | WA#25 | petr | 1444. Elephpotamus | 7 May 2020 02:41 | 2 | WA#25 petr 12 May 2014 01:53 I can not make tests for which the program gives an incorrect result. Help please My program failed at WA#25 because my 'getAngle' function returned negative results instead of [0; 360), so try to check your sorting code | plot | ASK | 1444. Elephpotamus | 8 Apr 2018 22:13 | 1 | plot ASK 8 Apr 2018 22:13 if your program is /tmp/a.out and the input is /tmp/in, you can use the following Python 3 script to plot your output: from matplotlib.pyplot import * import subprocess f = open('/tmp/in') n = int(f.readline()) p = [[int(i) for i in l.split()] for l in f] print(p) out = subprocess.run('/tmp/a.out < /tmp/in', stdout=subprocess.PIPE, shell=True).stdout.decode().strip() res = [int(s) for s in out.split('\n')[1:]] print(res) plot([v[0] for v in p],[v[1] for v in p],'ro') plot([p[i-1][0] for i in res], [p[i-1][1] for i in res],'b-') axis('equal'); grid(); show() | TO ADMINS | † SiriuS † | 1444. Elephpotamus | 18 Dec 2015 20:13 | 1 | My first AC program gets WA on this test: 6 0 0 0 2 1 1 2 2 -1 -1 -2 -2 But I corrected my code :) | WA #8 | Spatarel Dan Constantin | 1444. Elephpotamus | 26 Feb 2013 04:03 | 1 | WA #8 Spatarel Dan Constantin 26 Feb 2013 04:03 I had some trouble passing Test #8. It turned out that if I used Epsilon = 1e-8 to compare the angles, it worked. Also, here is a tricky test, with lots of points on the same line: Input: 10 0 0 1 1 2 2 3 3 4 4 -1 -1 -2 -2 -3 -3 -4 -4 0 1 One possible solution: 10 1 2 3 4 5 10 6 7 8 9 | WA 2 give me some tests please! | TEST | 1444. Elephpotamus | 22 May 2011 09:54 | 2 | program p1444; uses math; const maxn=30000; var s:array[1..maxn] of record x,y:longint; end; num:array[1..maxn] of longint; t,len:array[1..maxn] of double; n,m,i,j,k:longint; procedure readdata; var i,j,k:longint; begin readln(n); for i:=1 to n do readln(s[i].x,s[i].y); end; procedure swap(var a,b:longint); inline; var temp:longint; begin temp:=a; a:=b; b:=temp; end; procedure sp(var a,b:double); inline; var temp:double; begin temp:=a; a:=b; b:=temp; end; procedure qsort(s,b:longint); var i,j:longint; tx,lenx:double; begin if s>=b then exit; i:=s; j:=b; tx:=t[(i+j) shr 1]; lenx:=len[(i+j) shr 1]; repeat while (t[j]>tx)or( (t[j]=tx)and(len[j]>lenx) ) do dec(j); while (t[i]<tx)or( (t[i]=tx)and(len[i]<lenx) ) do inc(i); if i<=j then begin swap(num[i],num[j]); sp(t[i],t[j]); sp(len[i],len[j]); inc(i); dec(j); end; until i>=j; qsort(s,j); qsort(i,b); end; procedure qsort2(s,b:longint); var i,j:longint; tx,lenx:double; begin if s>=b then exit; i:=s; j:=b; tx:=t[(i+j) shr 1]; lenx:=len[(i+j) shr 1]; repeat while (t[j]<tx)or( (t[j]=tx)and(len[j]>lenx) ) do dec(j); while (t[i]>tx)or( (t[i]=tx)and(len[i]<lenx) ) do inc(i); if i<=j then begin swap(num[i],num[j]); sp(t[i],t[j]); sp(len[i],len[j]); inc(i); dec(j); end; until i>=j; qsort2(s,j); qsort2(i,b); end; procedure solve; var check:boolean; i,j,k:longint; begin for i:=2 to n do begin dec(s[i].x,s[1].x); dec(s[i].y,s[1].y); end; s[1].x:=0; s[1].y:=0; for i:=2 to n do len[i]:=sqrt(sqr(s[i].x)+sqr(s[i].y)); for i:=2 to n do begin t[i]:=arccos(s[i].x/len[i]); if s[i].y<0 then t[i]:=2*pi-t[i]; end; for i:=1 to n do num[i]:=i; check:=false; for i:=2 to n do if (abs(t[i]-pi)>1e-8)and(t[i]<pi)and(0<t[i]) then check:=true; if check then qsort(2,n) else begin for i:=1 to n do if (s[i].x>0)and(t[i]=0) then t[i]:=2*pi; qsort2(2,n); end; writeln(n); for i:=1 to n do writeln(num[i]); end; begin readdata; solve; end. This test helped me: 4 0 0 1 -1 2 0 1 1 answer may be 4 1 2 3 4 or 4 1 4 3 2 | Give some hint plz | yoyo | 1444. Elephpotamus | 6 May 2010 18:11 | 8 | I don't know how could i choose next point. I have some ideas about it: 1. The solution isn't very complexity(maybe it uses sorting) 2. I think, Elephpotamus always can eat all pumpkins 3. And our path should be spin or smth like it. Help plz It's nice and easy problem 1) find the point witch min Y 2) build angles 3) sort angles 4) print answer. What angles should I built? Between (a[1],a[ymin]) and (a[ymin],a[i])? A(Point[i].X, Point[i].Y) B(Ymin.X, Ymin.Y) C(Point[i].X, Ymin.Y) I have <...> as result of doing this task. I think it's terrible. Help me more. I don't know what kind of mistake I have... WA8 is terrible Edited by author 01.04.2006 04:49 If you want I can send my solution! My e-mail: Pio@mail.by I used idea of solution to problem 1173 with some updates: At 1173: "No 3 points on the same straight line" At 1444: "Not all points on the same straight line". Try tests, were some points are on the same straight line. My WA solution breaks on the same tests. | to admins: status = problem locked | Alex Tolstov (Vologda STU) | 1444. Elephpotamus | 30 Mar 2010 03:16 | 2 | Hello! My submit has status "problem locked". What does it mean? This problem is under investigation. When it will be unlocked, your submits will be checked automatically. | Pls, give me some tests... | VALERO | 1444. Elephpotamus | 11 Jan 2008 18:24 | 3 | I think, that my program is right... but WA :( Pls help 5 1 0 0 0 0 -10 0 10 0 100 Answer: 5 1 5 4 2 3 One more test: 14 4 4 3 2 2 2 0 0 1 0 1 2 2 4 5 6 3 6 7 7 7 5 6 2 3 0 5 0 One of possible answers: 14 1 10 11 2 12 14 13 5 4 3 8 6 7 9 |
|
|