
-----------------------------------
chili5
Tue Oct 27, 2009 7:31 pm

Fast IO
-----------------------------------
I was working on a UVA problem involving sorting and outputting a large amount of numbers. The problem that I am having is that my program is taking far too long. I've looked around online for faster IO methods but I can't find anything. All I can find is Scanner (which is slow) and BufferedReader (which doesn't help much).

I end up with this code:

[CODE]
import java.util.*;
import java.io.*;
/**
 *
 * @author James Brocklebank
 */
class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
       //Scanner fin = new Scanner(new FileReader("age.txt"));
       Scanner fin = new Scanner(System.in);
       Vector v = new Vector();
       int n;

       while (true) {
           n = fin.nextInt();

           if (n == 0) {
               break;
           }

           v.clear();

           for (int i=0;i