2011年2月20日日曜日

Aizu Online Judge 0149 Eye Test

■0149 Eye Test

やるだけ.

  1. import java.util.*;  
  2. import java.lang.*;  
  3. import java.math.*;  
  4. import java.io.*;  
  5.   
  6. import static java.lang.Math.*;  
  7. import static java.util.Arrays.*;  
  8.   
  9. public class Main{  
  10.   
  11.  Scanner sc=new Scanner(System.in);  
  12.   
  13.  int INF=1<<28;  
  14.  double EPS=1e-9;  
  15.   
  16.  void run(){  
  17.   int[][] h=new int[4][2];  
  18.   double[] ts={1.10.60.20};  
  19.   for(; sc.hasNext();){  
  20.    for(int j=0; j<2; j++){  
  21.     double s=sc.nextDouble();  
  22.     for(int i=0; i<4; i++){  
  23.      if(s+EPS>ts[i]){  
  24.       h[i][j]++;  
  25.       break;  
  26.      }  
  27.     }  
  28.    }  
  29.   }  
  30.   for(int i=0; i<4; i++){  
  31.    println(h[i][0]+" "+h[i][1]);  
  32.   }  
  33.  }  
  34.   
  35.  void debug(Object... os){  
  36.   System.err.println(Arrays.deepToString(os));  
  37.  }  
  38.   
  39.  void print(String s){  
  40.   System.out.print(s);  
  41.  }  
  42.   
  43.  void println(String s){  
  44.   System.out.println(s);  
  45.  }  
  46.   
  47.  public static void main(String[] args){  
  48.   // System.setOut(new PrintStream(new BufferedOutputStream(System.out)));  
  49.   new Main().run();  
  50.  }  
  51. }  

0 件のコメント: