| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 125006 | gs14004 | Nautilus (BOI19_nautilus) | C++17 | 213 ms | 1016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 505;
int n, m, k;
bitset<MAXN> dp[MAXN], nxt[MAXN], grid[MAXN];
char str[MAXN][MAXN];
int main(){
scanf("%d %d %d",&n,&m,&k);
for(int i=0; i<n; i++){
scanf("%s", str[i]);
for(int j=0; j<m; j++){
if(str[i][j] == '.') grid[i].set(j);
}
dp[i] = grid[i];
}
string q; cin >> q;
for(auto &i : q){
for(int j=0; j<n; j++) nxt[j] = 0;
if(i == 'W' || i == '?'){
for(int j=0; j<n; j++) nxt[j] |= (dp[j] >> 1);
}
if(i == 'E' || i == '?'){
for(int j=0; j<n; j++) nxt[j] |= (dp[j] << 1);
}
if(i == 'N' || i == '?'){
for(int j=1; j<n; j++) nxt[j-1] |= dp[j];
}
if(i == 'S' || i == '?'){
for(int j=1; j<n; j++) nxt[j] |= dp[j-1];
}
for(int j=0; j<n; j++) dp[j] = nxt[j] & grid[j];
}
int ret = 0;
for(int j=0; j<n; j++) ret += dp[j].count();
cout << ret << endl;
}
컴파일 시 표준 에러 (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... | ||||
