Submission #71555

# Submission time Handle Problem Language Result Execution time Memory
71555 2018-08-25T06:58:24 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
65.2 / 100
802 ms 1320 KB
#include "planet.h"

#include <cstdio>

const int n = 2222;
const int sz = 70;

void ainta()
{
	int i;
	
	for(i=0; i * sz < n; i++){
		paint(i * sz % n, 0);
		paint(0, i * sz % n);
	}
}

void sangsoo()
{
	int i, k, f1, f2, c1, c2, d1, d2, x, y;
	
	f1 = f2 = 0;
	
	count_row(0);
	count_col(0);
	
	for(i=0; ; i++){
		if(f1 == 0){
			k = count_row((n - i) % n);
			if(k == 1) f1 = 1, c1 = (n - i) % n, d1 = i;
			else if(k > 1) f1 = 2, x = (n - i) % n;
		}
		if(f1 == 1){
			k = count_row(((c1 - (i - d1) * sz) % n + n) % n);
			if(k > 1) f1 = 2, x = ((c1 - (i - d1) * sz) % n + n) % n;
		}
		
		if(f2 == 0){
			k = count_col((n - i) % n);
			if(k >= 1) f2 = 1, c2 = (n - i) % n, d2 = i;
			else if(k > 1) f2 = 2, y = (n - i) % n;
		}
		if(f2 == 1){
			k = count_col(((c2 - (i - d2) * sz) % n + n) % n);
			if(k > 1) f2 = 2, y = ((c2 - (i - d2) * sz) % n + n) % n;
		}
		
		if(f1 > 1 && f2 > 1) break;
	}
	
	report(x, y);
}
# Verdict Execution time Memory Grader output
1 Partially correct 60 ms 888 KB Output is partially correct: max_calls = 255
2 Partially correct 72 ms 1252 KB Output is partially correct: max_calls = 256
3 Partially correct 66 ms 1252 KB Output is partially correct: max_calls = 254
4 Partially correct 62 ms 1252 KB Output is partially correct: max_calls = 258
5 Partially correct 57 ms 1252 KB Output is partially correct: max_calls = 259
6 Partially correct 56 ms 1252 KB Output is partially correct: max_calls = 256
7 Partially correct 57 ms 1252 KB Output is partially correct: max_calls = 257
8 Partially correct 72 ms 1252 KB Output is partially correct: max_calls = 259
9 Partially correct 57 ms 1252 KB Output is partially correct: max_calls = 260
10 Partially correct 70 ms 1264 KB Output is partially correct: max_calls = 255
11 Partially correct 72 ms 1264 KB Output is partially correct: max_calls = 253
12 Partially correct 72 ms 1264 KB Output is partially correct: max_calls = 263
13 Partially correct 62 ms 1264 KB Output is partially correct: max_calls = 258
14 Partially correct 65 ms 1264 KB Output is partially correct: max_calls = 256
15 Partially correct 71 ms 1264 KB Output is partially correct: max_calls = 253
16 Partially correct 62 ms 1264 KB Output is partially correct: max_calls = 258
17 Partially correct 65 ms 1264 KB Output is partially correct: max_calls = 259
18 Partially correct 64 ms 1264 KB Output is partially correct: max_calls = 256
19 Partially correct 69 ms 1264 KB Output is partially correct: max_calls = 252
20 Partially correct 173 ms 1264 KB Output is partially correct: max_calls = 260
# Verdict Execution time Memory Grader output
1 Partially correct 678 ms 1264 KB Output is partially correct: max_calls = 260
2 Partially correct 636 ms 1264 KB Output is partially correct: max_calls = 263
3 Partially correct 526 ms 1264 KB Output is partially correct: max_calls = 261
4 Partially correct 663 ms 1264 KB Output is partially correct: max_calls = 262
5 Partially correct 590 ms 1264 KB Output is partially correct: max_calls = 260
6 Partially correct 599 ms 1264 KB Output is partially correct: max_calls = 259
7 Partially correct 599 ms 1264 KB Output is partially correct: max_calls = 258
8 Partially correct 663 ms 1264 KB Output is partially correct: max_calls = 260
9 Partially correct 658 ms 1264 KB Output is partially correct: max_calls = 260
10 Partially correct 665 ms 1264 KB Output is partially correct: max_calls = 259
11 Partially correct 189 ms 1264 KB Output is partially correct: max_calls = 262
12 Partially correct 598 ms 1264 KB Output is partially correct: max_calls = 262
13 Partially correct 660 ms 1264 KB Output is partially correct: max_calls = 260
14 Partially correct 581 ms 1264 KB Output is partially correct: max_calls = 264
15 Partially correct 622 ms 1264 KB Output is partially correct: max_calls = 263
16 Partially correct 644 ms 1264 KB Output is partially correct: max_calls = 262
17 Partially correct 728 ms 1288 KB Output is partially correct: max_calls = 260
18 Partially correct 724 ms 1288 KB Output is partially correct: max_calls = 259
19 Partially correct 655 ms 1288 KB Output is partially correct: max_calls = 259
20 Partially correct 720 ms 1288 KB Output is partially correct: max_calls = 258
21 Partially correct 802 ms 1320 KB Output is partially correct: max_calls = 261
22 Partially correct 769 ms 1320 KB Output is partially correct: max_calls = 261
23 Partially correct 734 ms 1320 KB Output is partially correct: max_calls = 260