/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./src/AGC043/A.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/AGC043/A.js":
/*!*************************!*\
  !*** ./src/AGC043/A.js ***!
  \*************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ \"fs\");\n/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\nvar P = {};\nvar INF = 1001001001; // 上,左,下,右\n\nvar di = [-1, 0, 1, 0];\nvar dj = [0, -1, 0, 1];\n\nfunction createAndFillTwoDArray(_ref) {\n  var rows = _ref.rows,\n      columns = _ref.columns,\n      defaultValue = _ref.defaultValue;\n  return Array.from({\n    length: rows\n  }, function () {\n    return Array.from({\n      length: columns\n    }, function () {\n      return defaultValue;\n    });\n  });\n}\n\nfunction Pair(first, second) {\n  this.first = first;\n  this.second = second;\n}\n\nvar main = function main(input) {\n  var lines = input.split('\\n');\n\n  var _lines$0$split$map = lines[0].split(' ').map(function (i) {\n    return i - 0;\n  }),\n      _lines$0$split$map2 = _slicedToArray(_lines$0$split$map, 2),\n      H = _lines$0$split$map2[0],\n      W = _lines$0$split$map2[1];\n\n  var s = [];\n\n  for (var i = 0; i < H; i++) {\n    var cur = i + 1;\n    s[i] = lines[cur].split('');\n  }\n\n  var ans = 0;\n  var dist = createAndFillTwoDArray({\n    rows: H,\n    columns: W,\n    defaultValue: INF\n  });\n  var q = [];\n\n  var update = function update(i, j, x) {\n    if (dist[i][j] !== INF) {\n      dist[i][j] = Math.min(x, dist[i][j]);\n      return;\n    }\n\n    dist[i][j] = x;\n    q.push(new Pair(i, j));\n  };\n\n  update(0, 0, s[0][0] === '#' ? 1 : 0);\n\n  for (var si = 0; si < H; si++) {\n    for (var sj = 0; sj < W; sj++) {\n      while (q.length) {\n        var _i2 = q[0].first;\n        var j = q[0].second;\n        q.shift();\n\n        for (var dir = 0; dir < 4; dir++) {\n          var ni = _i2 + di[dir],\n              nj = j + dj[dir];\n          if (ni < 0 || ni >= H || nj < 0 || nj >= W) continue;\n\n          if (s[ni][nj] == '#') {\n            if (s[_i2][j] === '#') {\n              update(ni, nj, dist[_i2][j]);\n            } else {\n              update(ni, nj, dist[_i2][j] + 1);\n            }\n          } else {\n            update(ni, nj, dist[_i2][j]);\n          }\n        }\n      }\n    }\n  }\n\n  console.log(dist[H - 1][W - 1]);\n};\n\nmain(fs__WEBPACK_IMPORTED_MODULE_0__[\"readFileSync\"]('/dev/stdin', 'utf8'));\n\n//# sourceURL=webpack:///./src/AGC043/A.js?");

/***/ }),

/***/ "fs":
/*!*********************!*\
  !*** external "fs" ***!
  \*********************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = require(\"fs\");\n\n//# sourceURL=webpack:///external_%22fs%22?");

/***/ })

/******/ });

Measured memory_bytes: 8908