#include <bits/stdc++.h>
#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define co cout<<
//#pragma GCC optimize("O3,Ofast,unroll-loops")
//#pragma GCC target("avx2,sse3,sse4,avx")
using namespace std;
//stuff
ll n,m,q;
string s[105];
string que;
void solve(){
cin>>n>>m>>q;
for(int i=0;i<n;i++) cin>>s[i];
cin>>que;
ll cnt=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
ll x,y,idx;
x=i,y=j,idx=0;
while(x<n&&x>-1&&y<m&&y>-1&&s[x][y]!='#'&&idx<q){
if(que[idx]=='W') x--;
else if(que[idx]=='S') x++;
else if(que[idx]=='E') y++;
else y--;
}
if(idx==q) cnt++;
}
}
co cnt<<'\n';
}
int main()
{
suiii
int tt=1;
// cin>>tt;
while(tt--){
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |