Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
wa 2 | 👑TIMOFEY👑 | 1258. Бильярд | 2 ноя 2022 13:41 | 1 |
wa 2 👑TIMOFEY👑 2 ноя 2022 13:41 dont add negative numbers to answer |
Test 4 C# HELP PLEASE! | Mokhova Anastasiya | 1258. Бильярд | 22 мар 2022 22:30 | 1 |
The C# solution fails test #4. Error: Runtime error (access violation). But in C++, exactly the same solution passed. Does test 4 in this problem contain correct data? |
Test 4 Wrong answer | Groote | 1258. Бильярд | 12 сен 2018 10:00 | 1 |
Please Help. Is it possible to know the contents of test 4 Fyodor Menshiko, what means "Contains empty sequence."? Edited by author 12.09.2018 10:02 |
AC.some hint: | Neumann | 1258. Бильярд | 21 июл 2018 14:38 | 3 |
think the four edges as four mirror...... :) Just compute total chanhe in X and Y and then output hypotenuse. It can be shown pretty intuitively by reflecting triangles, thanks for the hint. |
is X of the first touch equals 6.8182? | esbybb | 1258. Бильярд | 28 ноя 2016 04:39 | 1 |
|
Test 4 | Fyodor Menshikov | 1258. Бильярд | 7 янв 2015 04:05 | 2 |
Test 4 Fyodor Menshikov 5 мар 2010 00:17 |
I had WA on test #2. Why did it happened? Help me, please. | $T.MAX | 1258. Бильярд | 24 апр 2011 04:56 | 4 |
Here's my code: (I looked for the walls like as mirrors) {H+}{N+} .Program N1258; . .var . w,d :integer; . x1,x0,y1,y0 :integer; . way :string; . leng :integer; . BF,LR :integer; . hor,ver :integer; . i,j :integer; . lastBF,lastLR,firstBF,firstLR :char; . Lx,Ly,Lzag :extended; . .BEGIN . readln(w,d); . If (w=0)or(d=0)then . begin . writeln('0.0000'); . Halt; . End; . {initialisation} . readln(x0,y0); . readln(x1,y1); . readln(way); . If way='' then . Begin . writeln((sqrt(sqr(x0-x1)+sqr(y0-y1))):0:4); . Halt; . End; . Leng:=length(way); . firstBF:='0'; . firstLR:='0'; . {finding last and first of B and F} . {finding number of B and F} . For i:=1 to leng do . If (way[i]='B')or(way[i]='F')then . Begin . lastBF:=way[i]; . IF firstBF='0' then . firstBF:=way[i]; . inc(BF); . End; . {finding last and first of L and R} . {finding number of L and R} . For i:=1 to leng do . If (way[i]='L')or(way[i]='R')then . Begin . lastLR:=way[i]; . IF firstLR='0' then . firstLR:=way[i]; . inc(LR); . End; . {finding length of route} . IF firstBF='B' then . Ly:=d-y0 . else Ly:=y0; . IF firstLR='L' then . Lx:=x0 . else Lx:=w-x0; . IF lastBF='B' then . Ly:=Ly+d-y1 . else Ly:=Ly+y1; . IF lastLR='L' then . Lx:=Lx+x1 . else Lx:=Lx+w-x1; . Lx:=Lx+w*(LR-1); . Ly:=Ly+d*(BF-1); . Lzag:=sqrt(Lx*Lx+Ly*Ly); . Writeln(Lzag:0:4); .END. PS. Ican't see the difference between AC code from forum. Edited by author 20.08.2005 02:34 It's not so simple as you think, but simple in real. Try this test 4 6 2 1 2 5 R --- Your answer is 4.0000, but write answer is 5.6569 Thanke you, Ozone, you realy helped me! |
Is the size of char array <= 1000? | 72VanVector[SevNTU] | 1258. Бильярд | 27 окт 2010 05:08 | 1 |
I've got AC already. I had WA on 11th test first, but then i changed the size of char array from 1000 to 1001... That changed ny WA on AC!! Guess, the true size of array is 1001 in 11th test case. Can post my solution... |
Help me please! | Saturn | 1258. Бильярд | 27 окт 2010 04:31 | 3 |
Can you give me some test my program got WA 5 6 3 1 1 5 RB --- ANS: 8.4853 |
ADMINS!!! WRONG LIMITS | Tural Neymanov | 1258. Бильярд | 5 авг 2008 00:13 | 2 |
(0<=W,D<=1000) (0<x0<W, 0<y0<D) (0<x1<W, 0<y1<D) if w and d are 0 then no x or y can be taken. |
Very Week testdate | caoqinxiang | 1258. Бильярд | 15 мар 2008 11:35 | 2 |
In fact this problem need high-accuracy calculating. For example 10 10 1 1 9 9 LRLRLRLRLRLRLRLRLR.... Re: (+) Sandro (USU) 15 мар 2008 11:35 And what is the answer for this test? Why do we need high-accuracy calculating? |
I kill you, Test 12!!!!!! | DAVE | 1258. Бильярд | 16 янв 2008 19:59 | 2 |
#include <stdio.h> #include <math.h> #include <string.h> int X1,Y1,X2,Y2,W,D,X,Y; double P; int l,r,f,b,first_l,first_f,last_l,last_f,N; char c[10010]; int main() { int i; scanf("%d %d %d %d %d %d",&W,&D,&X1,&Y1,&X2,&Y2); scanf("%s",c); N=strlen(c); for (i=0; i<N; ++i) { if (c[i]=='L') { first_l=1; break; } if (c[i]=='R') { first_l=0; break; } } for (i=0; i<N; ++i) { if (c[i]=='L') last_l=1; if (c[i]=='R') last_l=0; } for (i=0; i<N; ++i) { if (c[i]=='F') { first_f=1; break; } if (c[i]=='B') { first_f=0; break; } } for (i=0; i<N; ++i) { if (c[i]=='F') last_f=1; if (c[i]=='B') last_f=0; } for (i=0; i<N; ++i) { if ((c[i]=='L') || (c[i]=='R')) l++; if ((c[i]=='F') || (c[i]=='B')) f++; } if (l>0) { X=(l-1)*W; if (first_l==1) X+=X1; else X+=W-X1; if (last_l==1) X+=X2; else X+=W-X2; } else X=X1-X2; if (f>0) { Y=(f-1)*D; if (first_f==1) Y+=Y1; else Y+=D-Y1; if (last_f==1) Y+=Y2; else Y+=D-Y2; } else Y=Y1-Y2; P=sqrt((double)X*X+Y*Y); printf("%.4lf",P); return 0; } I think problem is this: P=sqrt((double)X*X+Y*Y); In 12th test 'int' will oveflow during multiplication. Just think of __int64. |
this is really shitty....this program compiles just fine with gcc3.2 why do I get CE | Fechete Dan Ionut[dany] | 1258. Бильярд | 3 окт 2004 23:16 | 2 |
#include <stdio.h> #include <math.h> int i,j,n,m,k; int w,d; int main() { int x0,y0,x1,y1; scanf ("%d%d%d%d%d%d",&w,&d,&x0,&y0,&x1,&y1); char c[10000]; scanf ("%s",c); for (i=0;c[i];i++) { if (c[i]=='F') y0=-y0; if (c[i]=='L') x0=-x0; if (c[i]=='B') y0=d+d-y0; if (c[i]=='R') x0=w+w-x0; } double dist=sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1)); printf ("%.4lf\n",dist); return 0; } You must replace sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1)); with sqrt((double)((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1))); |
it is a good problem. | Zhang Ran | 1258. Бильярд | 25 авг 2004 22:37 | 5 |
Edited by author 25.08.2004 22:02 |
I think this problem is simple but I got WA#14 | Saturn | 1258. Бильярд | 8 июл 2004 00:07 | 2 |
I think this problem is simple but I got WA#14. var w,d:real; l:real; lx,ly,x0,y0,x1,y1:real; ch:char; begin readln(w,d); readln(x0,y0); readln(x1,y1); lx:=x0-x1; ly:=y0-y1; while not eof do begin read(ch); case upcase(ch) of 'L':lx:=lx+2*x1; 'R':lx:=lx+2*(w-x1); 'F':ly:=ly+2*y1; 'B':ly:=ly+2*(d-y1); end; end; l:=sqrt(lx*lx+ly*ly); write(l:0:4); end. Oh AC now! Very stupid bug:) |
Help me | Saturn | 1258. Бильярд | 26 июн 2004 13:14 | 1 |
Can you give me some test my program got WA |
Please help!!! I got WA on test 19 (1258) | Saturn | 1258. Бильярд | 21 июн 2004 14:54 | 1 |
I can't believe that my program WA19. Can you give me some test? Thanks |
The Speed... | Abysscope | 1258. Бильярд | 25 май 2004 16:15 | 1 |
Where is the speed of Vasechcin? Is It very important? |
Not speed... | Abysscope | 1258. Бильярд | 25 май 2004 15:19 | 1 |
the Speed of Vasechkin is fixed in the text. But it is not given in the condition of task. help me...
|