QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#131908#2430. Gem Island2024zllAC ✓60ms7544kbC++14604b2023-07-28 22:01:382023-07-28 22:01:41

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-28 22:01:41]
  • 评测
  • 测评结果:AC
  • 用时:60ms
  • 内存:7544kb
  • [2023-07-28 22:01:38]
  • 提交

answer

#include<algorithm>
#include<cstdio>
typedef double real;
const int maxn=500,maxd=500;
int n,d,r;
real C[maxn+1][maxn+1],f[maxd+1][maxn+1],g[maxd+1][maxn+1],F,G;
int main(){
	scanf("%d%d%d",&n,&d,&r);
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<=n;j++)C[i][j]=C[i-1][j-1]+C[i-1][j];
	}
	f[0][n]=1,g[0][n]=r;
	for(int S=0;S<d;S++)
		for(int i=1;i<=n;i++)
			for(int _i=1;_i<=i&&S+_i<=d;_i++){
				f[S+_i][_i]+=f[S][i]*C[i][_i];
				g[S+_i][_i]+=(g[S][i]+f[S][i]*std::min(_i,r))*C[i][_i];
			}
	for(int i=1;i<=n;i++)F+=f[d][i],G+=g[d][i];
	printf("%.9lf\n",G/F);
	return 0;
}

Details

Test #1:

score: 100
Accepted
time: 1ms
memory: 5740kb

Test #2:

score: 0
Accepted
time: 1ms
memory: 5712kb

Test #3:

score: 0
Accepted
time: 1ms
memory: 3688kb

Test #4:

score: 0
Accepted
time: 1ms
memory: 5692kb

Test #5:

score: 0
Accepted
time: 0ms
memory: 5768kb

Test #6:

score: 0
Accepted
time: 1ms
memory: 5744kb

Test #7:

score: 0
Accepted
time: 0ms
memory: 6092kb

Test #8:

score: 0
Accepted
time: 2ms
memory: 5408kb

Test #9:

score: 0
Accepted
time: 0ms
memory: 6596kb

Test #10:

score: 0
Accepted
time: 1ms
memory: 6260kb

Test #11:

score: 0
Accepted
time: 1ms
memory: 5732kb

Test #12:

score: 0
Accepted
time: 0ms
memory: 5704kb

Test #13:

score: 0
Accepted
time: 1ms
memory: 5708kb

Test #14:

score: 0
Accepted
time: 1ms
memory: 5736kb

Test #15:

score: 0
Accepted
time: 1ms
memory: 5800kb

Test #16:

score: 0
Accepted
time: 0ms
memory: 5800kb

Test #17:

score: 0
Accepted
time: 1ms
memory: 6096kb

Test #18:

score: 0
Accepted
time: 1ms
memory: 6068kb

Test #19:

score: 0
Accepted
time: 0ms
memory: 6648kb

Test #20:

score: 0
Accepted
time: 1ms
memory: 6052kb

Test #21:

score: 0
Accepted
time: 2ms
memory: 5532kb

Test #22:

score: 0
Accepted
time: 0ms
memory: 3716kb

Test #23:

score: 0
Accepted
time: 1ms
memory: 5716kb

Test #24:

score: 0
Accepted
time: 1ms
memory: 5732kb

Test #25:

score: 0
Accepted
time: 0ms
memory: 3760kb

Test #26:

score: 0
Accepted
time: 1ms
memory: 6108kb

Test #27:

score: 0
Accepted
time: 0ms
memory: 6108kb

Test #28:

score: 0
Accepted
time: 1ms
memory: 6260kb

Test #29:

score: 0
Accepted
time: 1ms
memory: 5768kb

Test #30:

score: 0
Accepted
time: 0ms
memory: 5732kb

Test #31:

score: 0
Accepted
time: 0ms
memory: 5764kb

Test #32:

score: 0
Accepted
time: 1ms
memory: 5704kb

Test #33:

score: 0
Accepted
time: 0ms
memory: 3736kb

Test #34:

score: 0
Accepted
time: 0ms
memory: 5732kb

Test #35:

score: 0
Accepted
time: 1ms
memory: 5900kb

Test #36:

score: 0
Accepted
time: 1ms
memory: 5968kb

Test #37:

score: 0
Accepted
time: 1ms
memory: 5924kb

Test #38:

score: 0
Accepted
time: 0ms
memory: 4096kb

Test #39:

score: 0
Accepted
time: 0ms
memory: 5780kb

Test #40:

score: 0
Accepted
time: 1ms
memory: 5816kb

Test #41:

score: 0
Accepted
time: 1ms
memory: 5936kb

Test #42:

score: 0
Accepted
time: 1ms
memory: 6000kb

Test #43:

score: 0
Accepted
time: 2ms
memory: 7168kb

Test #44:

score: 0
Accepted
time: 1ms
memory: 3680kb

Test #45:

score: 0
Accepted
time: 1ms
memory: 5752kb

Test #46:

score: 0
Accepted
time: 1ms
memory: 5764kb

Test #47:

score: 0
Accepted
time: 1ms
memory: 5956kb

Test #48:

score: 0
Accepted
time: 0ms
memory: 5900kb

Test #49:

score: 0
Accepted
time: 0ms
memory: 5928kb

Test #50:

score: 0
Accepted
time: 0ms
memory: 6364kb

Test #51:

score: 0
Accepted
time: 2ms
memory: 7296kb

Test #52:

score: 0
Accepted
time: 0ms
memory: 6448kb

Test #53:

score: 0
Accepted
time: 0ms
memory: 6008kb

Test #54:

score: 0
Accepted
time: 2ms
memory: 5844kb

Test #55:

score: 0
Accepted
time: 3ms
memory: 7360kb

Test #56:

score: 0
Accepted
time: 0ms
memory: 5924kb

Test #57:

score: 0
Accepted
time: 0ms
memory: 3916kb

Test #58:

score: 0
Accepted
time: 1ms
memory: 5756kb

Test #59:

score: 0
Accepted
time: 2ms
memory: 6100kb

Test #60:

score: 0
Accepted
time: 0ms
memory: 6068kb

Test #61:

score: 0
Accepted
time: 4ms
memory: 6836kb

Test #62:

score: 0
Accepted
time: 1ms
memory: 5748kb

Test #63:

score: 0
Accepted
time: 1ms
memory: 6300kb

Test #64:

score: 0
Accepted
time: 1ms
memory: 5956kb

Test #65:

score: 0
Accepted
time: 18ms
memory: 7308kb

Test #66:

score: 0
Accepted
time: 12ms
memory: 6736kb

Test #67:

score: 0
Accepted
time: 0ms
memory: 5856kb

Test #68:

score: 0
Accepted
time: 0ms
memory: 6100kb

Test #69:

score: 0
Accepted
time: 1ms
memory: 6488kb

Test #70:

score: 0
Accepted
time: 45ms
memory: 7464kb

Test #71:

score: 0
Accepted
time: 53ms
memory: 7512kb

Test #72:

score: 0
Accepted
time: 60ms
memory: 7516kb

Test #73:

score: 0
Accepted
time: 0ms
memory: 6404kb

Test #74:

score: 0
Accepted
time: 1ms
memory: 6448kb

Test #75:

score: 0
Accepted
time: 0ms
memory: 5872kb

Test #76:

score: 0
Accepted
time: 5ms
memory: 6984kb

Test #77:

score: 0
Accepted
time: 6ms
memory: 7532kb

Test #78:

score: 0
Accepted
time: 3ms
memory: 7248kb

Test #79:

score: 0
Accepted
time: 6ms
memory: 6060kb

Test #80:

score: 0
Accepted
time: 26ms
memory: 7272kb

Test #81:

score: 0
Accepted
time: 53ms
memory: 7488kb

Test #82:

score: 0
Accepted
time: 48ms
memory: 7508kb

Test #83:

score: 0
Accepted
time: 53ms
memory: 7544kb

Test #84:

score: 0
Accepted
time: 54ms
memory: 7488kb