답안 #834163

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
834163 2023-08-22T11:25:04 Z TheSahib Nautilus (BOI19_nautilus) C++14
컴파일 오류
0 ms 0 KB
#pragma GCC optimize("O3");
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define oo 1e9
#define pii pair<int, int>

using namespace std;

int n, m, q;
const int MAX = 505;

bitset<MAX * MAX> st, can;

int main()
{
    cin >> n >> m >> q;
    for (int i = 0; i < n; i++)
    {
        string s; cin >> s;
        can[i * (m + 2)] = 0;
        can[(i + 1) * (m + 2) - 1] = 0;
        for (int j = 1; j <= m; j++)
        {
            can[i * (m + 2) + j] = s[j - 1] == '.';
        }
    }
    st = can;
    string s; cin >> s;
    for (int i = 0; i < q; i++)
    {
        if(s[i] == 'W'){
            st >>= 1;
        }
        else if(s[i] == 'S'){
            st <<= m + 2;
        }
        else if(s[i] == 'E'){
            st <<= 1;
        }
        else if(s[i] == 'N'){
            st >>= m + 2;
        }
        else{
            st = (st << 1) | (st >> 1) | (st << (m + 2)) | (st >> (m + 2));
        }
        st &= can;
    }
    cout << st.count() << '\n';
}

Compilation message

nautilus.cpp:1:27: error: '#pragma GCC optimize' string is badly formed
    1 | #pragma GCC optimize("O3");
      |                           ^