답안 #860177

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
860177 2023-10-12T03:40:08 Z maks007 Nautilus (BOI19_nautilus) C++14
29 / 100
3 ms 444 KB
#include "bits/stdc++.h"

using namespace std;

signed main () {
	int n, m, c;
	cin >> n >> m >> c;
	string a[n];
	for(int i = 0; i < n; i ++) {
		cin >> a[i];
	}
	string str;
	function <int(int,int)> check=[&](int i, int j) {
		for(int ii = 0; ii < c; ii ++) {
			if(str[ii] == 'W') j --;
			else if(str[ii] == 'E') j ++;
			else if(str[ii] == 'S') i ++;
			else i --;
			if(j < 0 || i < 0 || i >= n || j >= m ||( a[i][j] == '#')) return 0;
		}
		return 1;
	};
	cin >> str;
	int ans = 0;
	for(int i = 0; i < n; i ++) {
		for(int j = 0; j < m; j ++) {
			if(a[i][j] == '.') ans += check(i, j);
		}
	}
	cout << ans;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 444 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 444 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Incorrect 3 ms 344 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 444 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Incorrect 3 ms 344 KB Output isn't correct
8 Halted 0 ms 0 KB -