제출 #100520

#제출 시각아이디문제언어결과실행 시간메모리
100520salepark보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#include "treasure.h" void findTreasure (int N) { int cnt = countTreasure(1, 1, N, N); if (cnt == 0) return; else if (cnt == N * N) { for (int i = 1; i <= N; i++) { for (int j = 1; j <= N; j++) { Report(i, j); } } } else go(1, 1, N / 2); } void go(int a, int b, int N) { if (N == 0) { return; } int n = countTreasure(a, b, a - 1 + N, b - 1 + N); if (n == N*N) { for (int i = a; i < a + N; i++) { for (int j = b; j < b + N; j++) { Report(i, j); } } } else { go(a, b, N / 2); } n = countTreasure(a, b + N, a - 1 + N, b - 1 + (2 * N)); if (n == (N*N) / 4) { for (int i = a; i < a + N; i++) { for (int j = b + N; j < b + (2 * N); j++) { Report(i, j); } } } else go(a, b + N, N / 2); n = countTreasure(a + N, b, a - 1 + (2 * N), b - 1 + N); if (n == N*N) { for (int i = a + N; i < a + (2 * N); i++) { for (int j = b; j < b + N; j++) { Report(i, j); } } } else go(a + N, b, N / 2); n = countTreasure(a + N, b + N, a - 1 + (2 * N), b - 1 + (2 * N)); if (n == N*N) { for (int i = a + N; i < a + (2 * N); i++) { for (int j = b + N; j < b + (2 * N); j++) { Report(i, j); } } } else go(a + N, b + N, N / 2); }

컴파일 시 표준 에러 (stderr) 메시지

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:12:7: error: 'go' was not declared in this scope
  else go(1, 1, N / 2);
       ^~