Go to diff to previous submission
--- c5.s641.cteam052.fl.cpp.0.fl.cpp +++ c5.s713.cteam052.fl.cpp.0.fl.cpp @@ -5,30 +5,10 @@ void solve(int n){ - set<int> checked; - - int p = 0, y = n + 1, max = 2000000000; - bool first = true; + int p = 1, y = n + 1, max = 2 * n; while(y < max){ - //printf("y %d\n", y); - //printf("max %d\n", max); - - if(checked.count(y)){ - y++; - continue; - } - double d = (double)n * y / (y - n); - int x = (int)d; - checked.insert(x); - - if(x == d){ - if(first){ - max = x; - first = false; - } - + if(!((n * y) % (y - n))){ p++; } - y++; }