Submission #889995

#TimeUsernameProblemLanguageResultExecution timeMemory
889995vjudge1Nautilus (BOI19_nautilus)C++17
0 / 100
1 ms344 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n,m,k,l,r,u,d,cnt; int main() { cin>>n>>m>>k; string s; char map[200][200]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>map[i][j]; } } cin>>s; for(int i=0;i<k;i++){ if(s[i]=='N'){ u++; } if(s[i]=='S'){ d++; } if(s[i]=='W'){ l++; } else if(s[i]=='E'){ r++; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(map[i-l+r][j-u+d]=='.'){ cnt++; } } } cout<<cnt+1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...