Submission #7194

#TimeUsernameProblemLanguageResultExecution timeMemory
7194gs13068행성 탐사 (GA8_planet)C++98
97.40 / 100
792 ms1756 KiB
#include "planet.h"

#define BUCKET 104

void ainta()
{
  int i,j;
  for(i=0;i<BUCKET;i++)paint((2222-i)%2222,(2222-i)%2222);
}

void sangsoo()
{
  int x,y,z=0;
  int i,j,k;
  for(x=0;;x+=z)
  {
  	if(x+z>=2221)
	{
		i=x+z;
		break;
	}
	z++;
	if(count_row(x%2222))
	{
		i=x+z-1;
		break;
	}
  }
  if(i>2221)i=2221;
  while(x<i)
  {
    k=(x+i+1)/2;
    if(++z&&count_row(k%2222))x=k;
    else i=k-1;
  }
  for(y=0;;y+=z)
  {
  	if(y+z>=2221)
	{
		j=y+z;
		break;
	}
	z++;
	if(count_col(y%2222))
	{
		j=y+z-1;
		break;
	}
  }
  if(j>2221)j=2221;
  while(y<j)
  {
    k=(y+j+1)/2;
    if(count_col(k%2222))y=k;
    else j=k-1;
  }
  report(x%2222,y%2222);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...