제출 #522212

#제출 시각아이디문제언어결과실행 시간메모리
522212blueNautilus (BOI19_nautilus)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <bitset> using namespace std; const int mx = 10; int main() { bitset<(mx+2) * (mx+2)> grid, DP0, DP1; grid.reset(); int R, C, M; cin >> R >> C >> M; for(int i = 1; i <= R; i++) { for(int j = 1; j <= C; j++) { char c; cin >> c; if(c == '.') grid.set((mx+2) * i + j); } } // cerr << "\n"; // for(int i = 0; i < (mx+2)*(mx+2); i++) // { // cerr << grid[i] << ' '; // if(i % (mx+2) == mx+1) cerr << '\n'; // } string S; cin >> S; reverse(S.begin(), S.end()); DP0 = grid; for(char c : S) { // cerr << "\n\n\n c = " << c << '\n'; DP1 = DP0; // for(int i = 0; i < (mx+2)*(mx+2); i++) // { // cerr << DP1[i] << ' '; // if(i % (mx+2) == mx+1) cerr << '\n'; // } // cerr << "-----\n"; if(c == 'N') DP1 >>= (mx+2); else if(c == 'S') DP1 <<= (mx+2); else if(c == 'W') DP1 >>= 1; else if(c == 'E') DP1 <<= 1; DP1 &= grid; // for(int i = 0; i < (mx+2)*(mx+2); i++) // { // cerr << DP1[i] << ' '; // if(i % (mx+2) == mx+1) cerr << '\n'; // } swap(DP0, DP1); } cout << DP0.count() << '\n'; }

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

nautilus.cpp: In function 'int main()':
nautilus.cpp:42:2: error: 'reverse' was not declared in this scope
   42 |  reverse(S.begin(), S.end());
      |  ^~~~~~~