Go to diff to previous submission
import java.io.*; import java.util.*; public class Fl { //Scanner sc = new Scanner(new BufferedReader(new FileReader(new File("in.txt")))); //int i = 1; while (sc.hasNextLine()) { //while(i < 10000) { sc.nextLine(); //int n = i++; //System.out.print(n + " : "); int x = n + 1; double y = (n*x)/ (double) (x-n); double prvni_y = y; int sum = 0; List<Integer> list = new ArrayList<Integer>(); for (; ; x++) { // y < n +1 y = (n*x)/ (double) (x-n); if (y < n+1) break; if (x > prvni_y) break; if ((int) y - y == 0) { if (list.contains((int) y)) break; sum++; list.add(x); } } } } }
--- c5.s666.cteam054.fl.java.0.Fl.java +++ c5.s747.cteam054.fl.java.0.Fl.java @@ -25,4 +25,6 @@ double y = (n*x)/ (double) (x-n); + double prvni_y = y; + int sum = 0; @@ -30,8 +32,10 @@ - for (; x < 20 ; x++) { // y < n +1 + for (; ; x++) { // y < n +1 y = (n*x)/ (double) (x-n); if (y < n+1) break; + if (x > prvni_y) break; + if ((int) y - y == 0) {