Submission #975432

# Submission time Handle Problem Language Result Execution time Memory
975432 2024-05-05T06:59:26 Z vjudge1 Awesome Arrowland Adventure (eJOI19_adventure) C++
0 / 100
1 ms 348 KB
#include <iostream>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    if(n==1&& m==1){
        cout<<0;
        return 0;
    }
        string s;

    if(n==1){
        cin>>s;
        int ans=0;
        for (int i = 0; i < m-1; i++)
        {
            if(s[i]=='X'){
                cout<<-1;
                return 0;
            }else{
                if(s[i]=='N') ans++;
                if(s[i]=='S') ans+=3;
                if(s[i]=='W')ans+=2;
            }
        }
        
    }
    cout<<s.length();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -