Submission #72293

#TimeUsernameProblemLanguageResultExecution timeMemory
72293인프라웨어 상한가 가주세요. 물렸어요 (#118)Magic Dowsing (FXCUP3_magic)C++17
0 / 100
2 ms528 KiB
#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 (stderr)

dowsing.cpp: In function 'void FindTreasure(int)':
dowsing.cpp:12:10: warning: statement has no effect [-Wunused-value]
    calSol;
          ^
#Verdict Execution timeMemoryGrader output
Fetching results...