| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 489145 | ak2006 | Nautilus (BOI19_nautilus) | C++14 | 1092 ms | 972 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#pragma GCC optimize("Ofast")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
int main()
{
    fast;
    int r,c,m;
    cin>>r>>c>>m;
    char g[r + 1][c + 1];
    bool dp[r + 2][c + 2][2];
    memset(dp,false,sizeof(dp));
    for (int i = 1;i<=r;i++)
        for (int j = 1;j<=c;j++)
            cin>>g[i][j],dp[i][j][0] = (g[i][j] != '#');
    string s;
    cin>>s;
    int ans = 0;
    for (int t = 1;t<=m;t++){
        for (int i = 1;i<=r;i++){
            for (int j = 1;j<=c;j++){
                if (g[i][j] == '#')continue;
                if (s[t - 1] == 'E')
                    dp[i][j][t&1] = dp[i][j - 1][(t - 1)&1];
                else if (s[t - 1] == 'W')
                    dp[i][j][t&1] = dp[i][j + 1][(t - 1)&1];
                else if (s[t - 1] == 'N')
                    dp[i][j][t&1] = dp[i + 1][j][(t - 1)&1];
                else if (s[t - 1] == 'S')
                    dp[i][j][t&1] = dp[i - 1][j][(t - 1)&1];
                else dp[i][j][t&1] = dp[i - 1][j][(t - 1)&1] or 
                    dp[i + 1][j][(t - 1)&1] or
                dp[i][j + 1][(t - 1)&1] or dp[i][j - 1][(t - 1)&1];
                if (t == m)
                    ans += dp[i][j][t&1];
            }
        }
    }
    cout<<ans;
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
