|
|
вернуться в форумHow this problem can be accepted in 0.001? Послано giorgi 4 сен 2011 21:13 Here is my code which accepted in 0.015, can someone tell me what to optimize else to get it accepted in 0.001?(sorry if my english is not very good) #include <cstdio> #include <cmath> using namespace std; int main() { int V; double a; double K; scanf("%d %Lf %Lf", &V, &a, &K); double s=0; if(a!=0&&a!=90) { double p = a*3.1415926535/180; double Vy = V*sin(p); double Vx = V*cos(p); s = Vx*Vy*0.2/(1-1/K); } printf("%.2f",s); return 0; } Re: How this problem can be accepted in 0.001? May be you can find a formula and count it directly Re: How this problem can be accepted in 0.001? > can someone tell me what to optimize else to get it accepted in 0.001? The fastest possible submit time on the current judge seems to be 0.015, so you're already at the best possible time. In earlier years the fastest time was 0.001. It's impossible to beat or even match the older solutions unless the judge's time measurement system changes. |
|
|