{"action":"created","issue":{"url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/17","repository_url":"https://api.github.com/repos/TakeumiYamamura/programming_contest","labels_url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/17/comments","events_url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/17/events","html_url":"https://github.com/TakeumiYamamura/programming_contest/issues/17","id":185051301,"number":17,"title":"AtCoder Beginner Contest 007","user":{"login":"TakeumiYamamura","id":7766684,"avatar_url":"https://avatars.githubusercontent.com/u/7766684?v=3","gravatar_id":"","url":"https://api.github.com/users/TakeumiYamamura","html_url":"https://github.com/TakeumiYamamura","followers_url":"https://api.github.com/users/TakeumiYamamura/followers","following_url":"https://api.github.com/users/TakeumiYamamura/following{/other_user}","gists_url":"https://api.github.com/users/TakeumiYamamura/gists{/gist_id}","starred_url":"https://api.github.com/users/TakeumiYamamura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakeumiYamamura/subscriptions","organizations_url":"https://api.github.com/users/TakeumiYamamura/orgs","repos_url":"https://api.github.com/users/TakeumiYamamura/repos","events_url":"https://api.github.com/users/TakeumiYamamura/events{/privacy}","received_events_url":"https://api.github.com/users/TakeumiYamamura/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-25T08:31:28Z","updated_at":"2016-11-21T09:00:02Z","closed_at":null,"body":"http://abc007.contest.atcoder.jp/\n"},"comment":{"url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/comments/261880634","html_url":"https://github.com/TakeumiYamamura/programming_contest/issues/17#issuecomment-261880634","issue_url":"https://api.github.com/repos/TakeumiYamamura/programming_contest/issues/17","id":261880634,"user":{"login":"TakeumiYamamura","id":7766684,"avatar_url":"https://avatars.githubusercontent.com/u/7766684?v=3","gravatar_id":"","url":"https://api.github.com/users/TakeumiYamamura","html_url":"https://github.com/TakeumiYamamura","followers_url":"https://api.github.com/users/TakeumiYamamura/followers","following_url":"https://api.github.com/users/TakeumiYamamura/following{/other_user}","gists_url":"https://api.github.com/users/TakeumiYamamura/gists{/gist_id}","starred_url":"https://api.github.com/users/TakeumiYamamura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakeumiYamamura/subscriptions","organizations_url":"https://api.github.com/users/TakeumiYamamura/orgs","repos_url":"https://api.github.com/users/TakeumiYamamura/repos","events_url":"https://api.github.com/users/TakeumiYamamura/events{/privacy}","received_events_url":"https://api.github.com/users/TakeumiYamamura/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T09:00:02Z","updated_at":"2016-11-21T09:00:02Z","body":"## 問題\r\n\r\n[http://abc007.contest.atcoder.jp/tasks/abc007_3:embed:cite]\r\n\r\n\r\n## note\r\n普通にキューつかって幅優先するだけ\r\n\r\n``` .cc\r\n#include <iostream>\r\n#include <vector>\r\n#include <string>\r\n#include <queue>\r\nusing namespace std;\r\n\r\nstruct Point\r\n{\r\n\tint x, y;\r\n};\r\n\r\nclass Bfs\r\n{\r\npublic:\r\n\tint r, c;\r\n\tPoint s, g;\r\n\tvector<vector<bool> > map;\r\n\tvector<vector<int> > cost;\r\n\tBfs();\r\n\t~Bfs();\r\n\tvoid exec();\r\n\t\r\n};\r\n\r\n\r\nBfs::Bfs(){\r\n\tcin >> r >> c;\r\n\tcin >> s.y >> s.x;\r\n\tcin >> g.y >> g.x;\r\n\ts.x--;\r\n\ts.y--;\r\n\tg.y--;\r\n\tg.x--;\r\n\tmap.resize(r);\r\n\tcost.resize(r);\r\n\tfor (int i = 0; i < r; ++i)\r\n\t{\r\n\t\tmap[i].resize(c);\r\n\t\tcost[i].resize(c);\r\n\t\tstring tmp;\r\n\t\tcin >> tmp;\r\n\t\tfor (int j = 0; j < c; ++j)\r\n\t\t{\r\n\t\t\tif(tmp[j] == '#'){\r\n\t\t\t\tmap[i][j] = false;\r\n\t\t\t}else{\r\n\t\t\t\tmap[i][j] = true;\r\n\t\t\t}\r\n\t\t\tcost[i][j] = -1;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nBfs::~Bfs(){}\r\n\r\nvoid Bfs::exec(){\r\n\tqueue<Point> q;\r\n\tq.push(s);\r\n\tcost[s.y][s.x] = 0;\r\n\twhile(!q.empty()){\r\n\t\tPoint tmp = q.front();\r\n\t\tq.pop();\r\n\t\t// cout << \"x, y \" << tmp.x << \" \"<< tmp.y << endl; \r\n\t\t// cout << cost[tmp.y][tmp.x] << endl;\r\n\t\tif(cost[g.y][g.x] != -1){\r\n\t\t\tcout << cost[g.y][g.x] << endl;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(map[tmp.y+1][tmp.x] && cost[tmp.y+1][tmp.x] == -1){\r\n\t\t\tPoint next = {tmp.x, tmp.y+1};\r\n\t\t\tq.push(next); \r\n\t\t\tcost[tmp.y+1][tmp.x] = cost[tmp.y][tmp.x] + 1;\r\n\t\t}\r\n\t\tif(map[tmp.y][tmp.x+1] && cost[tmp.y][tmp.x+1] == -1){\r\n\t\t\tPoint next = {tmp.x+1, tmp.y};\r\n\t\t\tq.push(next); \r\n\t\t\tcost[tmp.y][tmp.x+1] = cost[tmp.y][tmp.x] + 1;\r\n\t\t}\r\n\t\tif(map[tmp.y-1][tmp.x] && cost[tmp.y-1][tmp.x] == -1){\r\n\t\t\tPoint next = {tmp.x, tmp.y-1};\r\n\t\t\tq.push(next); \r\n\t\t\tcost[tmp.y-1][tmp.x] = cost[tmp.y][tmp.x] + 1;\r\n\t\t}\r\n\t\tif(map[tmp.y][tmp.x-1] && cost[tmp.y][tmp.x-1] == -1){\r\n\t\t\tPoint next = {tmp.x-1, tmp.y};\r\n\t\t\tq.push(next); \r\n\t\t\tcost[tmp.y][tmp.x-1] = cost[tmp.y][tmp.x] + 1;\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\nint main(){\r\n\tBfs bfs = Bfs();\r\n\tbfs.exec();\r\n\r\n}\r\n\r\n```"}}
{"actor":{"display_login":"TakeumiYamamura"}}