{"image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/p/peroon/20190402/20190402202040.jpg","width":"100%","author_url":"https://blog.hatena.ne.jp/peroon/","type":"rich","categories":["cpp"],"version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fperogram.hateblo.jp%2Fentry%2Fcpp_combination\" title=\"\u3010C++\u3011nCr \u7d44\u307f\u5408\u308f\u305b\u6570\u306e\u5b9f\u88c5 \u6f38\u5316\u5f0f - perogram\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","description":"\u53c2\u8003 http://www.nct9.ne.jp/m_hiroi/linux/cpp08.html#ans06 \u9806\u5217\u3067\u66f8\u304f\u3068\u6841\u3042\u3075\u308c\u3059\u308b nCr, nCr-1\u306e\u95a2\u4fc2\u5f0f\u304b\u3089\u518d\u5e30\u3067\u6c42\u3081\u3089\u308c\u308b \u8ffd\u8a18\uff1a\u7af6\u30d7\u30ed\u3067\u306f\u3053\u308c\u3092\u4f7f\u3046\u3053\u3068\u306f\u307b\u307c\u306a\u304f\u3001\u9006\u5143\u3092\u4f7f\u3046 long long combination(int n, int r) { if (n == r || r == 0) return 1; else return combination(n, r - 1) * (n - r + 1) / r; } \u6ce8\u610f\u70b9\ud83e\udd14 n = 100000\u306a\u3069\u5927\u304d\u3044\u3068\u304d\u306f\u9045\u3044 n = 500000\u306a\u3069\u3067\u518d\u5e30\u304c\u6df1\u3059\u304e\u3066Segmenta\u2026","provider_url":"https://hatena.blog","title":"\u3010C++\u3011nCr \u7d44\u307f\u5408\u308f\u305b\u6570\u306e\u5b9f\u88c5 \u6f38\u5316\u5f0f","blog_title":"perogram","author_name":"peroon","published":"2018-12-10 18:54:50","provider_name":"Hatena Blog","url":"https://perogram.hateblo.jp/entry/cpp_combination","blog_url":"https://perogram.hateblo.jp/"}