Source code for submission s625

Go to diff to previous submission

Fl.java

  1.  
  2. import java.io.*;
  3. import java.util.*;
  4.  
  5.  
  6. public class Fl {
  7.  
  8. public static void main(String[] args) throws FileNotFoundException {
  9.  
  10. Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
  11. //Scanner sc = new Scanner(new BufferedReader(new FileReader(new File("in.txt"))));
  12.  
  13. //int i = 1;
  14.  
  15. while (sc.hasNextLine()) {
  16. //while(i < 10000) {
  17. int n = Integer.parseInt(sc.next().substring(2));
  18. sc.nextLine();
  19.  
  20. //int n = i++;
  21. //System.out.print(n + " : ");
  22.  
  23. int x = n + 1;
  24.  
  25. double y = (n*x)/ (double) (x-n);
  26.  
  27. int sum = 0;
  28.  
  29. List<Integer> list = new ArrayList<Integer>();
  30.  
  31. /*
  32. for (; ; x++) { // y < n +1
  33. y = (n*x)/ (double) (x-n);
  34.  
  35. if (y < n+1) break;
  36.  
  37. if ((int) y - y == 0) {
  38. if (list.contains((int) y)) break;
  39.  
  40. sum++;
  41. list.add(x);
  42. }
  43. }*/
  44.  
  45. System.out.println(sum);
  46.  
  47.  
  48. }
  49. }
  50.  
  51. }
  52.  

Diff to submission s618

Fl.java

--- c5.s618.cteam054.fl.java.0.Fl.java
+++ c5.s625.cteam054.fl.java.0.Fl.java
@@ -11,11 +11,14 @@
                 //Scanner sc = new Scanner(new BufferedReader(new FileReader(new File("in.txt"))));
                 
-                int i = 1;
+                //int i = 1;
                 
                 while (sc.hasNextLine()) {
-                
+                //while(i < 10000) {
                         int n = Integer.parseInt(sc.next().substring(2));                       
                         sc.nextLine();          
                         
+                        //int n = i++;                  
+                        //System.out.print(n + " : ");
+                        
                         int x = n + 1;
                         
@@ -26,5 +29,5 @@
                         List<Integer> list = new ArrayList<Integer>();  
                         
-                        
+                        /*
                         for (; ; x++) {                 // y < n +1 
                                 y = (n*x)/ (double) (x-n);
@@ -38,5 +41,5 @@
                                         list.add(x);
                                 }
-                        }
+                        }*/
                         
                         System.out.println(sum);