SRM 635 DIV 2 250 problem in topcoder

This is somehow easy comparing to other 500 point problem.

this is about a square root.

public class QuadraticLaw {

 public long getTime(long time){
  long number  = (long)Math.floor(Math.sqrt(time));
  for(long i=number; i>0; i--){
   if((i * i) + i <=  time){
    return i;
  return 0l;


Popular posts from this blog

codefights smooth sailing ( CommonCharacterCount)

How to remove 8443 port in URL in tomcat