Go to diff to previous submission
import java.util.HashSet; import java.util.Scanner; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author kajanek6 */ public class Fl { HashSet<Integer> mnozina=new HashSet<Integer>(); int n=0; int counter=0; int y=0; while (input.hasNextLine()) { mnozina.clear(); counter=0; if(temp.length()==0){ continue; } for(int i=1;i<=10000;i++) { if((i-n)>0){ int vysl = (n*i)/(i-n); int zvysok=(n*i)%(i-n); if(vysl>0 && zvysok==0) { if(!mnozina.contains(i)){ counter++; mnozina.add(i); mnozina.add(vysl); } } } } } } public class pair{ public int prvy; public int druhy; public pair(int a,int b){ prvy=a; druhy=b; } } }
--- c5.s746.cteam087.fl.java.0.Fl.java +++ c5.s758.cteam087.fl.java.0.Fl.java @@ -22,4 +22,5 @@ Scanner input = new Scanner(System.in); while (input.hasNextLine()) { + mnozina.clear(); counter=0; String temp = input.nextLine();