답안 #242855

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
242855 2020-06-29T12:37:37 Z oolimry Nautilus (BOI19_nautilus) C++14
29 / 100
5 ms 640 KB
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 101;
bitset<MAXN> cur[MAXN];
bitset<MAXN> walls[MAXN];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	
	int rows, cols, K; cin >> rows >> cols >> K;
	
	for(int r = 0;r < rows;r++){
		string s; cin >> s;
		for(int c = 0;c < cols;c++){
			int bit = (s[c] == '.');
			cur[r][c] = bit;
			walls[r][c] = bit;
		}
	}
	
	string command; cin >> command;
	for(char c : command){
		
		
		if(c == 'W'){
			for(int r = 0;r < rows;r++) cur[r] >>= 1;
		}
		if(c == 'E'){
			for(int r = 0;r < rows;r++) cur[r] <<= 1;
		}
		if(c == 'N'){
			for(int r = 0;r < rows-1;r++) cur[r] = cur[r+1];
			for(int c = 0;c < cols;c++) cur[rows-1][c] = 0;
		}
		if(c == 'S'){
			for(int r = rows-1;r >= 1;r--) cur[r] = cur[r-1];
			for(int c = 0;c < cols;c++) cur[0][c] = 0;
		}
		if(c == '?'){
			assert(false);
		}
		
		
		for(int r = 0;r < rows;r++) cur[r] &= walls[r];
	}
	
	int ans = 0;
	for(int r = 0;r < rows;r++){
		for(int c = 0;c < cols;c++){
			ans += cur[r][c];
		}
	}
	
	cout << ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Halted 0 ms 0 KB -