Submission #72293

# Submission time Handle Problem Language Result Execution time Memory
72293 2018-08-26T06:52:28 Z 인프라웨어 상한가 가주세요. 물렸어요(#2188, c4big, cepiloth) Magic Dowsing (FXCUP3_magic) C++17
0 / 100
2 ms 528 KB
#include  "dowsing.h"
#include <vector>
using namespace std;
void  FindTreasure(int  N)  {
	vector<vector<int>> board = vector<vector<int>>(N + 1, vector<int>(N + 1, 0));
	bool calSol = true;
	vector<pair<int, int>> tmp;
	for (int i = 1; i <= N - 1; ++i) {	// ���� �ϳ��� ����� �˼� �ִ�.
		int cache = Detect(i, i);
		board[i][i] = cache;
		if (cache == 1) {
			calSol;
			tmp.push_back(make_pair(i, i));
		}
	}
	if (calSol) {
		if (tmp.size() == 1) {
			tmp.push_back(make_pair(N, N));
		}
		int dt = Detect(tmp[0].first, tmp[1].second);
		if (dt == 0)
			Report(tmp[0].first, tmp[1].second);
		else
			Report(tmp[1].first, tmp[0].second);
	}
	else {
		bool catchSol = false;
		for (int i = 1; i < N / 2; ++i) {
			int dt = Detect(i, N + 1 - i);
			if (dt == 1) {
				catchSol = true;
				int dt2 = Detect(i, N + 1 - i - 1);
				if (dt2 == 1)
					Report(i, i);
				else
					Report(N + 1 - i, N + 1 - i);
				break;
			}
		}
		if (catchSol == false) {
			int solX = (N + 1) / 2;
			int solY = (N + 1) / 2;
			Report(solX, solY);
		}
	}
	//  Ȧ���� ��쵵 ó��


	return;
}

Compilation message

dowsing.cpp: In function 'void FindTreasure(int)':
dowsing.cpp:12:10: warning: statement has no effect [-Wunused-value]
    calSol;
          ^
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 528 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -