QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#77490#3994. Easy JumpchenshiWA 6ms4808kbC++1.0kb2023-02-14 20:48:452023-02-14 20:48:47

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-14 20:48:47]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:4808kb
  • [2023-02-14 20:48:45]
  • 提交

answer

#include<cstdio>
#include<iostream>
using namespace std;
const int o=1010;const long double inf=1e18;
int n,h,s,K;long double T1,T2,T2_,p[o],f[o][10][7],v,t;bool tote[o];
int main(){
	scanf("%d%d%d",&n,&h,&s);
	for(int i=1;i<=n;++i) scanf("%Lf",&p[i]),p[i]/=100;
	scanf("%d",&K);
	for(int a;K--;tote[a]=1) scanf("%d",&a);
	scanf("%Lf%Lf",&T1,&T2);
	for(int i=n;i;--i){
		for(int j=2;j<=h;++j) for(int k=0;k<=s;++k) f[i][j][k]=inf;
		for(int T=10;T--;){
			for(int k=0;k<=s;++k) for(int j=2;j<=h;++j){
				v=1+p[i]*f[i+1][j][k];t=inf;T2_=T2;
				if(j>2) t=min(t,f[i][j-1][k]);
				if(k) t=min(t,f[i][j][k-1]+T1);
				if(tote[i]) v=1+p[i]*f[i+1][j][s],T2_=min(T1,T2);
				f[i][j][k]=min(f[i][j][k],min(v+(1-p[i])*t,(v+(1-p[i])*T2_)/p[i]));
				for(int $=1;$<=k&&j+$<=h;++$) f[i][j][k]=min(f[i][j][k],f[i][j+$][k-$]+T1*$);
			}
			if(!tote[i]) break;
			for(int j=2;j<=h;++j){
				t=inf;
				for(int k=0;k<=s;++k) t=min(t,f[i][j][k]);
				for(int k=0;k<=s;++k) f[i][j][k]=t;
			}
		}
	}
	printf("%Lf",f[1][h][s]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3556kb

input:

1 2 0
50
0
1 2

output:

4.000000

result:

ok found '4.0000000', expected '4.0000000', error '0.0000000'

Test #2:

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

input:

2 3 1
50 50
1 1
1 3

output:

6.000000

result:

ok found '6.0000000', expected '6.0000000', error '0.0000000'

Test #3:

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

input:

1 6 4
75
0
64 6

output:

1.341146

result:

ok found '1.3411460', expected '1.3411458', error '0.0000001'

Test #4:

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

input:

1 5 1
61
1 1
15 43

output:

2.208223

result:

ok found '2.2082230', expected '2.2082232', error '0.0000001'

Test #5:

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

input:

10 9 3
12 65 76 33 17 20 89 16 4 63
3 2 4 8
73 21

output:

942.414842

result:

ok found '942.4148420', expected '942.4148420', error '0.0000000'

Test #6:

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

input:

10 6 0
26 6 29 76 92 46 8 4 91 44
1 4
17 6

output:

401.866863

result:

ok found '401.8668630', expected '401.8668630', error '0.0000000'

Test #7:

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

input:

100 3 5
85 59 20 75 58 42 79 95 22 15 95 81 69 73 45 42 99 93 58 8 18 34 88 14 23 37 87 16 96 17 40 58 32 26 93 9 37 15 68 49 99 73 48 79 16 27 52 4 66 53 48 55 27 56 52 66 25 30 34 11 97 20 38 30 4 78 17 98 4 23 30 71 87 94 89 71 45 92 72 24 90 24 78 48 62 82 30 30 27 55 64 66 41 72 53 97 59 38 80 ...

output:

13395.855063

result:

ok found '13395.8550630', expected '13395.8550625', error '0.0000000'

Test #8:

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

input:

100 6 5
71 18 59 37 83 16 53 4 42 38 52 89 95 42 39 17 27 84 53 45 36 50 7 63 23 69 34 74 68 13 65 81 48 77 36 87 57 22 47 70 50 54 16 63 32 96 70 30 25 97 35 33 59 76 40 54 68 60 19 34 73 8 71 77 97 39 27 37 93 19 71 94 61 33 28 80 86 79 16 2 42 89 19 43 97 52 95 69 53 67 37 51 4 53 7 36 82 67 80 2...

output:

15012.983303

result:

ok found '15012.9833030', expected '15012.9833032', error '0.0000000'

Test #9:

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

input:

100 4 1
15 95 82 67 93 57 92 60 48 53 26 94 10 24 88 48 48 28 9 62 55 6 8 39 25 87 14 10 50 19 24 89 11 98 3 30 16 22 43 80 26 49 47 59 38 70 79 94 2 72 78 28 83 34 30 52 45 83 9 42 63 46 83 95 49 21 38 48 87 65 45 7 91 9 5 32 57 21 39 34 71 69 87 44 12 38 72 99 55 23 21 42 87 91 85 93 47 28 25 96
8...

output:

22457.801151

result:

ok found '22457.8011510', expected '22457.8011510', error '0.0000000'

Test #10:

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

input:

100 6 4
52 32 81 87 70 91 23 65 91 47 84 60 76 18 31 34 17 85 31 68 80 35 60 86 63 42 76 94 90 25 76 1 38 87 68 19 43 66 7 12 82 7 58 93 66 3 92 92 64 82 10 91 55 27 41 45 44 59 91 30 86 69 77 36 76 49 46 91 14 14 58 51 4 91 23 56 72 86 65 78 91 21 80 77 75 13 36 99 34 61 56 79 5 32 49 37 26 93 70 5...

output:

4276.804397

result:

ok found '4276.8043970', expected '4276.8043969', error '0.0000000'

Test #11:

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

input:

100 3 5
18 54 94 38 94 89 65 11 6 7 20 36 99 17 55 98 14 74 78 32 95 67 20 21 24 67 50 96 72 42 22 32 14 82 44 81 37 94 11 22 86 33 41 36 9 41 90 66 27 13 7 93 89 84 1 4 1 75 33 92 55 11 19 71 40 45 40 9 32 81 98 58 70 23 30 49 24 98 15 41 35 51 3 6 83 54 14 28 81 64 71 86 33 45 51 61 14 18 19 12
10...

output:

31638.976439

result:

ok found '31638.9764390', expected '31638.9764387', error '0.0000000'

Test #12:

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

input:

1000 8 3
67 7 89 71 35 18 39 60 12 76 58 9 78 97 89 71 55 25 3 12 36 52 55 20 51 25 25 1 30 49 23 63 54 52 17 81 89 64 47 92 20 98 96 12 53 21 85 75 55 5 25 20 63 43 28 65 11 97 42 64 23 91 40 87 61 98 36 48 24 40 6 20 17 7 28 75 89 52 22 78 96 97 62 85 54 73 10 37 93 49 14 72 27 71 91 77 38 84 70 3...

output:

262807.784739

result:

ok found '262807.7847390', expected '262807.7847388', error '0.0000000'

Test #13:

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

input:

1000 6 3
73 3 44 64 34 50 44 97 16 2 63 94 50 41 12 70 14 12 86 83 73 36 92 47 66 54 68 52 17 92 38 5 22 47 96 67 3 21 9 35 45 77 51 80 54 12 13 95 59 41 53 49 77 23 40 19 60 74 99 93 51 51 2 22 6 46 34 29 28 68 92 20 37 93 88 69 7 30 62 79 55 30 56 36 62 89 70 47 28 78 28 15 59 43 63 59 29 67 45 86...

output:

452525.435365

result:

ok found '452525.4353650', expected '452525.4353649', error '0.0000000'

Test #14:

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

input:

1000 6 3
25 71 28 1 12 61 61 64 75 77 24 70 48 17 93 15 78 58 37 83 37 89 26 83 18 53 57 6 83 14 83 95 63 19 44 87 75 52 68 99 77 22 41 77 91 46 52 55 30 83 8 46 46 95 41 83 12 84 56 68 52 88 32 15 66 89 9 4 24 71 45 79 27 79 81 73 77 83 1 12 14 86 15 17 18 51 76 54 51 50 86 22 46 97 27 7 15 68 8 3 ...

output:

305463.194724

result:

ok found '305463.1947240', expected '305463.1947235', error '0.0000000'

Test #15:

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

input:

1000 6 0
9 73 54 66 24 28 96 71 75 93 67 82 2 69 25 88 22 25 62 26 91 21 28 73 91 11 36 89 40 53 6 39 20 84 52 30 19 10 29 40 16 40 33 87 41 93 51 2 83 44 86 96 55 68 2 62 43 52 90 89 54 93 72 8 25 55 29 24 24 31 29 12 55 3 35 71 77 14 11 47 3 58 66 25 48 44 98 28 24 46 39 74 68 88 69 68 99 23 66 15...

output:

198576.703453

result:

ok found '198576.7034530', expected '198576.7034535', error '0.0000000'

Test #16:

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

input:

1000 5 3
77 43 54 22 15 44 57 52 99 53 3 8 56 29 95 99 33 34 8 69 6 44 41 74 51 88 77 39 66 45 2 52 37 1 91 90 68 64 64 71 69 14 42 20 41 60 67 53 96 64 42 30 27 23 44 73 64 59 66 41 47 4 11 36 67 43 22 18 37 48 61 88 44 59 77 70 52 65 78 5 45 40 22 94 19 12 45 2 66 37 45 95 67 94 38 55 11 63 77 72 ...

output:

124894.631015

result:

ok found '124894.6310150', expected '124894.6310147', error '0.0000000'

Test #17:

score: -100
Wrong Answer
time: 3ms
memory: 4808kb

input:

1000 5 0
18 21 52 20 8 18 14 27 59 45 11 96 94 57 16 19 40 43 83 13 33 29 72 5 64 53 49 79 88 6 66 83 28 39 47 57 84 62 88 77 48 76 27 31 36 42 3 47 33 55 71 66 96 60 2 13 47 33 44 36 50 50 81 37 98 53 13 9 40 12 97 83 65 64 25 68 15 48 31 68 89 72 40 80 13 57 80 73 54 96 56 55 73 44 44 64 86 7 7 6 ...

output:

266897.960844

result:

wrong answer 1st numbers differ - expected: '316712.1332163', found: '266897.9608440', error = '0.1572853'