Submission #71554

# Submission time Handle Problem Language Result Execution time Memory
71554 2018-08-25T06:53:19 Z 김세빈(#2219) 행성 탐사 (GA8_planet) C++11
52.8 / 100
1228 ms 1388 KB
#include "planet.h"

#include <cstdio>

const int n = 2222;
const int sz = 48;

void ainta()
{
	int i;
	
	for(i=0; i<sz; 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;
	
	for(i=0; i<2; i++){
		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;
		}
		else 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;
		}
		else 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);
}

Compilation message

planet.cpp: In function 'void sangsoo()':
planet.cpp:53:8: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
  report(x, y);
  ~~~~~~^~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 79 ms 888 KB Output is partially correct: max_calls = 1289
2 Partially correct 89 ms 1132 KB Output is partially correct: max_calls = 1289
3 Partially correct 78 ms 1132 KB Output is partially correct: max_calls = 1287
4 Partially correct 75 ms 1132 KB Output is partially correct: max_calls = 1284
5 Partially correct 96 ms 1132 KB Output is partially correct: max_calls = 1291
6 Partially correct 120 ms 1212 KB Output is partially correct: max_calls = 1286
7 Partially correct 95 ms 1212 KB Output is partially correct: max_calls = 1286
8 Partially correct 72 ms 1212 KB Output is partially correct: max_calls = 1293
9 Partially correct 116 ms 1212 KB Output is partially correct: max_calls = 1288
10 Partially correct 90 ms 1212 KB Output is partially correct: max_calls = 1288
11 Partially correct 100 ms 1212 KB Output is partially correct: max_calls = 1288
12 Partially correct 107 ms 1236 KB Output is partially correct: max_calls = 1283
13 Partially correct 98 ms 1236 KB Output is partially correct: max_calls = 1290
14 Partially correct 104 ms 1236 KB Output is partially correct: max_calls = 1290
15 Partially correct 91 ms 1236 KB Output is partially correct: max_calls = 1285
16 Partially correct 102 ms 1260 KB Output is partially correct: max_calls = 1292
17 Partially correct 95 ms 1260 KB Output is partially correct: max_calls = 1292
18 Partially correct 107 ms 1260 KB Output is partially correct: max_calls = 1287
19 Partially correct 106 ms 1260 KB Output is partially correct: max_calls = 1285
20 Partially correct 209 ms 1260 KB Output is partially correct: max_calls = 1294
# Verdict Execution time Memory Grader output
1 Partially correct 941 ms 1260 KB Output is partially correct: max_calls = 1293
2 Partially correct 831 ms 1260 KB Output is partially correct: max_calls = 1294
3 Partially correct 987 ms 1260 KB Output is partially correct: max_calls = 1296
4 Partially correct 971 ms 1260 KB Output is partially correct: max_calls = 1295
5 Partially correct 958 ms 1260 KB Output is partially correct: max_calls = 1298
6 Partially correct 1066 ms 1388 KB Output is partially correct: max_calls = 1297
7 Partially correct 971 ms 1388 KB Output is partially correct: max_calls = 1296
8 Partially correct 1117 ms 1388 KB Output is partially correct: max_calls = 1294
9 Partially correct 973 ms 1388 KB Output is partially correct: max_calls = 1293
10 Partially correct 1075 ms 1388 KB Output is partially correct: max_calls = 1293
11 Partially correct 290 ms 1388 KB Output is partially correct: max_calls = 1291
12 Partially correct 981 ms 1388 KB Output is partially correct: max_calls = 1293
13 Partially correct 1028 ms 1388 KB Output is partially correct: max_calls = 1295
14 Partially correct 1111 ms 1388 KB Output is partially correct: max_calls = 1294
15 Partially correct 959 ms 1388 KB Output is partially correct: max_calls = 1297
16 Partially correct 970 ms 1388 KB Output is partially correct: max_calls = 1296
17 Partially correct 969 ms 1388 KB Output is partially correct: max_calls = 1295
18 Partially correct 854 ms 1388 KB Output is partially correct: max_calls = 1293
19 Partially correct 875 ms 1388 KB Output is partially correct: max_calls = 1292
20 Partially correct 1091 ms 1388 KB Output is partially correct: max_calls = 1292
21 Partially correct 1228 ms 1388 KB Output is partially correct: max_calls = 1291
22 Partially correct 917 ms 1388 KB Output is partially correct: max_calls = 1292
23 Partially correct 972 ms 1388 KB Output is partially correct: max_calls = 1294