Общий форумHi! I got this verdict: Checker failed #19 Can someone please look into this and fix it? Thank you! DP Dp on tree Look for Word Break Problems If you're struggling with test 11, the test is: 1 0 1000000 -2000 1 Exact (up to 1e-14) answer is 0.00628318530714 If your solution passes this, it will most likely pass all tests :) Thank you! This test helped me a lot. And I've got AC. (I used 'decimal' with 100 digits in Python and Newton-Cotes method with n=8.) I have RE for test # 10. Don't understand why. Check (AB,CD)==0 (orthogonality). Check (AB, CD, DA) ==0 (planarity). Check AD>AC>AB, AC>BC, BD>BC (order). Check whether the projections to XY, YZ, XZ craddle each other continuations. It is sufficient to check only the projections to XY plane to get Accepted verdict. Sounds too complex. If we replace C, D with their orthogonal projection on AB, then all steps except first collapse to only one step (check D = C*a, a > 1). Still too complex, though. Over 20 lines in Python. There should be more simple solution... Edited by author 26.12.2017 04:30 No lengths or projections XY, etc. Using scalar product (sp) and triple product (tp) it is at most five conditions: sp(ab,cd) == 0 and tp(ab,bc,cd) == 0 and # ⟂ and planar sp(ab,bc) >= 0 and # C after B sp(cd,bc) >= 0 and # BC goes in direction of CD sp(cd,bd) >= sp(cd,bc) # D after C And you probably made a mistake. Your 3rd step would make a mistake if intercection is incide AB, incide CD. I am now stuck with 19test and I used some real bulletproof solution, without using float at all. ---------- I do 3rd step buy solving 3x3 matrix and finding t and z, just instead of dividing i only check +or- for i in range(3): if mtrx[i][1]!=0: if ( mtrx[i][0]>=0 and mtrx[i][1]>0 )or( mtrx[i][0]<=0 and mtrx[i][1]<0 ): t=True else: t=False for i in range(3): if mtrx[i][2]!=0: if ( mtrx[i][0]>=0 and mtrx[i][2]>0 )or( mtrx[i][0]<=0 and mtrx[i][2]<0 ): z=True else: z=False return t and z ------------ I start to believe, that it is incorrect test result not my soultion Edited by author 13.04.2026 01:15 Edited by author 13.04.2026 01:15 Edited by author 13.04.2026 01:15 Edited by author 13.04.2026 01:18 Edited by author 13.04.2026 01:50 counterexample 4 0 0 -1 0 0 0 4 0 0 -6 0 It is invalid, but your your order is OK #Finally did it. Now i see why indie games are so bugged def Vect3d(start,end): #int to int return (end[0]-start[0],end[1]-start[1],end[2]-start[2]) def multSc(vecta,vectb):#int to int rslt=0 for i in (0,1,2): rslt+=vecta[i]*vectb[i] return rslt def multVct(va,vb): #int to int x=va[1]*vb[2]-va[2]*vb[1] y=va[2]*vb[0]-va[0]*vb[2] z=va[0]*vb[1]-va[1]*vb[0] return (x,y,z) #vc=t*va+z*vb def TZbool(va,vb,vc): #always int and bool, no division mtrx=[[0,0,0],[0,0,0],[0,0,0]] for i in (0,1,2): mtrx[i][0]=va[i] mtrx[i][1]=vb[i] mtrx[i][2]=vc[i] c1=0 r1=0 while c1<2: if mtrx[r1][c1]!=0: for r2 in (0,1,2): if r2!=r1: for c2 in (0,1,2): if c2!=c1: mtrx[r2][c2]=mtrx[r2][c2]*mtrx[r1][c1]-mtrx[r1][c2]*mtrx[r2][c1] mtrx[r2][c1]=0 c1+=1 r1=(r1+1)%3 ######################### t=False #t>=0 for i in (0,1,2): #only one mtrx[i][0]!=0 in solved 3x2 mtrx if (mtrx[i][0]>0 and mtrx[i][2]>=0) or (mtrx[i][0]<0 and mtrx[i][2]<=0): t=True z=False #z>=0 for i in (0,1,2): if (mtrx[i][1]>0 and mtrx[i][2]>=0) or (mtrx[i][1]<0 and mtrx[i][2]<=0): z=True return t and z A=tuple(map(int,input().split())) B=tuple(map(int,input().split())) C=tuple(map(int,input().split())) D=tuple(map(int,input().split())) goNext=True if goNext: #check if turning 90 AB=Vect3d(A,B) DC=Vect3d(D,C) if multSc(AB,DC)!=0: goNext=False print('Invalid') if goNext: #check if AB and CD intersect AD=Vect3d(A,D) if multSc(AD,multVct(AB,DC))!=0: goNext=False print('Invalid') if goNext: BC=Vect3d(B,C) CD=Vect3d(C,D) # -DC if TZbool(AB,CD,BC): print('Valid') else: print('Invalid') Edited by author 14.04.2026 01:12 98 97 332 3245633 1000000000 > 295201789 98 97 33241 32433 1000000000 > 5930123 98 97 3341 324433 1000000000 > 29622748 2 3 3 4 1000000000 > 916666667 Input: -4 2 2 4 2 2 0 3 -1 0 1 -2 Output: Invalid The text may start with some white spaces. My algo is as follows: 1.for any contestant i: 2. if(there is a contestant j whose three speeds all equal to i ) 3. then i and j are both sure losers; 4. else if(the three speeds of j are no less than i) 5. then i is a sure loser; 6. else if(the three speeds of j are no more than i) 7. then j is a sure loser; 8.for any contestant i: 9. if(i is a sure loser) writeln(No); 10. else writeln(Yes); > My algo is as follows: > 1.for any contestant i: > 2. if(there is a contestant j whose three speeds all equal to i ) > 3. then i and j are both sure losers; > 4. else if(the three speeds of j are no less than i) > 5. then i is a sure loser; > 6. else if(the three speeds of j are no more than i) > 7. then j is a sure loser; > 8.for any contestant i: > 9. if(i is a sure loser) writeln(No); > 10. else writeln(Yes); > 4 10000 10000 1 10000 1 10000 1 10000 10000 2 2 2 the fourth contestant is not a "sure loser" but always lose... The correct answer to this test is: Yes Yes Yes No 3 10 10 10 6 100 17 100 6 17 The correct answer is: No Yes Yes 2 1 2 3 1 2 3 Edited by author 23.01.2010 12:58 No No Because they are tied regardless of what the judge chooses. Can someone who has had problems on this test put a tes the used to figure the problem? Thank you very much Later Edit: This tests helped me: 4 1 1 1 3 1 2 4 1 2 5 2 1 and 3 1 1 1 2 2 2 3 2 2 Edited by author 15.04.2011 02:21 The correct answers are: No No Yes Yes and No No Yes My solution (as well as solutions of some other authors) got AC, but gives incorrect answer for such test case: 3 9999 9999 1 10000 9998 10000 9998 10000 10000 The correct answer is: Yes Yes Yes Please add it to system tests. Edited by author 04.05.2009 00:44 Really, i've got AC with incorrect answer for this test. I used too small infinity (1e10). My solution (as well as solutions of some other authors) got AC, but gives incorrect answer for such test case: 3 9999 9999 1 10000 9998 10000 9998 10000 10000 The correct answer is: Yes Yes Yes Please add it to system tests. Edited by author 04.05.2009 00:44 this test is incorrect ! 9999a + 9999b + 1c > 10000a + 9998b + 10000c 9999a + 9999b + 1c > 9998a + 10000b + 10000c => 19998a+19998b+2c > 19998a+19998b+ 20000c => 2c > 20000c !!!! that why the answer is: No Yes Yes a/9999 + b/9999 + c/1 < a/10000 + b/9998 + c/10000 a/9999 + b/9999 + c/1 < a/9998 + b/10000 + c/10000 a = 9999^4 b = 9999^4 c = 1e-100 I agree with Valentin. We may also choose such a, b and c: a = 9999 b = 9999 c = 1e-9 We get: a/9999 + b/9999 + c/1 = 2 + 1e-9 a/10000 + b/9998 + c/10000 = a/10000 + b/9998 + c/10000 = = 2 * 9999 * 9999 / (9999 * 9999 - 1) + 1e-15 > > 2 + 2 / 9999 * 9999 > 2 + 2e-8 > 2 + 1e-9 So the first contestant can win. The correct answer is: Yes Yes Yes I was getting WA 25 and was failing this test (from the forum): Input: 3 9999 9999 1 10000 9998 10000 9998 10000 10000 Output: Yes Yes Yes I was using Epsion 1e-6 and got WA #25. After changing Epsilon to 1e-9 I got AC. 3 4 0 2000 1000 3000 0 3000 0 0 3000 0 3000 3000 0 3000 ans: 647.1067811865
5 6 0 2000 500 2500 1000 3000 1500 3000 0 3000 0 0 1500 0 3000 0 1500 0 3000 3000 0 3000 ans: 647.1067811865 3 4 0 0 4000 0 2000 4000 0 0 4000 0 4000 4000 0 4000 ans: 3517.7087639997 4 4 0 0 3000 0 3000 3000 0 3000 2000 2000 5000 2000 5000 5000 2000 5000 ans: 940 4 4 0 0 3000 0 3000 3000 0 3000 1000 1000 -2000 1000 -2000 -2000 1000 -2000 ans: 940 4 3 0 0 30000 0 30000 30000 0 30000 10000 40000 40000 10000 40000 40000 ans: 7011.0678118655 4 4 0 0 3000 0 3000 3000 0 3000 -1000 1000 5000 1000 5000 2000 -1000 2000 ans: 1940 4 4 0 0 3000 0 3000 3000 0 3000 -1000 2000 1000 -1000 2000 -1000 -1000 2000 ans: 647.1067811865 3 3 0 0 4000 2000 0 4000 3000 2000 7000 0 7000 4000 ans: 387.2135955000 Also, WA6 = integer overflow The second and eighth tests are invalid. The second test contains a concave polygone. The eighth test contains a repeating vertex. The second test fixed: 3 4 0 2000 1000 3000 0 3000 0 0 3000 0 3000 3000 0 3000 ans: 647.1067811865 The eighth test fixed: 4 3 0 0 3000 0 3000 3000 0 3000 -1000 2000 1000 -1000 2000 -1000 ans: 647.1067811865 I believe there might be some precision issues with the tests. Here is why: My AC solution (ID = 11182582) has a parameter STEPS set to 1000. As I set it higher, the accuracy increases. On this input: 54 46 -161 -82 -150 -33 100 127 -175 My AC program gets: 48.217529 But when I set STEPS to 10000, the improved AC program gets: 38.806852 In addition, I have another program (ID 11182578 - WA #22) outputting: 37.855475851615 I believe test #22 is wrong (as well as my AC solution) while my WA #22 solution is in fact correct. To strenghten that conviction, when I set STEPS to 30000, the improved AC program gets: 38.191302 Thus, the two answers are within a relative error of less than 10^-2. Please look into this issue. Thank you! input : ABCDLKOIKJTFIDCBA ouput is a single letter such as A K and I NOT “ABCD” or what have you . Why is the answer not "ABCD" in this case? YES, why is not ABCD input : ABCDLKOIKJTFIDCBA oh...I see.. Edited by author 17.06.2016 15:54 I think ,cause we need to find a substring,not a subsequence Guys my code returns "A" for that test case, but still WA 12. Any ideas? Edited by author 05.04.2026 05:33 Nvm. Another useful tc could be: "Kbzbkaba". If your sol outputs "aba" it's wrong, it should be "bzb". I passed WA #10 by printing 90 decimals and using custom decimal computations accurate up to 45 digits. What is the test 4? idk i just love chiken wings so much Edited by author 19.11.2025 14:03 I passed WA #4 by printing 15 decimals instead of 6; I got WA #10. This test was failing on my solution. Other similar (symetric) tests could fail other similar (symetric) solutions. Input: 2 1 -999999999 0 -999999999 1 |
|