|  | 
|  | 
| back to board | Test # 11. SOS I'm getting f**ing TL on the test 11.I'm using java and solved the problem as it is supposed to be in JAVA. I used objects "standings" which contains id and m( i.e. standing( id, m ) ). I'm using bubble sort since quicksort gives wrong answer.
 Does anyone know how to gid rid of the Time Limit using JAVA? I know JAVA is slowest compiler i've ever seen :-)
 Please, need help
Re: Test # 11. SOS I use JAVA.On #11  TL too......1.015senconds...
 There are some hits:
 1.don't use class,it will use a lot of time.
 2.Using Scanner and PrintWriter can help you input/output
 a little faster.
 3.I use a O(n) method....1.015senconds TL...JAVA is slow
Re: Test # 11. SOS AC!!1.A O(n) method
 2.in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));  //for input
 3.PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));    //for output
 4.out.print(id);
 out.print(" ");
 out.println(m);   //print them one by one for fast output
 
 0.984s  &  8 402 KB    WTF!:)
 
 Edited by author 11.08.2008 02:38
Re: Test # 11. SOS There are only 101 Ms, so you just appear to be a little "stupid"
 
 for(i=100;i>=0;i--){
 for(j=0;j<N;j++)
 if(stu[j].M == i)
 printf("%d %d\n", stu[j].ID, stu[j].M);
 }
 | 
 | 
|