title: Can't reproduce a runtime error that UVa Online Judge gives me
body: <p>I am getting runtime errors for my Java solutions to UVa Online Judge problems. I have finished <a href="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&amp;Itemid=8&amp;page=show_problem&amp;problem=36" rel="nofollow">Problem 100</a> and it works on my end. Any ideas what could be causing the problem?</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Hashtable;
  import java.util.Scanner;
  
  class P100 {
  
      public static void main(String args[]) {
          Hashtable&lt;Integer, Integer&gt; solutions = new Hashtable&lt;Integer, Integer&gt;();
          Scanner input = new Scanner(System.in);
  
          while (input.hasNextInt()) {
              int lowerBound = input.nextInt();
              int upperBound = input.nextInt();
  
              int longestCount = 0;
  
              for (int i = lowerBound; i &lt;= upperBound; i++) {
                  int n = i;
                  int count = 1;
  
                  ArrayList&lt;Integer&gt; sequence = new ArrayList&lt;Integer&gt;();
  
                  while (n != 1) {
                      if (solutions.containsKey(n)) {
                          count += solutions.get(n) - 1;
                          break;
                      }
  
                      sequence.add(n);
  
                      count += 1;
                      if (n % 2 == 0) n /= 2;
                      else n = 3 * n + 1;
                  }
  
                  for (int j = 0; j &lt; sequence.size(); j++) {
                      solutions.put(sequence.get(j), count - j);
                  }
  
                  if (count &gt; longestCount) longestCount = count;
  
                  solutions.put(i, count);
              }
  
              System.out.printf("%d %d %d\n", lowerBound, upperBound, longestCount);
          }
      }
  
  }
  </code></pre>