Register
|
Login
Home
News
Competitions
Practice
How to
Rankings
Calendar
Arena
CodeFu 2007
CodeFu'07 Highlights
Jazoon'07 Highlights
Schedule
Rules
Prizes
Results
Competitions
»
Main CodeFu Competitons
»
CodeFu 2007
»
Results
CodeFu 2007 Results
CodeFu Final Round Results
bokic's solution for 400: Square Count, written in Java
public class SquareCount { private boolean IsDivideableByPerfectSquare(int Pos) { int counter = 2; for(;;) { if (Pos % (counter * counter) == 0) return true; if (counter * counter > Pos) return false; counter++; } } public int pos(int N) { int counter = 1; int value = 0; for(;;) { if (IsDivideableByPerfectSquare(counter) == false) { value++; } if (N == value) break; counter++; } return counter; } }