| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366995 | lizi14 | Nautilus (BOI19_nautilus) | C++20 | 2 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define ss second
#define pb push_back
#define ina insert
signed main(){
int n,m,k;
cin>>n>>m>>k;
char x[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>x[i][j];
}
}
string s;
cin>>s;
int ans=0;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(x[i][j]=='#')continue;
int hi=0;
int a1=0,b1=0;
for(int h=0; h<k; h++){
if(s[h]=='N')a1--;
if(s[h]=='E')b1++;
if(s[h]=='S')a1++;
if(s[h]=='W')b1--;
//cout<<s[h]<<" "<<a1<<" "<<b1<<endl;
if(i+a1<n && i+a1>=0 && j+b1>=0 && j+b1<m){
//continue;
//cout<<x[i+a1][j+b1]<<" "<<i<<" "<<a1<<" "<<b1<<endl;
if(x[i+a1][j+b1]!='#')continue;
else {
hi=1;
break;
}
}
else{
hi=1;
break;
}
}
if(hi==0){
//cout<<i<<" "<<j<<endl;
ans++;
}
}
}
cout<<ans<<endl;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
