Submission #210041

# Submission time Handle Problem Language Result Execution time Memory
210041 2020-03-16T13:07:34 Z AlainSu ICC (CEOI16_icc) C++14
Compilation error
0 ms 0 KB
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
 
int H, W, N;
string S;
bitset<512> K[512], L[512], M[512], I;
 
int main() {
	cin >> H >> W >> N;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			char c; cin >> c;
			if (c == '.') K[i].set(j);
		}
		L[i] = K[i];
	}
	cin >> S;
	
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < H; j++) M[j] = I;
 
		if (S[i] == 'E' || S[i] == '?') {
			for (int j = 0; j < H; j++) {
				M[j] |= (K[j] << 1);
			}
		}
		if (S[i] == 'W' || S[i] == '?') {
			for (int j = 0; j < H; j++) {
				M[j] |= (K[j] >> 1);
			}
		}
		if (S[i] == 'N' || S[i] == '?') {
			for (int j = 1; j < H; j++) {
				M[j - 1] |= K[j];
			}
		}
		if (S[i] == 'S' || S[i] == '?') {
			for (int j = 0; j < H - 1; j++) {
				M[j + 1] |= K[j];
			}
		}
		for (int j = 0; j < H; j++) {
			M[j] &= L[j];
		}
		for (int j = 0; j < H; j++) K[j] = M[j];
	}
 
	int cnt = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (K[i][j] == 1) cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}

Compilation message

/tmp/cciahBAy.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccW9Q36v.o:icc.cpp:(.text.startup+0x0): first defined here
/tmp/cciahBAy.o: In function `main':
grader.cpp:(.text.startup+0x1d): undefined reference to `run'
collect2: error: ld returned 1 exit status