Submission #983874

# Submission time Handle Problem Language Result Execution time Memory
983874 2024-05-16T07:36:12 Z Nomio Awesome Arrowland Adventure (eJOI19_adventure) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int m, n;
	cin >> m >> n;
	string s[m];
	for(int i = 0; i < m; i++) {
		cin >> s[i];
	}
	map<pair<char, char>, int> M;
	M[{'N', 'E'}] = 1;
	M[{'E', 'S'}] = 1;
	M[{'S', 'W'}] = 1;
	M[{'W', 'N'}] = 1;
	M[{'N', 'S'}] = 2;
	M[{'E', 'W'}] = 2;
	M[{'S', 'N'}] = 2;
	M[{'W', 'E'}] = 2;
	M[{'N', 'W'}] = 3;
	M[{'E', 'N'}] = 3;
	M[{'S', 'E'}] = 3;
	M[{'W', 'S'}] = 3;
	if(m == 1) {
		bool w = 1;
		int S = 0;
		for(int i = 0; i < n; i++) {
			if(s[0][i] == 'x') {
				w = 0;
				break;
			}
			if(s[0][i] != 'E') {
				S += M[{s[0][i], 'E'}];
			}
		}
		cout << S << '\n';
	}
	return 0;
}

Compilation message

adventure.cpp: In function 'int main()':
adventure.cpp:26:8: warning: variable 'w' set but not used [-Wunused-but-set-variable]
   26 |   bool w = 1;
      |        ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -