# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
419882 | nicolaalexandra | Nautilus (BOI19_nautilus) | C++14 | 178 ms | 716 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define DIM 510
using namespace std;
char v[DIM*10],s[DIM];
int n,m,k,i,j;
bitset <DIM> a[2][DIM],mask[DIM];
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n>>m>>k;
for (i=1;i<=n;i++){
cin>>s+1;
for (j=1;j<=m;j++)
if (s[j] == '.')
mask[i][j] = 1;
a[0][i] = mask[i];
}
cin>>v+1;
int t = 1;
for (int pas=1;pas<=k;pas++){
for (i=1;i<=n;i++)
a[t][i].reset();
for (i=1;i<=n;i++){
if (v[pas] == 'N' || v[pas] == '?')
a[t][i] |= a[1-t][i+1];
if (v[pas] == 'S' || v[pas] == '?')
a[t][i] |= a[1-t][i-1];
if (v[pas] == 'E' || v[pas] == '?')
a[t][i] |= (a[1-t][i] << 1);
if (v[pas] == 'W' || v[pas] == '?')
a[t][i] |= (a[1-t][i] >> 1);
a[t][i] &= mask[i];
}
t = 1-t;
}
int sol = 0;
for (i=1;i<=n;i++)
for (j=1;j<=m;j++)
sol += a[1-t][i][j];
cout<<sol;
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... |