{"blog_url":"https://a-kawashiro.hatenablog.com/","height":"190","description":"\u6700\u521d\u306earray[a]=x\u3068\u3059\u308b x\u304carray[a]\u306b\u3042\u308b\u304b\u3001\u305d\u308c\u4ee5\u5916\u306b\u3042\u308b\u304b\u3067\u78ba\u7387\u3092\u4fdd\u6301\u3059\u308b\u3002 \u4e00\u5ea6swap\u3059\u308b\u305f\u3073\u306b \uff11\uff1aarray[a]==x\u306e\u3068\u304d x\u304c\u9078\u3070\u308c\u306a\u3044\u78ba\u7387\u306f(nC2-n+1)/nC2 x\u304c\u9078\u3070\u308c\u308b\u78ba\u7387\u306f(n-1)/nC2 \uff12\uff1aarray[a]!=x\u306e\u3068\u304d x\u304carray[a]\u306b\u79fb\u52d5\u3059\u308b\u78ba\u7387\u306f1/nC2 x\u304carray[a]\u306b\u79fb\u52d5\u3057\u306a\u3044\u78ba\u7387\u306f(nC2-1)/nC2 #include <cstdio> using namespace std; class RandomSwaps { public: double getProbability(int arrayLength, \u2026","url":"https://a-kawashiro.hatenablog.com/entry/20110410/1302415641","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa-kawashiro.hatenablog.com%2Fentry%2F20110410%2F1302415641\" title=\"SRM338 div1 medium - a_kawashiro\u306e\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"a_kawashiro","author_url":"https://blog.hatena.ne.jp/a_kawashiro/","title":"SRM338 div1 medium","version":"1.0","published":"2011-04-10 15:07:21","width":"100%","blog_title":"a_kawashiro\u306e\u30d6\u30ed\u30b0","categories":["topcoder"],"provider_url":"https://hatena.blog","type":"rich","image_url":null}