Submission #633703

#TimeUsernameProblemLanguageResultExecution timeMemory
633703devvopsAwesome Arrowland Adventure (eJOI19_adventure)C++17
0 / 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]; for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ cin >> a[i][j]; } } for(int i = 1; i <= n; i++){ if(a[i][1] == 'X' && i != n){ cout << -1; return 0; } if(a[i][1] == 'E') ans++; else if(a[i][1] == 'S') ans = ans; else if(a[i][1] == 'W') ans += 3; else if(a[i][1] == 'N') ans += 2; } 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...