{"image_url":null,"blog_url":"https://shinh.hatenablog.com/","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/shinichiro_h/","title":" map","author_name":"shinichiro_h","blog_title":"\u517c\u96d1\u8a18","version":"1.0","width":"100%","categories":["Program","C++"],"url":"https://shinh.hatenablog.com/entry/20071016/1192467875","height":"190","description":"\u672a\u3060\u306b C++ \u306e map \u306e\u4f7f\u3044\u65b9\u304c\u3088\u304f\u308f\u304b\u3089\u3093\u3068\u3044\u3046\u8a71\u3002\u4f8b\u3048\u3070 int \u578b\u306e ID \u306e\u51fa\u73fe\u56de\u6570\u3092 map histogram \u3068\u304b\u3067\u52d8\u5b9a\u3059\u308b\u5834\u5408\u3063\u3066 map<int, int>::iterator found = histogram.find(id); if (found == histogram.end()) { histogram[id] = 1; } else { found->second++; }\u3068\u304b\u66f8\u304f\u4eba\u306f\u307e\u3041 Ruby \u3068\u304b\u305d\u306e\u3078\u3093\u4f7f\u3063\u3068\u3051\u3063\u3066\u3053\u3068\u3067\u3044\u3044\u306e\u304b\u306a\u3068\u601d\u3046\u3093\u3067\u3059\u304c(\u4ee5\u4e0b O(2log(N)) \u306f\u8ad6\u5916\u3068\u3044\u3046\u3053\u3068\u3067)\u3001 pair<map<int, int>::itera\u2026","published":"2007-10-16 02:04:35","type":"rich","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fshinh.hatenablog.com%2Fentry%2F20071016%2F1192467875\" title=\" map - \u517c\u96d1\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}