[Group] [NOIP2019 JZOJ A simulation 2019.9.11] exam (test)

topic

[Problem Description]
small S to see an exam, the exam a total of k road title. Each question has a score ??, zi difficulty and
type si. These topics are a total of m different types.
Due to the small S serious side branches, it may be different for different types of topics proficiency in the i-th type of problem
projects proficiency as yi.
To simplify the problem, we believe that when the small S y proficiency to do a difficulty of the z-score of the subject,
will receive a score ⋅ (1 - ??) 2 - max (0,1).
As we all know, do not question that may affect the mentality and play well, where we believe that if small S in a
score of less than 64% of the title track of the score, then the next question do proficiency will decline. Specifically, the next
i-drop questions proficiency ci%. The last time scores below 64% before the impact of each question will suffer.
(That is, if the t score less than 64% of the questions out, then the t + i proficiency questions will decline Ci%.
At the same time, if there are multiple questions fraction of less than 64% out of, only the last will affected. For example, a first sub-title
number is less than 64% then 3 (i.e. 1 + 2) of the title drop C2%, the next question 4 and 5 is less than 64% then the first (i.e. 4 + 1)
problems will fall C1%.)
according to the present description, it has been possible to determine the small S score of each question. But there is little S n bottles god
odd drink, drink bottle drink on the i do question can make to improve the proficiency of solving the problem xi%. Bottle drinks only
in a question to drink, drink bottle beverage can do a question.
Proficiency of falling and rising are in turn each time is calculated according to the current percentage. In simple terms, that is,
The original high proficiency 1 ± u%.
Now we ask the highest total score is the number of small S.
[Input format
to read from the input file in test.in.
The first row of three integers n, m, k, each number represents the number of bottles of beverages, the type of subject and number of questions.
The second line n integers x1, x2, ⋯, ??, showing lifting of the beverage to bring
the third row m integer y1,? 2, ⋯, ?? , represents a type of proficiency for each subject.
The fourth line k - 1 integers c1, c2, ⋯, ck- 1, represents a decline in the degree of proficiency do not go well after the title right.
Next k lines of three integers ai, si, zi, represent scores, and the type of difficult subject.
[Output format]
output to a file test.out in.
Output line a real number, the answer. Rounded to two decimal places output.
Sample input [1]
1 1 2
10
100
50
100 260. 1
100 1 200 is
[sample 1] output
2019 non-professional level software authentication capabilities increase stage (second round) a second authentication test (test) page 3 total 8
141.72
[explain] sample 1
total beverage bottle, you can choose to drink when doing the first question or the second question.
If the second question do drink:
the ability to do a first title 100, a score of 100 × (1 - (1 -
100
260) 2) 22 is = 62
169
Since the scores below 64, the capacity of the second will decrease by 50%, and because the beverage may be increased by 10%,
the actual capacity of 100 × 50% × 110% = 55.
The second question is then scored × 100 (. 1 - (. 1 -
55
200 is) 2) = 47. 7
16.
Total score of 1535 109
2704 points.
Can be similarly calculated to be 141,121 in the selected drink when doing the first question scored
169
points, the highest score
141 121
169 min.
[Sample 2]
See test players under the directory / test2.in and test / test2.ans.

[Data] range
to 100% of the test point to ensure that 0 ≤ n ≤ 10,1 ≤ si ≤ ≤ 10,1 ≤ ≤ 5 × 105, 0 ≤ ?? -?? 1 ≤ ?? -? 2 ≤ ⋯ ≤ 1 ≤ 100,1 ≤ ??, ??, ?? ≤ 105, 1 ≤ ?? ≤ 1000.

Thinking

The meaning of problems like pressure DP and DP

Note that this question long and boring subject, details and more, a little ring true, it will burst like me 0

Code

#include<bits/stdc++.h>
using namespace std;
const int N=27,maxK=5e5+77;
int n;
double x[N];
int m,y[N];
int K,a[maxK],s[maxK],z[maxK];
double c[maxK];
inline double sqr(double x){return x*x;}
double pro[1<<10],f[110][110][1<<10];
inline void update(double &x,double y){y>x?x=y:0;}
int main()
{
	freopen("test.in","r",stdin);
	freopen("test.out","w",stdout);
	scanf("%d%d%d",&n,&m,&K);
	for(int i=0; i<n; i++)
		scanf("%lf",&x[i]),x[i]=(100+x[i])/100;
	for(int i=1; i<=m; i++)
		scanf("%d",&y[i]);
	for(int i=1; i<K; i++)
		scanf("%lf",&c[i]),c[i]=(100-c[i])/100;
	for(int i=1; i<=K; i++)
		scanf("%d%d%d",&a[i],&s[i],&z[i]);
	if(n==0){
		double ans=0;
		for(int i=1,lst=0; i<=K; i++)
		{
			double p=y[s[i]]*(lst?c[i-lst]:1),sco=a[i]*(1-sqr(max(0.0,1-p/z[i])));
			ans+=sco;
			if(sco<a[i]*0.64)
				lst=i;
		}
		printf("%.2lf\n",ans);
		return 0;
	}
	pro[0]=1;
	for(int i=1; i<1<<n; i++)
		for(int j=0; j<n; j++)
			if(i>>j&1)
			{
				pro[i]=pro[i^1<<j]*x[j];
				break;
			}
	memset(f,128,sizeof f);
	f[0][0][0]=0;
	for(int i=0; i<K; i++)
		for(int j=0; j<=i; j++)
			for(int s1=0;s1<1<<n;++s1)
				if(f[i][j][s1]>=0)
					for(int s2=s1;s2<1<<n;s2=(s2+1)|s1)
					{
						double p=y[s[i+1]]*(j?c[i+1-j]:1)*pro[s2^s1];
						double sco=a[i+1]*(1-sqr(max(0.0,1-p/z[i+1])));
						if(a[i+1]*0.64-sco>0)
							update(f[i+1][i+1][s2],f[i][j][s1]+sco);
						else
							update(f[i+1][j][s2],f[i][j][s1]+sco);
					}
	double ans=0;
	for(int j=0; j<=K; j++)
		for(int s1=0;s1<1<<n;s1++)
			ans=max(ans,f[K][j][s1]);
	printf("%.2lf\n",ans);
	return 0;
}
Published 703 original articles · won praise 392 · Views 140,000 +

Guess you like

Origin blog.csdn.net/Eric1561759334/article/details/100785463