Submission #71596

# Submission time Handle Problem Language Result Execution time Memory
71596 2018-08-25T08:11:42 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
59.7 / 100
1628 ms 1276 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;
	
	for(i=1; ; i++){
		k1 = rand() % n;
		if(count_row(k1)) break;
	}
	
	for(; ; i++){
		k2 = rand() % 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:36:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
planet.cpp:44:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   mid = s + e >> 1;
         ~~^~~
# Verdict Execution time Memory Grader output
1 Partially correct 121 ms 984 KB Output is partially correct: max_calls = 289
2 Partially correct 122 ms 1256 KB Output is partially correct: max_calls = 289
3 Partially correct 122 ms 1256 KB Output is partially correct: max_calls = 289
4 Partially correct 126 ms 1256 KB Output is partially correct: max_calls = 288
5 Partially correct 125 ms 1256 KB Output is partially correct: max_calls = 263
6 Partially correct 123 ms 1256 KB Output is partially correct: max_calls = 361
7 Partially correct 155 ms 1256 KB Output is partially correct: max_calls = 361
8 Partially correct 143 ms 1256 KB Output is partially correct: max_calls = 361
9 Partially correct 175 ms 1256 KB Output is partially correct: max_calls = 362
10 Partially correct 162 ms 1256 KB Output is partially correct: max_calls = 285
11 Partially correct 160 ms 1256 KB Output is partially correct: max_calls = 229
12 Partially correct 156 ms 1256 KB Output is partially correct: max_calls = 267
13 Partially correct 130 ms 1256 KB Output is partially correct: max_calls = 267
14 Partially correct 141 ms 1256 KB Output is partially correct: max_calls = 271
15 Partially correct 130 ms 1256 KB Output is partially correct: max_calls = 301
16 Partially correct 130 ms 1256 KB Output is partially correct: max_calls = 277
17 Partially correct 145 ms 1256 KB Output is partially correct: max_calls = 303
18 Partially correct 139 ms 1256 KB Output is partially correct: max_calls = 303
19 Partially correct 148 ms 1256 KB Output is partially correct: max_calls = 304
20 Partially correct 228 ms 1256 KB Output is partially correct: max_calls = 267
# Verdict Execution time Memory Grader output
1 Partially correct 1451 ms 1256 KB Output is partially correct: max_calls = 375
2 Partially correct 1327 ms 1256 KB Output is partially correct: max_calls = 355
3 Partially correct 1308 ms 1256 KB Output is partially correct: max_calls = 355
4 Partially correct 1260 ms 1260 KB Output is partially correct: max_calls = 342
5 Partially correct 1211 ms 1260 KB Output is partially correct: max_calls = 342
6 Partially correct 1266 ms 1260 KB Output is partially correct: max_calls = 315
7 Partially correct 1310 ms 1260 KB Output is partially correct: max_calls = 310
8 Partially correct 1230 ms 1260 KB Output is partially correct: max_calls = 310
9 Partially correct 1322 ms 1260 KB Output is partially correct: max_calls = 318
10 Partially correct 1458 ms 1260 KB Output is partially correct: max_calls = 361
11 Partially correct 415 ms 1260 KB Output is partially correct: max_calls = 347
12 Partially correct 1570 ms 1260 KB Output is partially correct: max_calls = 350
13 Partially correct 1542 ms 1264 KB Output is partially correct: max_calls = 350
14 Partially correct 1606 ms 1264 KB Output is partially correct: max_calls = 339
15 Partially correct 1523 ms 1264 KB Output is partially correct: max_calls = 334
16 Partially correct 1559 ms 1264 KB Output is partially correct: max_calls = 298
17 Partially correct 1628 ms 1264 KB Output is partially correct: max_calls = 422
18 Partially correct 1593 ms 1264 KB Output is partially correct: max_calls = 319
19 Partially correct 1576 ms 1264 KB Output is partially correct: max_calls = 273
20 Partially correct 1627 ms 1272 KB Output is partially correct: max_calls = 278
21 Partially correct 1607 ms 1272 KB Output is partially correct: max_calls = 330
22 Partially correct 1510 ms 1272 KB Output is partially correct: max_calls = 330
23 Partially correct 1515 ms 1276 KB Output is partially correct: max_calls = 335