제출 #783944

#제출 시각아이디문제언어결과실행 시간메모리
783944Boas동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; map<vi, int> tryCombi; int ownTryCombination(vi &switches) { cerr << endl << "TryCombination: "; for (int t : switches) { cerr << t << " "; } cerr << endl; int res; if (tryCombi.find(switches) != tryCombi.end()) { res = tryCombi[switches]; } else { res = tryCombination(switches.data()); tryCombi[switches] = res; } cerr << "Result: " << res << endl; return res; } void exploreCave(int N) { vi switches(N, 0); vi minDist(N); vi maxDist(N, N); int d = ownTryCombination(switches); int nd = 0; int iter = 0; while (d != -1) { if (nd == -1) break; for (int i = 0; i < N; i++) { iter++; if (iter > 500) { cerr << 'a'; } if (minDist[i] > nd) { continue; } if (minDist[i] == maxDist[i]) continue; switches[i] = !switches[i]; nd = ownTryCombination(switches); if (nd == -1) break; if (nd == d) { cerr << "minDist[" << i << "] = " << d + 1 << endl; minDist[i] = d + 1; switches[i] = !switches[i]; d = nd; } else if (nd > d) { cerr << "min&maxDist[" << i << "] = " << d << endl; minDist[i] = d; maxDist[i] = d; d = nd; } else { cerr << "min&maxDist[" << i << "] = " << nd << endl; minDist[i] = nd; maxDist[i] = nd; switches[i] = !switches[i]; // i--; } } if (nd == -1) break; } for (int i = 0; i < N; i++) { if (minDist[i] == maxDist[i]) continue; switches[i] = !switches[i]; int d = ownTryCombination(switches); minDist[i] = d; maxDist[i] = d; switches[i] = !switches[i]; } answer(switches.data(), minDist.data()); cerr << endl; }

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

cave.cpp: In function 'int ownTryCombination(vi&)':
cave.cpp:24:15: error: 'tryCombination' was not declared in this scope; did you mean 'ownTryCombination'?
   24 |         res = tryCombination(switches.data());
      |               ^~~~~~~~~~~~~~
      |               ownTryCombination
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:96:5: error: 'answer' was not declared in this scope
   96 |     answer(switches.data(), minDist.data());
      |     ^~~~~~