| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367211 | po_rag526 | Nautilus (BOI19_nautilus) | C++20 | 1 ms | 344 KiB |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int r, c, m;
cin>>r>>c>>m;
vector<string>a(r);
for(int i=0; i<r; i++)
{
cin>>a[i];
}
string s;
cin>>s;
int ans=0;
for(int i=0; i<r; i++)
{
for(int j=0; j<c; j++)
{
if(a[i][j]=='#') continue;
int x=i, y=j; int l=0;
for(int k=0; k<m; k++)
{
if(s[k]=='N') x--;
else if(s[k]=='S') x++;
else if(s[k]=='E') y++;
else y--;
if(x<0 || x>=r || y<0 || y>=c || a[x][y]=='#')
{
l=-1; break;
}
}
if(l==0) ans++;
}
}
cout<<ans<<endl;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
