Submission #633705

#TimeUsernameProblemLanguageResultExecution timeMemory
633705devvopsAwesome Arrowland Adventure (eJOI19_adventure)C++17
10 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define F first #define S second #define ll long long #define ull unsigned long long #define all(x) x.begin(), x.end() #define speed ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL) #define file freopen("palindrome.in", "r", stdin), freopen("palindrome.out", "w", stdout); int main() { speed; int n, m, ans = 0; cin >> n >> m; char a[n + 10][m + 10]; bool f = 0; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ cin >> a[i][j]; if(a[i][j] == 'X' && j != m){ f = 1; } } } if(f){ cout << -1; } else{ for(int i = 1; i <= m; i++){ if(a[1][m] == 'E') ans = ans; else if(a[1][m] == 'S') ans += 3; else if(a[1][m] == 'W') ans += 2; else if(a[1][m] == 'N') ans++; } cout << ans; } }
#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...