Source code for submission s671

Fl.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package basic;
  7.  
  8. import java.io.BufferedReader;
  9. import java.io.InputStreamReader;
  10. import java.util.Arrays;
  11. import java.util.HashMap;
  12. import java.util.HashSet;
  13. import java.util.Map;
  14. import java.util.Scanner;
  15. import java.util.StringTokenizer;
  16. /**
  17.  *
  18.  * @author cteam043
  19.  */
  20. public class Fl {
  21. static final double EPS = 1E-7;
  22. //StringTokenizer st = new StringTokenizer("");
  23. //BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
  24.  
  25. // String nextToken() throws Exception {
  26. // while(!st.hasMoreTokens()){
  27. // st = new StringTokenizer(input.readLine());
  28. // }
  29. // return st.nextToken();
  30. // }
  31.  
  32. // int nextInt() throws Exception {
  33. // return Integer.parseInt(nextToken());
  34. // }
  35. /**
  36.   * @param args the command line arguments
  37.   */
  38. public static void main(String[] args) throws Exception {
  39.  
  40. Scanner in = new Scanner(System.in);
  41. String input;
  42. int inputInt, tmp, delitel;
  43. HashSet<Integer> set = new HashSet<Integer>();
  44.  
  45. while(in.hasNext()){ // nextToken eof?
  46. input = in.next();
  47. input = input.substring(2);
  48. inputInt = Integer.parseInt(input);
  49. set.clear();
  50.  
  51. for(int i = 1; i < inputInt ; i++){
  52. tmp = inputInt + i;
  53. delitel = tmp * inputInt;
  54. if(delitel%i == 0){
  55. //System.out.print(" " + delitel/i);
  56. set.add(delitel/i);
  57. }
  58. }
  59.  
  60. System.out.println(set.size()+1);
  61. }
  62. }
  63.  
  64. }
  65.