제출 #453770

#제출 시각아이디문제언어결과실행 시간메모리
453770myvaluskaAwesome Arrowland Adventure (eJOI19_adventure)C++14
0 / 100
1 ms204 KiB
#include <iostream> #include <vector> #include <string> #include <set> #include <cmath> #include <tuple> using namespace std; /*long long int power(long long int n, int k) { long long int vys = 1; for (int i = 0; i < k; i++) { vys = (vys * (n - i)) / (i + 1); } return vys; }*/ int main() { /*for (int i = 0; i < 10; i++) { std::cout << "Hello Flash!\n"; }*/ int n, m; cin >> n >> m; vector<vector<char>>v(m, vector<char>(n)); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> v[i][j]; } } if (m == 1) { int move = 0; for (int i = 0; i < n-1; i++) { if (v[0][i] == 'X') { cout << -1 << endl; return 0; } if (v[0][i] == 'S') { move += 1; } if (v[0][i] == 'N') { move += 1; } if (v[0][i] == 'W') { move += 2; } } cout << move << endl; } return 0; }
#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...