Submission #71594

# Submission time Handle Problem Language Result Execution time Memory
71594 2018-08-25T08:07:19 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
0 / 100
3 ms 612 KB
#include "planet.h"

#include <bits/stdc++.h>

const int n = 2222;
const int sz = 40;

void ainta()
{
	int i;
	
	for(i=0; i<101; i++){
		paint(i, i);
	}
}

void sangsoo()
{
	srand(time(0));
	
	int i, k, s, e, mid, x, y;
	
	for(i=1; ; i++){
		k = rand() % 2222;
		if(count_row(k)) break;
	}
	
	for(s=0, e=i-1; s<=e; ){
		mid = s + e >> 1;
		if(count_row((k - mid + n) % n)) s = mid + 1;
		else e = mid - 1;
	}
	
	x = (k - (s - 1) + n) % n;
	
	for(; ; i++){
		k = rand() % 2222;
		if(count_col(k)) break;
	}
	
	for(s=0, e=i-1; s<=e; ){
		mid = s + e >> 1;
		if(count_col((k - mid + n) % n)) s = mid + 1;
		else e = mid - 1;
	}
	
	y = (k - (s - 1) + n) % n;
	
	report(x, y);
}

Compilation message

planet.cpp: In function 'void sangsoo()':
planet.cpp:29:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
planet.cpp:42:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 612 KB Output isn't correct
2 Halted 0 ms 0 KB -