Go to diff to previous submission
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package fl; import java.util.HashSet; import java.util.Scanner; /** * * @author drevenak3 */ public class FL { /** * @param args the command line arguments */ // TODO code application logic here int N,Y; while(vst.hasNext()){ HashSet<Long> pairs=new HashSet<Long>(); if(N==1){ continue; } int count=0; long max=((N+1)*N)/2+1; for(long y,x=N+1;x<=max;++x){ if((N*x)%(x-N)==0){ y=(N*x)/(x-N); if(!pairs.contains(x)){ pairs.add(x); pairs.add(y); ++count; } } } } vst.close(); } }
--- c5.s707.cteam083.fl.java.0.FL.java +++ c5.s726.cteam083.fl.java.0.FL.java @@ -30,6 +30,6 @@ } int count=0; - long max=((N+1)*N); - for(long y,x=N+1;x<max;++x){ + long max=((N+1)*N)/2+1; + for(long y,x=N+1;x<=max;++x){ if((N*x)%(x-N)==0){ y=(N*x)/(x-N);