This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,m;
cin>>n>>m;
char matrica[n+10][m+10];
for (long long i=1;i<=n;i++)
{
for (long long j=1;j<=m;j++)
{
cin>>matrica[i][j];
}
}
long long rez=0;
for (long long i=1;i<=m;i++)
{
if (matrica[1][i]=='X')
{
rez=-1;
break;
}
else
{
if (matrica[1][i]=='N') rez++;
else if (matrica[1][i]=='W') rez+=2;
else if (matrica[1][i]=='S') rez+=3;
}
}
cout<<rez<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |