|
|
back to boardHelp! I've got time limit in 5'th test Posted by diduk 29 Mar 2007 22:47 Is it a rational decision? for (i = 1; i < N; i++){ for (j = i+1; j <= N; j++){ tg = fabs((f[j]-f[i]) / (j-i)); if (tg > max){ max = tg; imax = i; jmax = j; } } } printf("%d %d\n", imax, jmax); No. 100000*100000 is too slow. There is a linear solution. (-) |
|
|