import java.io.*; import java.util.*; /** * This class can take a variable number of parameters on the command * line. Program execution begins with the main() method. The class * constructor is not invoked unless an object of type 'Class1' * created in the main() method. */ public class Raindrop { static BufferedReader infile; static PrintWriter outfile; static Hashtable drops; static Hashtable hash; static int T,H,D; /** * The main entry point for the application. * * @param args Array of parameters passed to the application * via the command line. */ public static void main (String[] args)throws IOException { StringTokenizer token; try{ infile=new BufferedReader(new FileReader("Raindrop.IN")); outfile=new PrintWriter(new FileWriter("Raindrop.OUT")); }catch(Exception e){System.out.println(e);} int n=Integer.parseInt(infile.readLine()); for(int i=0; i=i.intValue()) return Integer.MAX_VALUE; else hash.remove(str); } hash.put(str,new Integer(sofar)); //int s; if(drops.get(time+"|"+start)!=null)sofar++; return Math.min(find(start+1, time+1,sofar),Math.min(find(start,time+1,sofar),find(start-1, time+1,sofar))); } }