// cLayの乱数を取り出す方法はありますか? mt19937_64 randdev(8901016); inline ll rr(ll l, ll h) { return uniform_int_distribution(l, h)(randdev); } ll k; ll sim(){ int c = 0; for (int z=0;z!=k;z=k<(z+=rr(1,6))?0:z)++c; return c; } { rd(k); ll sm=0; rep(i,20000){sm+=sim();} wt((double)sm/20000); }