# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
206765 | DodgeBallMan | Nautilus (BOI19_nautilus) | C++14 | 189 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 5e2 + 10;
int r, c, k, ans;
bitset<N> dp[N], a[N];
char s[N*10];
int main()
{
scanf("%d %d %d",&r,&c,&k);
for( int i = 0 ; i < r ; i++ ) {
char t[N];
scanf("%s",t);
for( int j = 0 ; j < c ; j++ ) {
dp[i][j] = a[i][j] = ( t[j] == '.' );
}
}
scanf("%s",s);
for( int i = 0 ; i < k ; i++ ) {
bitset<N> tmp[N];
for( int j = 0 ; j < r ; j++ ) tmp[j].reset();
if( s[i] == 'S' || s[i] == '?' ) for( int j = 1 ; j < r ; j++ ) tmp[j] |= dp[j-1];
if( s[i] == 'N' || s[i] == '?' ) for( int j = 0 ; j < r - 1 ; j++ ) tmp[j] |= dp[j+1];
if( s[i] == 'W' || s[i] == '?' ) for( int j = 0 ; j < r ; j++ ) tmp[j] |= dp[j] >> 1;
if( s[i] == 'E' || s[i] == '?' ) for( int j = 0 ; j < r ; j++ ) tmp[j] |= dp[j] << 1;
for( int j = 0 ; j < r ; j++ ) dp[j] = tmp[j] & a[j];
}
for( int i = 0 ; i < r ; i++ ) ans += dp[i].count();
printf("%d",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... |