{"provider_url":"https://hatena.blog","published":"2014-08-24 09:43:11","description":"\u89e3\u6cd5 \u4e00\u884c\u76ee\u306e\u8272\u306f\u9069\u5f53\u306b\u6c7a\u5b9a\u3057\u3066\u69cb\u308f\u306a\u3044\u3002\u4e00\u884c\u76ee\u306e\u6c7a\u5b9a\u306b\u5f93\u3046\u5f62\u3067\u4e8c\u884c\u76ee\u4ee5\u964d\u306f\u7e70\u308a\u8fd4\u3057\u306b\u8272\u304c\u5b9a\u307e\u3063\u3066\u3044\u304f\u3002\u3053\u308c\u306f\u87fb\u672c\u306e\u53cd\u8ee2\u3068\u540c\u3058\u8981\u9818\u306e\u8003\u3048\u65b9\u3002\u4eca\u3001\u8272\u3092\u6c7a\u3081\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u5834\u6240 (j, i) \u306f\u3001\u65e2\u306b\u6c7a\u5b9a\u3057\u305f\u4e0a\u306e\u30de\u30b9 (j, i-1) \u306e\u8272\u304c\u6210\u7acb\u3059\u308b\u3088\u3046\u306b\u5e33\u5c3b\u3092\u5408\u308f\u305b\u308b\u8272\u306b\u6c7a\u3081\u308b\u3002O(N^2) #include <iostream> using namespace std; int dx[] = {-1,0,1,0}; int dy[] = {0,-1,0,1}; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,\u2026","type":"rich","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140824%2F1408840991\" title=\"\u5929\u4e0b\u4e00\u4e88\u9078B C - \u5929\u4e0b\u4e00\u738b\u56fd\u306e\u6b74\u53f2 - Logfiles\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://logfiles.hatenablog.com/entry/20140824/1408840991","author_url":"https://blog.hatena.ne.jp/moistx/","title":"\u5929\u4e0b\u4e00\u4e88\u9078B C - \u5929\u4e0b\u4e00\u738b\u56fd\u306e\u6b74\u53f2","author_name":"moistx","categories":[],"provider_name":"Hatena Blog","blog_title":"Logfiles","blog_url":"https://logfiles.hatenablog.com/","width":"100%","height":"190","image_url":null}