Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int MAXN = 75;
- char maze[MAXN][MAXN + 3];
- int vis[MAXN][MAXN][2];
- int C, F;
- int ncycles;
- int longest; // length of longest cycle
- struct Pos {
- int f, c, h;
- };
- bool connected(Pos a, Pos b) {
- if (a.c > b.c || a.f > b.f) {
- swap(a, b);
- }
- if (maze[a.c][a.f] == '/') {
- if (b.c == a.c + 1) {
- return a.h == 0 && b.h == 1;
- }
- if (b.f == a.f + 1) {
- return a.h == 0;
- }
- } else {
- if (b.c == a.c + 1) {
- return a.h == 0 && b.h = 1;
- }
- if (b.f == a.f + 1) {
- return a.h == 1 && b.h == 1;
- }
- }
- return false;
- }
- bool inside(int f, int c) {
- return 0 <= f && f < F && 0 <= c && c < C;
- }
- void dfs(int f, int c, int h) {
- for (int df = -1; df <= 1; df++) {
- for (int dc = -1; dc <= 1; dc++) {
- for (int h = 0; h < 2; h++) {
- }
- }
- }
- }
- void solve() {
- for (int f = 0; f < F; f++) {
- for (int c = 0; c < C; c++) {
- for (int h = 0; h < 2; h++) {
- if (vis[f][c][h] == 0) {
- dfs(f, c, h);
- }
- }
- }
- }
- }
- int main() {
- while (cin >> C >> F, C != 0 && F != 0) {
- for (int f = 0; f < F; f++) {
- cin >> maze[f];
- }
- ncycles = 0;
- longest = 0;
- solve();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement