|
|
Show all threads Hide all threads Show all messages Hide all messages | TEST 13 | Mortus | 1666. Vasya Ferrari | 28 Jul 2024 14:25 | 1 | -280 19326 6488 -15295 (x2-156x+115)(x2-124x-133) | What's test 8 case? | OPyshkin | 1666. Vasya Ferrari | 2 Apr 2018 01:41 | 1 | | some tests | Levenets (ONPU) | 1666. Vasya Ferrari | 5 May 2012 02:11 | 5 | 0 -18 0 81 (x-3)(x-3)(x+3)(x+3) 5 10 15 21 (x2+3)(x2+5x+7) 0 6 0 9 (x2+3)(x2+3) 0 -6 0 9 (x2-3)(x2-3) 0 10 0 9 (x2+1)(x2+9) 1 3 2 2 (x2+x+1)(x2+2) 8 22 46 55 (x+5)(x3+3x2+7x+11) -2 -8 -24 -55 (x-5)(x3+3x2+7x+11) 2 -13 -14 24 (x-1)(x+2)(x-3)(x+4) 1 0 1 0 // helps with WA 6 (x)(x3+x2+1) 1 0 -1 0 (x)(x3+x2-1) 1 0 -2 0 (x)(x-1)(x2+2x+2) Re: some tests Maxim Dvoynishnikov (Dnipropetrovsk SU) 2 Jan 2009 16:33 May be there are good tests but they didn't help me with WA13. For 0 -18 0 81 (first test) (x-3)(x+3)(x-3)(x+3) the correct answer? Edited by author 22.01.2010 21:03 Test: 0 0 0 4 answer: (x2+2x+2)(x2-2x+2) | No subject | IgorKoval(from Pskov) | 1666. Vasya Ferrari | 5 May 2012 02:09 | 1 | Edited by author 05.05.2012 02:10 | If you WA at #20 | SerailHydra | 1666. Vasya Ferrari | 28 Apr 2012 14:12 | 2 | Maybe this one will help you: 1 1 1 0 (x)(x+1)(x2+1) It didn't help me. Can anyone say about other test case? | why WA on test case 5 | shankar | 1666. Vasya Ferrari | 24 Apr 2012 13:39 | 2 | hi i dont know why i got WA for 5 test case ... can anyone say about the test case ... Edited by author 30.12.2008 21:50 i've got WA5 too, but all tests in this forum are good PS. I find my mistake: 5 12 15 9 -> (x2+2x+3)(x2+3x+3) But now I have WA19 (( Edited by author 25.04.2012 22:08 | If you have WA #10... | 2rf [Perm School #9] | 1666. Vasya Ferrari | 10 Jul 2010 00:55 | 1 | then check this case: 0 0 0 -4 (in fact any polynomial which can be only factored into two quadratic polynomials and has negative free term will work) Edited by author 10.07.2010 00:58 | Hint: if you have WA#13 or WA#14 | bsu.mmf.team | 1666. Vasya Ferrari | 22 Jan 2010 20:55 | 1 | If you solve this problem with a help of finding roots of the initial polynom, use long long or __int64 type in this function! This fact costed me about 5 submissions... This is the part of my code: long long PolynomValue (vector<int>PolynomCoeffs, int x0) { long long value; ... return value; } int FindRoot (vector<int> PolynomCoeffs) { ... if (!PolynomValue(PolynomCoeffs,a)) return a; ... } If I changed long long to int I would not find a root in several cases. To understand me more clearly try these tests: -20000 19998 20000 -19999 (x-1)(x-1)(x+1)(x-19999) -19998 -20000 20000 -19999 (x-19999)(x3+x2-x+1) -19999 -19999 -19999 -20000 (x+1)(x-20000)(x2+1) I guess 13th and 14th tests are something like these ones. Good luck! Edited by author 22.01.2010 21:07 | why WA on test 14 | Churchill | 1666. Vasya Ferrari | 27 Dec 2008 17:11 | 2 | Could somebody give me a hand? I had WA #14 when forgot to check the case when Polynomial = (Polynomial of 1st degree)*(Polynomial of 3rd degree) | what is test case 6? | demo | 1666. Vasya Ferrari | 23 Dec 2008 13:52 | 5 | I got too many wa on it.. I got WA, too. Can you tell me this case ? Got it. Here is the case that helped me: 9998 -20000 0 0 Result: (x)(x)(x-2)(x+10000) Edited by author 23.12.2008 13:51 #include<iostream.h> int max1(int *x,int *y,int i,int j) { int k,m1=0,r=-1;bool p=true; for(k=i+1;k<=j&&p&&r==-1;k++) if(x[k]>=x[i]) { m1=y[k]; r=k; p=false; } if(r!=-1){ for(k=r;k<=j;k++) if(x[k]>=x[i] && y[k]>=m1) m1=y[k];
return m1+1; } return -1; } int main() { int n,a[1005],i,l[1005],max; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; l[n]=1; if(a[n-1]>a[n]) l[n-1]=1; else l[n-1]=2; for(i=n-2;i>=1;i--) l[i]=max1(a,l,i,n); max=l[1]; for(i=2;i<=n;i++) if(l[i]>max) max=l[i]; cout<<max; return 0; } | What metod who use? | Nurbek_[KTMU MANAS] | 1666. Vasya Ferrari | 21 Dec 2008 09:28 | 2 | Please write what method or algorithm you used. Thanks. if the polynomial can be factorized to the form (x2+mx+n)*(x2+px+q),by expanding it,we can get four equation of coefficients,one of them is nq=d,notice |d|<=20000,we can enumerate its factor and check whether all the equation are meeted.the same to other forms | Multiple orders | partisan | 1666. Vasya Ferrari | 20 Dec 2008 14:08 | 2 | Can we output polynoms in any order? Yes (-) Sandro (USU) 20 Dec 2008 14:08 |
|
|
|