Common Board| Show all threads Hide all threads Show all messages Hide all messages | | 1710 WA5.(+) | Programmer | 1710. Boris, You Are Wrong! | 18 May 2009 13:03 | 2 | I don't know what is this test's but I use some things: 1.Coordinate's shift to (0,0) 2.Checking: Angle(a,c,b)==90 Angle(a,b,c)>=90 Pay Attention to: VectorProduct(ac1,ac)>0, where c - is old C, c1 - new position of C Good Luck. | | Can I meet such expressions in CORRECT pascal program:(+) | Sergey Lazarev (SPb AU) | 1345. HTML | 17 May 2009 18:08 | 2 | 1. #123ident; 2. #123'str'; 3. #123#124; 4. # (without following digits and not as part of {comment} and 'string') 5. 222.not_a_digit; 6. 222.222.222; 7. 222#123; 8. 222'str'; 9. ident#123; 10. ident'str'; I didn't consider these expressions in my program and got WA4. AC!!! Sergey Lazarev (SPb AU) 17 May 2009 18:08 There can be only №1, №2, №3 and №5 (only as [1..11]). Edited by author 17.05.2009 21:31 | | No subject | KALO | 1061. Buffer Manager | 17 May 2009 16:36 | 1 | Edited by author 17.05.2009 16:56 | | Strange! why crash 1 ?????!!!!!!!! | lhmhl | 1408. Polynomial Multiplication | 17 May 2009 14:37 | 1 | type fu1=array['a'..'z'] of longint; su=record a:fu1; zf:integer; x:longint; end; kk1=array[1..1000] of su; var a,b,c:kk1; d:su; i,j,k,l,x,y,n,m:longint; s:string; g:boolean; ch:char; function jun(g:boolean):integer; begin if g then exit(1) else exit(-1); end; procedure doit(var a:kk1; var n:longint); var g:boolean; c:char; num:string; nu:longint; begin readln(s); num:=''; for i:=1 to length(s) do if s[i]<>' ' then num:=num+s[i]; s:=''; for i:=1 to length(num) do begin if num[i] in[ '+','-'] then begin if i<>1 then s:=s+' '+num[i]+' ' else s:=s+num[i]; end else begin s:=s+num[i]; end; end; g:=true; if s[1] in ['+','-'] then begin if s='-' then g:=false; delete(s,1,1); end; repeat i:=pos(' ',s); l:=length(s); if i=0 then i:=l+1; d.zf:=jun(g); d.x:=d.zf; fillchar(d.a,sizeof(d.a),0); if s[1] in ['0'..'9'] then begin num:=''; while (s[1] in ['0'..'9']) and (length(s)<>0) do begin num:=num+s[1]; delete(s,1,1); end; if s[1]<>' ' then delete(s,1,1); val(num,j,nu); d.x:=j*d.zf; i:=pos(' ',s); l:=length(s); if i=0 then i:=l+1; end; if d.x=0 then begin delete(s,1,i-1); g:=s[2]='+'; delete(s,1,3); continue; end; if s[1]=' ' then begin inc(n); a[n]:=d; g:=s[2]='+'; delete(s,1,3); continue; end; if length(s)=0 then begin inc(n); a[n]:=d; break; end; k:=1; j:=1; while j<=i do begin c:=s[j]; k:=1; if (j>=i) then inc(j,2) else begin if s[j+1]='^' then begin inc(j,2); num:=''; while s[j] in ['0'..'9'] do begin num:=num+s[j]; inc(j); if (j>i) or (j=l+1) then break; end; inc(j); val(num,k,nu); end else inc(j,2); end; d.a[c]:=d.a[c]+k; end; delete(s,1,i-1); if i<>l+1 then begin g:=s[2]='+'; delete(s,1,3); end; inc(n); a[n]:=d; until i=l+1; end; function jia(a,b:su):su; var i:longint; c:char; begin a.x:=a.x*b.x; for c:='a' to 'z' do a.a[c]:=a.a[c]+b.a[c]; exit(a); end; function ok(a,b:su):boolean; var c:char; begin for c:='a' to 'z' do begin if a.a[c]<>b.a[c] then exit(false); end; exit(true); end; function bijiao1(a,b:su):boolean; var c:char; i,x,y:longint; begin i:=2; x:=0; y:=0; for c:='a' to 'z' do begin x:=x+a.a[c]; y:=y+b.a[c]; if (i=2) then begin if a.a[c]>=b.a[c] then begin if a.a[c]>b.a[c] then i:=1 end else i:=0; end; end; if (x<y) or ((i=0) and(x=y) ) then exit(true) else exit(false); end; begin { fillchar(a,sizeof(a),0); fillchar(b,sizeof(b),0); fillchar(c,sizeof(c),0); } n:=0; m:=0; doit(a,n); doit(b,m); k:=0; for i:=1 to n do begin for j:=1 to m do begin d:=jia(a[i],b[j]); g:=true; for x:=1 to k do begin if ok(c[x],d) then begin c[x].x:=c[x].x+d.x; g:=false; break; end; end; if g then begin inc(k); c[k]:=d; end; end; end; for i:=1 to k-1 do for j:=i+1 to k do begin if bijiao1(c[i],c[j]) then begin d:=c[i]; c[i]:=c[j]; c[j]:=d; end; end; for i:=1 to k do begin if (c[i].x=0) then continue; if (c[i].x>0) then begin if i<>1 then write('+'); if i<>1 then write(' '); end else begin write('-'); if i<>1 then write(' '); end; c[i].x:=abs(c[i].x); g:=true; if c[i].x<>1 then write(c[i].x); for ch:='a' to 'z' do begin if c[i].a[ch]=0 then continue; if (c[i].x<>1) or (g=false) then write('*'); g:=false; write(ch); if c[i].a[ch]<>1 then write('^',c[i].a[ch]); end; if g and (c[i].x=1) then write(1); if i<>k then write(' '); end; end. i think there's no problem with mine Edited by author 17.05.2009 14:38 | | WA#3 | seeeeei | 1055. Combinations | 17 May 2009 11:55 | 1 | WA#3 seeeeei 17 May 2009 11:55 | | Help me | jhon | 1706. Cipher Message 2 | 17 May 2009 05:01 | 1 | please give me information of the test 2 of this problem. | | deleted | airibo | 1018. Binary Apple Tree | 16 May 2009 11:50 | 1 | Edited by author 09.11.2010 02:50 | | I got TLE on Test9. help | airibo | 1018. Binary Apple Tree | 15 May 2009 20:51 | 1 | Edited by author 09.11.2010 02:49 | | WA #17 1011 | Javier | | 15 May 2009 16:32 | 1 | Getting wrong answer. Can anybody post it, please!? | | AC........ | Зане(Нан) | 1019. Line Painting | 15 May 2009 11:11 | 1 | | | WA 7, does the result fit in int(32 bits)? | Jurca Razvan | 1276. Train | 14 May 2009 23:25 | 2 | No, you should use 64 bit type. | | Some help to ... | Oleg Strekalovsky [Retired] | 1201. Which Day Is It? | 14 May 2009 20:02 | 1 | I solved this problem using: Calendar calendar = new GregorianCalendar(year,month-1,1) It helped me to get position of the first day of month and day's count at month. Pay attention to: 1)Day's count in month. 2)Use trim() to remove ending spaces. | | Question about length of N(+) | Snetch | 1406. Next Number | 14 May 2009 11:47 | 2 | How can N be 2000 digits long if N is less than 10^1000, which has only 1001 digit? P.S. I didn't notice it was new year by server time, I am in America, here it's still December 31))) Happy new year))) Edited by author 01.01.2008 01:13 like:0000000....0000000000 | | Help please :) | Zhanibek DATBAYEV | 1003. Parity | 14 May 2009 11:01 | 2 | Can anyone say something more than just disjoint sets or dfs? Edited by author 07.05.2009 09:42 oh, come on guys! don't be so shy... I'm still waiting :) | | Helo for OLE please | zayhero | 1542. Autocompletion | 14 May 2009 07:42 | 1 | I got OLE in #10, and I also use an AC solution to check my code, but I can not find out any mistake, could somebody tell me what will lead to OLE in #10 instead of #1 ? | | I do not understand | Loky_Yuri [USTU Frogs] | 1494. Monobilliards | 13 May 2009 22:39 | 2 | I do not understand one thing. In the task said that “inspector … took out from the table's pocket the LAST of the pocketed balls”. And about test 3-1-2 in the hint said that “Chichikov could pocket the balls in any order excepting the right one 1-2-3”. But how can we get the 1-3-2? Only if Chichikov pocketed balls 1, 3 and inspector took BOTH bolls (in one moment) and then took the last ball - 2. What’s wrong? Inspector doesn't come only once, he comes several times So in 1-3-2 the inspector came after Chichikov pocketed 1 ball, and then came again after Chichikov pocketed third ball. So first inspector took 1 ball out, then 3 ball, and then 2 :) Edited by author 13.05.2009 23:27 | | What does "Crash(acces violation)" mean? | Angelwarrior | 1494. Monobilliards | 13 May 2009 21:09 | 1 | ok, found it out ;) Edited by author 13.05.2009 23:27 | | Question about test case | Slobodan | 1652. Banking Crisis | 13 May 2009 19:40 | 4 | I am not sure from the problem statement, actually I don't get something. Suppose that we have this test case 5 1 20 1 0 2 0 3 20 3 0 2 1 5 10 3 2 25 Is answer = 2 for this test case? 4 buy debt from 5 to 1 and now 1 have 30 or it still has 20? If it has 30, then it can buy debt from 2 to 3. If this is wrong, can tell me what is the solution to this test case, please? Thanks. banks may not use the funds they receive after selling their debts Thanks. I misread that part. But, there is still a question: 5 1 100000 1 10 1 0 1 0 2 0 2 1 3 10 5 4 1000 If 2 buy debt from 3 to 1, then it will become responsible and 1 can buy debt from 4 to 5 and become responsible again. Will 1 do that for 2? Is answer here 2 or 1? Thanks. The answer is 2 for that test. | | Please add these tests | LSBG | 1045. Funny Game | 13 May 2009 14:17 | 6 | Hello! My solution got accepted, but now as I thought it through it is wrong. Here are some tests that will fail me: Test 1: 6 3 1 2 2 3 4 5 5 6 6 3 Answer: First player wins flying to airport 6 Test 2: 15 12 1 2 2 3 4 5 5 6 6 3 3 11 7 8 8 9 9 10 10 11 11 12 13 12 14 13 15 14 Answer: First player wins flying to airport 11 Edited by author 09.05.2009 13:47 New tests were added and the problem was rejudged. If you have more good tests send them to timus_support (at)acm.timus.ru did you add some new test? give please - i got WA i've passed these testss but wa#15 after rejudgement... *confused* What failed my solution was that it didn't find the airport with a minimal number (try this: 3 1 1 3 1 2 Answer: First player wins flying to airport 2 ), it's kind of strange that there weren't such tests before | | No subject | Mihran Muradyan (Fizmat) | 1020. Rope | 13 May 2009 09:41 | 2 | No subject Mihran Muradyan (Fizmat) 6 May 2009 17:33 I know the formula, but something is going wrong during the 3 test. Hi, Make sure you read the radius as a double / floating point number and not as an integer and use PI as Math.Acos(-1.0). |
|
|