제출 #1195842

#제출 시각아이디문제언어결과실행 시간메모리
1195842sheina906Awesome Arrowland Adventure (eJOI19_adventure)C++20
10 / 100
0 ms328 KiB
#include <bits/stdc++.h>
using namespace std;


int main()
{
    int n, m; cin >> n >> m;
    string s; cin >> s; s.pop_back();
    int ans = 0;
    bool pos = true;
    for (char c : s) 
    {
        ans += (c == 'W' ? 2 : (c == 'S' || c == 'N' ? 1 : 0));
        if (c == 'X') pos = false;;
    }

    cout << (pos ? ans : -1) << '\n';


    return 0;
}


// int main()
// {
//     int n, m, k; cin >> n >> m;
//     vector<string> g(n);
//     for (string &s : g) cin >> s;
//     vector<vector<vector<int>>> dp(n, vector<vector<int>> (m, vector<int> (k)));

// }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...