|
|
вернуться в форумI compared my solution (1114 - "Boxes") for most of all posible tests with Accepted one, but it's still WA. Can anybody give me a hint? Here is my solution: #include <fstream.h> #include <stdio.h> int n,a,b; long double x[21][16][16]; int main() { cin>>n>>a>>b; { for(int ai=0; ai<=a; ai++) for(int bi=0; bi<=b; bi++) x[0][ai][bi] = 1; } for(int in=1; in<=n; in++) for(int ia=0; ia<=a; ia++) for(int ib=0; ib<=b; ib++) { long double xx = 0; for(int ai=0; ai<=ia; ai++) for(int bi=0; bi<=ib; bi++) xx += x[in-1][ia-ai][ib-bi]; x[in][ia][ib] = xx; } /* cout.setf(ios::fixed); cout.precision(0); cout<<x[n][a][b]<<endl;*/ printf("%.0Lf\n",x[n][a][b]); return 0; } Re: I compared my solution (1114 - "Boxes") for most of all posible tests with Accepted one, but it's still WA. Can anybody give me a hint? You cannot accept a solution with long double. I write one by myself, and kept getting WA, even though I tested it with the tests from the Bulgarian competition. It just doesn't work on Timus. You'll have to use bignum :( But I compared my solution for extreme tests (like 20,15,15), and it was the same with AC one. How can it be? > You cannot accept a solution with long double. I write one by myself, > and kept getting WA, even though I tested it with the tests from the > Bulgarian competition. It just doesn't work on Timus. You'll have to > use bignum :( Re: But I compared my solution for extreme tests (like 20,15,15), and it was the same with AC one. How can it be? U probably writing in Borland C++ where long double have 80-bit precision, and timus uses MSVC 6.0 compiler where long double is equal to double and is 64 bit. I had the same problem, and i've post solution in Pascal, later in C++ with long nums. |
|
|