답안 #71614

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
71614 2018-08-25T08:38:01 Z 윤교준(#2220) 행성 탐사 (GA8_planet) C++11
95.6 / 100
1350 ms 1272 KB
#include "planet.h"
#include <bits/stdc++.h>
using namespace std;
int rd(int s, int e) { return rand() % (e-s+1) + s; }

inline int f(int i) { return (i % 2222 + 2222) % 2222; }

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

void sangsoo() {
	srand(time(0));
	int dx = rd(0, 2221), dy = rd(0, 2221);
	int x = -1, y = -1, ll = -1;
	int sx, ex, sy, ey;

	{
		int i = 0;
		for(int t;; i++) {
			t = count_row(f(i*(i+1)/2 + dx));
			if(t) break;
		}
		int s = i*(i+1)/2 + dx, e = s+i;
		sx = s; ex = e;
		ll = i+1;
	}

	{
		int i = 0, idx = dy;
		for(int t;; i++) {
			t = count_col(f(idx));
			if(t) break;
			idx += ll+i+1;
		}
		int s = idx, e = idx+ll+i;
		sy = s; ey = e;
	}

	{
		int s = sx, e = ex;
		for(int m; s < e;) {
			m = (s+e+1) >> 1;
			if(count_row(f(m))) s = m;
			else e = m-1;
		}
		x = s;
	}
	{
		int s = sy, e = ey;
		for(int m; s < e;) {
			m = (s+e+1) >> 1;
			if(count_col(f(m))) s = m;
			else e = m-1;
		}
		y = s;
	}

	report(f(x), f(y));
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 144 ms 1016 KB Output is partially correct: max_calls = 108
2 Partially correct 119 ms 1064 KB Output is partially correct: max_calls = 108
3 Partially correct 120 ms 1108 KB Output is partially correct: max_calls = 108
4 Partially correct 116 ms 1108 KB Output is partially correct: max_calls = 108
5 Partially correct 122 ms 1108 KB Output is partially correct: max_calls = 108
6 Partially correct 131 ms 1128 KB Output is partially correct: max_calls = 108
7 Partially correct 122 ms 1128 KB Output is partially correct: max_calls = 107
8 Partially correct 130 ms 1128 KB Output is partially correct: max_calls = 108
9 Partially correct 135 ms 1128 KB Output is partially correct: max_calls = 108
10 Partially correct 140 ms 1272 KB Output is partially correct: max_calls = 108
11 Partially correct 115 ms 1272 KB Output is partially correct: max_calls = 108
12 Partially correct 136 ms 1272 KB Output is partially correct: max_calls = 108
13 Partially correct 141 ms 1272 KB Output is partially correct: max_calls = 108
14 Partially correct 147 ms 1272 KB Output is partially correct: max_calls = 108
15 Partially correct 126 ms 1272 KB Output is partially correct: max_calls = 108
16 Partially correct 143 ms 1272 KB Output is partially correct: max_calls = 108
17 Partially correct 125 ms 1272 KB Output is partially correct: max_calls = 107
18 Partially correct 131 ms 1272 KB Output is partially correct: max_calls = 108
19 Partially correct 141 ms 1272 KB Output is partially correct: max_calls = 108
20 Partially correct 214 ms 1272 KB Output is partially correct: max_calls = 108
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1264 ms 1272 KB Output is partially correct: max_calls = 108
2 Partially correct 1161 ms 1272 KB Output is partially correct: max_calls = 108
3 Partially correct 1242 ms 1272 KB Output is partially correct: max_calls = 108
4 Partially correct 1195 ms 1272 KB Output is partially correct: max_calls = 108
5 Partially correct 1330 ms 1272 KB Output is partially correct: max_calls = 108
6 Partially correct 1164 ms 1272 KB Output is partially correct: max_calls = 108
7 Partially correct 1278 ms 1272 KB Output is partially correct: max_calls = 108
8 Partially correct 1265 ms 1272 KB Output is partially correct: max_calls = 108
9 Partially correct 1175 ms 1272 KB Output is partially correct: max_calls = 108
10 Partially correct 1142 ms 1272 KB Output is partially correct: max_calls = 108
11 Partially correct 351 ms 1272 KB Output is partially correct: max_calls = 108
12 Partially correct 1216 ms 1272 KB Output is partially correct: max_calls = 108
13 Partially correct 1187 ms 1272 KB Output is partially correct: max_calls = 108
14 Partially correct 1225 ms 1272 KB Output is partially correct: max_calls = 108
15 Partially correct 1350 ms 1272 KB Output is partially correct: max_calls = 108
16 Partially correct 1273 ms 1272 KB Output is partially correct: max_calls = 108
17 Partially correct 1312 ms 1272 KB Output is partially correct: max_calls = 108
18 Partially correct 1282 ms 1272 KB Output is partially correct: max_calls = 108
19 Partially correct 1192 ms 1272 KB Output is partially correct: max_calls = 108
20 Partially correct 1317 ms 1272 KB Output is partially correct: max_calls = 108
21 Partially correct 1205 ms 1272 KB Output is partially correct: max_calls = 108
22 Partially correct 1173 ms 1272 KB Output is partially correct: max_calls = 108
23 Partially correct 1245 ms 1272 KB Output is partially correct: max_calls = 108