2010年10月1日金曜日

PKU Judge Online 2070 Filling Out the Team

■2070 Filling Out the Team

□Problem
省略.

□Solution
省略.

□Code
  1. package p2070;  
  2.   
  3. import java.util.*;  
  4. import java.lang.*;  
  5. import java.math.*;  
  6. import java.io.*;  
  7.   
  8. import static java.lang.Math.*;  
  9. import static java.util.Arrays.*;  
  10.   
  11. // AC  
  12. public class Main{  
  13.   
  14.  Scanner sc=new Scanner(System.in);  
  15.   
  16.  final int INF=Integer.MAX_VALUE;  
  17.  final double EPS=1e-9;  
  18.   
  19.  void run(){  
  20.   double[] speeds={4.56.05.0};  
  21.   double[] weights={150300200};  
  22.   double[] strengths={200500300};  
  23.   String[] ss={"Wide Receiver""Lineman""Quarterback"};  
  24.   for(;;){  
  25.    double speed=sc.nextDouble();  
  26.    double weight=sc.nextDouble();  
  27.    double strength=sc.nextDouble();  
  28.    if(speed==0&&weight==0&&strength==0)  
  29.     break;  
  30.    String ans="";  
  31.    for(int i=0; i<3; i++){  
  32.     if(speed<speeds[i]+EPS&&weight+EPS>weights[i]  
  33.       &&strength+EPS>strengths[i])  
  34.      ans+=ss[i]+" ";  
  35.    }  
  36.    if(ans.equals(""))  
  37.     println("No positions");  
  38.    else  
  39.     println(ans.substring(0, ans.length()-1));  
  40.   }  
  41.  }  
  42.   
  43.  void print(String s){  
  44.   System.out.print(s);  
  45.  }  
  46.   
  47.  void println(String s){  
  48.   System.out.println(s);  
  49.  }  
  50.   
  51.  public static void main(String[] args){  
  52.   // System.setOut(new PrintStream(new BufferedOutputStream(System.out)));  
  53.   new Main().run();  
  54.  }  
  55. }  

0 件のコメント: