답안 #71599

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
71599 2018-08-25T08:15:48 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
76.7 / 100
1279 ms 1392 KB
#include "planet.h"

#include <bits/stdc++.h>

using namespace std;

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, k1, k2, s, e, mid, x, y;
	
	k1 = rand() % n;
	for(i=1; ; i++){
		k1 = (k1 + sz) % n;
		if(count_row(k1)) break;
	}
	
	k2 = rand() % n;
	for(; ; i++){
		k2 = (k2 + sz) % n;
		if(count_col(k2)) break;
	}
	
	for(s=0, e=max(100, i-1); s<=e; ){
		mid = s + e >> 1;
		if(count_row((k1 - mid + n) % n)) s = mid + 1;
		else e = mid - 1;
	}
	
	x = (k1 - (s - 1) + n) % n;
	
	for(s=0, e=max(100, i-1); s<=e; ){
		mid = s + e >> 1;
		if(count_col((k2 - mid + n) % n)) s = mid + 1;
		else e = mid - 1;
	}
	
	y = (k2 - (s - 1) + n) % n;
	
	report(x, y);
}

Compilation message

planet.cpp: In function 'void sangsoo()':
planet.cpp:38:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
planet.cpp:46:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 106 ms 888 KB Output is partially correct: max_calls = 162
2 Partially correct 102 ms 1124 KB Output is partially correct: max_calls = 162
3 Partially correct 124 ms 1124 KB Output is partially correct: max_calls = 163
4 Partially correct 117 ms 1124 KB Output is partially correct: max_calls = 162
5 Partially correct 119 ms 1144 KB Output is partially correct: max_calls = 158
6 Partially correct 114 ms 1144 KB Output is partially correct: max_calls = 160
7 Partially correct 101 ms 1160 KB Output is partially correct: max_calls = 162
8 Partially correct 104 ms 1160 KB Output is partially correct: max_calls = 158
9 Partially correct 141 ms 1304 KB Output is partially correct: max_calls = 162
10 Partially correct 124 ms 1304 KB Output is partially correct: max_calls = 163
11 Partially correct 106 ms 1304 KB Output is partially correct: max_calls = 158
12 Partially correct 111 ms 1304 KB Output is partially correct: max_calls = 159
13 Partially correct 107 ms 1304 KB Output is partially correct: max_calls = 161
14 Partially correct 120 ms 1304 KB Output is partially correct: max_calls = 160
15 Partially correct 118 ms 1304 KB Output is partially correct: max_calls = 161
16 Partially correct 121 ms 1304 KB Output is partially correct: max_calls = 163
17 Partially correct 120 ms 1364 KB Output is partially correct: max_calls = 157
18 Partially correct 134 ms 1364 KB Output is partially correct: max_calls = 159
19 Partially correct 115 ms 1364 KB Output is partially correct: max_calls = 159
20 Partially correct 203 ms 1364 KB Output is partially correct: max_calls = 157
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1134 ms 1364 KB Output is partially correct: max_calls = 163
2 Partially correct 1031 ms 1364 KB Output is partially correct: max_calls = 163
3 Partially correct 1022 ms 1364 KB Output is partially correct: max_calls = 163
4 Partially correct 1048 ms 1364 KB Output is partially correct: max_calls = 163
5 Partially correct 1105 ms 1364 KB Output is partially correct: max_calls = 163
6 Partially correct 1123 ms 1364 KB Output is partially correct: max_calls = 162
7 Partially correct 1121 ms 1364 KB Output is partially correct: max_calls = 163
8 Partially correct 1091 ms 1364 KB Output is partially correct: max_calls = 163
9 Partially correct 1037 ms 1364 KB Output is partially correct: max_calls = 163
10 Partially correct 1036 ms 1364 KB Output is partially correct: max_calls = 163
11 Partially correct 330 ms 1392 KB Output is partially correct: max_calls = 162
12 Partially correct 1147 ms 1392 KB Output is partially correct: max_calls = 162
13 Partially correct 1150 ms 1392 KB Output is partially correct: max_calls = 163
14 Partially correct 1199 ms 1392 KB Output is partially correct: max_calls = 163
15 Partially correct 1096 ms 1392 KB Output is partially correct: max_calls = 164
16 Partially correct 1063 ms 1392 KB Output is partially correct: max_calls = 163
17 Partially correct 1063 ms 1392 KB Output is partially correct: max_calls = 162
18 Partially correct 1145 ms 1392 KB Output is partially correct: max_calls = 162
19 Partially correct 1205 ms 1392 KB Output is partially correct: max_calls = 162
20 Partially correct 1165 ms 1392 KB Output is partially correct: max_calls = 164
21 Partially correct 1267 ms 1392 KB Output is partially correct: max_calls = 162
22 Partially correct 1237 ms 1392 KB Output is partially correct: max_calls = 163
23 Partially correct 1279 ms 1392 KB Output is partially correct: max_calls = 164