Common Board| Show all threads Hide all threads Show all messages Hide all messages | | very easy q. however i got wa, does anybody now test 32??? | Shabdanbek | 1877. Bicycle Codes | 14 Apr 2012 23:38 | 1 | | | Hint | hoan | 1042. Central Heating | 13 Apr 2012 15:20 | 3 | Hint hoan 14 Dec 2010 23:48 there is only one answer or no answer, therefor if the solution exist it's the shortest. hope can help you. GOOD LUCK!!! Re: Hint Tony Beta Lambda 18 Feb 2012 10:58 No, consider the following case: 3 1 -1 1 -1 1 2 3 -1 both 3 and 1 2 3 are correct answer but 3 is the shortest. Read the description carefully! Your case is wrong because technician 1 and 2 can replace each other! As the condition indicates that these vectors are linear independent, it's likely that there be zero or one solution. | | No subject | TESTER | 1612. Tram Forum | 12 Apr 2012 22:04 | 2 | anyone knows test 6, I have been with this problem for 1 hour test 6 should take account ",.?!-: " | | accepted c | Sunnat | 1370. Magician | 12 Apr 2012 17:54 | 1 | #include<stdio.h> main() { int N,M,a[1000],i; scanf("%i %i",&N,&M); for(i=0;i<N;i++)scanf("%i",&a[i]); for(i=M;i<M+10;i++)printf("%i",a[i%N]); } | | ambiguous problem | waterlaz | 1177. Like Comparisons | 12 Apr 2012 16:35 | 1 | there is a lot of stuff one has to guess in order to get this problem accepted. Anyway, watch out for this test: 'a' like '[a-]' | | What is in test №2? | IgorKoval(from Pskov) | 1875. Angry Birds | 12 Apr 2012 09:43 | 10 | """"It is guaranteed that there is no straight line containing the slingshot and more than one monkey."""" This test is not correct. =) You are right, sorry. Try also 1 1 2 4 3 9 4 16 5 25 Try my test: 1 1 1 2 1 3 1 4 1 5 ans: 5 Test #2 1 5 2 8 3 10 4 8 5 5 ans : 2 1 1 2 4 3 9 4 8 5 5 ans : 3 !!!!!! =) when we draw parabola y = a*x*x+b*x, be careful, this must be: a<0 and b!=0 P.S.: hint: fabs( p[i].y - a*p[i].x*p[i].x - b*p[i].x ) <= 1e-10( don't use p[i].y = a*p[i].x*p[i].x + b*p[i].x ) My solution got AC only on fabs()<=1e-8 fabs()<=1e-9 had WA#26 (!) fabs()<=1e-7 had WA#57 (!!!) I'm Angry very much. To avoid be angry! How verify that big number D==0? You may use next idea: int p[6]={61,67,59,53,41,47}; for(i=1;i<=6;i++) if(D%p[i-1]>0) break; if (i>6) return true; More rightly: We can solve problem 6 times in fields Z(61),...,Z(47) All numbers will be not greater 100, but if in all fields D==0 then in N also D==0. P.S. I appled this idea. I had problems with logics but no problems with precision and 5 -is oldest WA test for me. Edited by author 25.10.2011 13:05 I pass all the tests in the topic and have set the precision but still get WA#14. Last test is not correct, because of point (1,1) and (5,5) belong same line. You are right, sorry. Try also 1 1 2 4 3 9 4 16 5 25 ans: 5 =) Thank you!!! Edited by author 22.10.2011 23:32 | | ATTENTION, JUDGES!! | jedimastex | 1098. Questions | 12 Apr 2012 05:27 | 6 | I wonder if it's true that the first test matches the sample. My program writes 'Yes' just like in the sample. But it gets WA1 ?? Will anyone answer my question? Many people have such problems because they don't skeep symbols #10 and #13. Send me your code (sk1@hotbox.ru) and I'll try to help you. PS: If you have WA #1 it is not a reason to ask for JUDGES' help. I am not asking for judges' help. I just want to know why my program gets WA. It's really annoying to have WA1 without an obvious reason. Thanks in advance. MB you output some additional adta? In this judge the first test isn't necessarily equal to the first example. Some problems only have few large tests. | | WA 30……Help | grayluck | 1393. Average Common Prefix | 12 Apr 2012 01:41 | 2 | I use suffix array to solve this problem...but i've WA 30 many times and don't know why. Can someone give me some hint or tests ? for var 'ans' use __int64 type. and printf( "%.3lf\n", (ans+0.0)/(n-1) ); | | Why TLE on test7? | waterkid | 1269. Obscene Words Filter | 11 Apr 2012 08:28 | 1 | const maxn=100000; var st,en,n,i,j,k,now,tot,m,tmp,o,ans:longint; s:ansistring; r,d,failed,fa,h:array[0..maxn]of longint; w:array[1..maxn,1..2]of longint; target:array[0..maxn]of boolean; function min(x,y:longint):longint; begin if x<y then exit(x) else exit(y); end; begin readln(n); for n:=1 to n do begin readln(s); now:=0; for j:=1 to length(s) do begin i:=r[now]; while i<>0 do begin if w[i,1]=ord(s[j]) then begin now:=i; break; end; i:=w[i,2]; end; if i=0 then begin inc(tot); fa[tot]:=now; w[tot,1]:=ord(s[j]); w[tot,2]:=r[now]; r[now]:=tot; h[tot]:=h[now]+1; now:=tot; end; end; target[now]:=true; end; st:=0; d[1]:=0; en:=1; repeat inc(st); i:=r[d[st]]; while i<>0 do begin inc(en); d[en]:=i; i:=w[i,2]; end; until st=en; for j:=2 to en do begin k:=fa[d[j]]; i:=0; while (i=0)and(k<>0) do begin k:=failed[k]; i:=r[k]; while i<>0 do begin if w[i,1]=w[d[j],1] then break; i:=w[i,2]; end; end; failed[d[j]]:=i; if target[i] then begin if not target[d[j]] then h[d[j]]:=min(h[d[j]],h[i]); target[d[j]]:=target[d[j]] or target[i]; end; end; failed[0]:=-1; readln(m); for m:=1 to m do begin readln(s); ans:=length(s)+1; now:=0; for j:=1 to length(s) do begin k:=now; i:=0; while (i=0)and(k<>-1) do begin i:=r[k]; while i<>0 do begin if w[i,1]=ord(s[j]) then break; i:=w[i,2]; end; if i=0 then k:=failed[k]; end; now:=i; if target[now] then ans:=min(ans,j-h[now]+1); end; if ans<length(s) then break; end; if ans<=length(s) then begin writeln(m,' ',ans); end else writeln('Passed'); end. | | WA#6 | Anton | 1846. GCD 2010 | 11 Apr 2012 08:26 | 3 | WA#6 Anton 24 Feb 2012 06:57 I wonder, what this test case is ... I use SQRT-decompossion and I do not care if the same value already exists: add new value to current sqrt(n) segment, recalc gcd on it and then recalc total gcd among all sqrt(n) segments. When I remove an element from some segment, I recalc gcd on this segment and then recalc total. Please, correct me, if my approach isn't OK. How do you find already existing value ? The way I see is to maintenance every segment in ascending order and then quickly search the target value with binary search and replace is with zero. But what is the best way to keep segment in ascending order after new element has been added ? Hope for feedback ^) Edited by author 28.02.2012 04:41 Edited by author 28.02.2012 04:41 Definitely not STL's map. I tried the same approach as you did except for each of sqrt(n) parts I was keeping a map: number-vector of indices. That gives TL 17 :( I ended up using the segment tree, this might be very helpful: http://codeforces.com/blog/entry/3327 However, I'm still curious about the efficient way for that storage so I created another topic devoted to this :) Edited by author 11.04.2012 08:26 | | Help! | FranckRibery | 1269. Obscene Words Filter | 11 Apr 2012 06:50 | 2 | Help! FranckRibery 30 Jan 2011 19:19 I have used getchar(),but still WA 5#,why?? Or give me the test data... Edited by author 30.01.2011 19:21 I also have a WA on 5#. Have you known why? | | WA#11 | esqo | 1021. Sacrament of the Sum | 11 Apr 2012 02:28 | 1 | WA#11 esqo 11 Apr 2012 02:28 | | I wan to know the key to this problem,who can tell me? | GaoHughes | 1044. Lucky Tickets. Easy! | 10 Apr 2012 20:37 | 3 | I know the meaning of this problem,but I just can't find a good way to solve it!! So who can tell me ? Thank you! I use C++ Edited by author 06.09.2010 20:15 Brute force: you just look through all possible numbers and choose lucky ones You can backtrack for 2, 4, 6, 8 and see what your program's answers are. Then you can simply put the answers. | | my AC solution with 0.015s 220KB | sahand | 1028. Stars | 9 Apr 2012 05:52 | 3 | MY ALGO TIME CONSUMED IS(250+128)*N unit my method is: divide distance between [0,32000] to 128 sector each sector is total of stars that occured in that portion hence for each x, level x calcute of bottom formula level = sector[x/250]+ Xpivot[i] that i=int(x/250)*250 to x in last update value of all sector that indexs greater than this sector index; Nevermind Edited by author 09.04.2012 06:01 | | Why should I got WA2? It seems very easy to solve. | z | 1294. Mars Satellites | 7 Apr 2012 23:45 | 5 | {$N+} Program Mars_satellites; Var cos_,x,a,b,c,d:Double; Begin Readln(a,b,c,d); If (a*b-c*d)=0 Then Begin Write('Impossible'); End Else Begin cos_:=a*a+b*b-c*c-d*d; cos_:=cos_/(2*a*b-2*c*d); x:=a*a+b*b-2*a*b*cos_; x:=sqrt(x); x:=round(1000*x); Write('Distance is ',x:0:0,' km.'); End; End. Hi, your program has two mistakes, first one is (a*b-c*d)=0, equlity cannot be tested with doubles that way, you should use Abs(a*b-c*d)<e instead, where e is very small value, in this case e=0.01 is enough; second mistake is the formula I think, try to solve the math part of this problem again. If you want I can send you my AC program ( or just it's formula ). ...то выведите "Impossible.", иначе... "Impossible{.}" who said the numbers were double? they are small integers... And the formula is very good... | | Test 11 | nbodea | 1083. Factorials!!! | 7 Apr 2012 14:06 | 1 | I don't know what's wrong, but it seems that i get wrong answer on test 11. Do you have any idea what it contains? | | Help with Test data #8 | __Emiapwil__ | 1027. D++ Again | 7 Apr 2012 14:04 | 2 | Hey, everybody! I'd like to ask for a test data of this problem similar to test #8. I've read through the discussions and passed all the test data given in earlier topics but still got stuck at #8. Any help will be appreciated!! Edited by author 07.04.2012 14:05 I've figured out the problem! It seems that I'm not familiar with the 'feof' function's action. In fact earlier discussions mentioned it but since the vim editor appends a newline in the end of my test input file I was unable to notice this. May this be of any help for those who meet the same problem. | | Problem 1085. Встреча | RocBoy-D | | 7 Apr 2012 00:17 | 1 | wa #21. Can anybody help me? Program P1; Var Map: Array[1..100,1..100] of Integer; S,G,F: Array[1..100] of Integer; A,I,B,J,N,M,K,L,P,R: Integer; Begin Readln(N,M); For A:=1 to N do For B:=1 to N do Map[A,B]:=16000; For I:=1 to M do begin Read(L); For J:=1 to L do Read(S[J]); For A:=1 to L do For B:=1 to L do Map[S[A],S[B]]:=1; End; For A:=1 to N do For B:=1 to N do For I:=1 to N do If Map[A,B]>Map[A,I]+Map[I,B] then Map[A,B]:=Map[A,I]+Map[I,B]; Read(K); A:=0; For I:=1 to K do begin Readln(G[I],S[I],F[I]); A:=A+G[I]; End; P:=0; R:=P; For I:=1 to N do begin P:=0; For J:=1 to K do begin If I=S[J] then begin P:=P+G[J]; continue; End; If Map[I,S[J]]=16000 then begin P:=0; Break; End; If (Map[I,S[J]]*4>=G[J]) and (F[J]=0) then begin P:=0; Break; End; If F[J]=1 then begin P:=P+G[J]; Continue; End; P:=P+G[J]-Map[I,S[J]]*4; End; If P>R then begin R:=P; L:=I; End; End; If R<>0 then Writeln(L,' ',A-R) else Writeln(0); End. | | To people who got WA 6 | Prabhjot Singh | 1654. Cipher Message | 5 Apr 2012 22:54 | 4 | try this test case dfadfmmmmfad Correct answer dfadad Hope this helps... Hi, I am getting "fd" as answer as shown below after each removal of duplicate characters. dfadfmmmmfad dfadad dfdd fd Could you please explain where am I wrong?? Thanks in advance. Anupam Why are you removing "a" chars in "dfadad"? You can delete it if chars stays together in the string. | | WA12 | diviator | 1837. Isenbaev's Number | 5 Apr 2012 22:06 | 1 | WA12 diviator 5 Apr 2012 22:06 Could somebody give me 12 test ? Sory for bad my English... |
|
|