# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72305 | 인프라웨어 상한가 가주세요. 물렸어요 (#118) | 마법 다우징 (FXCUP3_magic) | C++17 | 2 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 = false;
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 = true;
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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |