in contest my prog with same algo as yours writed in pascal get metrulo17 wrote:(x-1)*(x-2)*(x-3) = x^3-6x^2+11x-6
a + b + c =6
ab+ac+bc= 11
abc=6
it got ac in 1.2 seconds during contest
Time complexity O(n^2)
Space Complexity O(n)
tle 2. sec
now I send it , and get acc with 0:02.830 sec (by the way i only one who
get acc used pascal all other use c/c++, who can get acc on JAVA and with what time?)
1.in how many times pascal slow c/c++ on same algo???
2. piple in top in http://acm.uva.es/cgi-bin/OnlineJudge?P ... :11026:100
1 0:00.365 412 30863 C++ 2006/04/02-13:11:26.707 4469427 (H0)
2 0:00.381 400 53387 C++ 2006/04/01-18:42:29.579 4467376 (H0)
3 0:00.430 4492 33201 C 2006/04/01-18:32:02.999 4467342 (H0)
4 0:00.439 420 26795 C 2006/04/02-07:59:27.140 4468861 (H0)
5 0:00.443 404 30631 C++ 2006/04/01-18:14:31.753
...
less 0.5 seconds
maybe they use some hint's? anybody know?can somebody exlpain why they sol so fast???