Submission #641066

# Submission time Handle Problem Language Result Execution time Memory
641066 2022-09-15T22:50:22 Z ivaziva Awesome Arrowland Adventure (eJOI19_adventure) C++14
0 / 100
1 ms 300 KB
#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
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 296 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -