Submission #71603

# Submission time Handle Problem Language Result Execution time Memory
71603 2018-08-25T08:24:26 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
86 / 100
1270 ms 1388 KB
#include "planet.h"

#include <bits/stdc++.h>

using namespace std;

const int n = 2222;
const int sz1 = 87;
const int sz2 = 89;

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 + sz1) % n;
		if(count_row(k1)) break;
	}
	
	k2 = rand() % n;
	for(; ; i++){
		k2 = (k2 + sz2) % 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:39:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
planet.cpp:47:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
# Verdict Execution time Memory Grader output
1 Partially correct 114 ms 1040 KB Output is partially correct: max_calls = 129
2 Partially correct 98 ms 1124 KB Output is partially correct: max_calls = 127
3 Partially correct 153 ms 1124 KB Output is partially correct: max_calls = 126
4 Partially correct 100 ms 1168 KB Output is partially correct: max_calls = 127
5 Partially correct 120 ms 1312 KB Output is partially correct: max_calls = 126
6 Partially correct 113 ms 1312 KB Output is partially correct: max_calls = 126
7 Partially correct 102 ms 1312 KB Output is partially correct: max_calls = 127
8 Partially correct 117 ms 1312 KB Output is partially correct: max_calls = 128
9 Partially correct 134 ms 1312 KB Output is partially correct: max_calls = 126
10 Partially correct 111 ms 1312 KB Output is partially correct: max_calls = 127
11 Partially correct 129 ms 1312 KB Output is partially correct: max_calls = 127
12 Partially correct 110 ms 1312 KB Output is partially correct: max_calls = 128
13 Partially correct 103 ms 1388 KB Output is partially correct: max_calls = 126
14 Partially correct 104 ms 1388 KB Output is partially correct: max_calls = 127
15 Partially correct 115 ms 1388 KB Output is partially correct: max_calls = 128
16 Partially correct 127 ms 1388 KB Output is partially correct: max_calls = 128
17 Partially correct 113 ms 1388 KB Output is partially correct: max_calls = 128
18 Partially correct 125 ms 1388 KB Output is partially correct: max_calls = 126
19 Partially correct 130 ms 1388 KB Output is partially correct: max_calls = 128
20 Partially correct 213 ms 1388 KB Output is partially correct: max_calls = 128
# Verdict Execution time Memory Grader output
1 Partially correct 1147 ms 1388 KB Output is partially correct: max_calls = 129
2 Partially correct 1000 ms 1388 KB Output is partially correct: max_calls = 129
3 Partially correct 979 ms 1388 KB Output is partially correct: max_calls = 129
4 Partially correct 973 ms 1388 KB Output is partially correct: max_calls = 128
5 Partially correct 1270 ms 1388 KB Output is partially correct: max_calls = 129
6 Partially correct 1064 ms 1388 KB Output is partially correct: max_calls = 129
7 Partially correct 1056 ms 1388 KB Output is partially correct: max_calls = 129
8 Partially correct 1050 ms 1388 KB Output is partially correct: max_calls = 129
9 Partially correct 1020 ms 1388 KB Output is partially correct: max_calls = 129
10 Partially correct 1088 ms 1388 KB Output is partially correct: max_calls = 129
11 Partially correct 342 ms 1388 KB Output is partially correct: max_calls = 128
12 Partially correct 1166 ms 1388 KB Output is partially correct: max_calls = 129
13 Partially correct 1117 ms 1388 KB Output is partially correct: max_calls = 129
14 Partially correct 1103 ms 1388 KB Output is partially correct: max_calls = 129
15 Partially correct 1160 ms 1388 KB Output is partially correct: max_calls = 129
16 Partially correct 1126 ms 1388 KB Output is partially correct: max_calls = 129
17 Partially correct 1108 ms 1388 KB Output is partially correct: max_calls = 129
18 Partially correct 1047 ms 1388 KB Output is partially correct: max_calls = 129
19 Partially correct 1174 ms 1388 KB Output is partially correct: max_calls = 129
20 Partially correct 1215 ms 1388 KB Output is partially correct: max_calls = 129
21 Partially correct 1139 ms 1388 KB Output is partially correct: max_calls = 129
22 Partially correct 1183 ms 1388 KB Output is partially correct: max_calls = 129
23 Partially correct 1203 ms 1388 KB Output is partially correct: max_calls = 129