当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2592:Standard Point System

题目描述
Guangdong Province uses “standard point” to evaluate their students in the National Matriculation Examination. The calculating method is as follows: For example, after all the papers of a certain subject are marked, every students got a initial point which is an integer range from 0 to 150. The Examination Center of Guangdong Province sorts all the points from high to low. By computing the percentage of students whose point is lower than this student, the student’s standard point can be calculated. The completely computing process is as below:

Firstly, define a function as below:
__poj_jax_start__\Phi(x)=\int\limits_{-\infty}^x\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt=\left\{\begin{array}{lc}0.5+\int\limits_0^x\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt&x\ge0\\ 0.5-\int\limits_0^{-x}\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt&x<0\end{array}\right.__poj_jax_end__\Phi(x)=\int\limits_{-\infty}^x\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt=\left\{\begin{array}{lc}0.5+\int\limits_0^x\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt&x\ge0\\ 0.5-\int\limits_0^{-x}\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt&x<0\end{array}\right.

Secondly, For a give student, assuming that the percentage of students whose point is lower than this student is x (0 <= x < 1), we can get the standard point sp(x) as below:
__poj_jax_start__sp'(x)=500+100\Phi^{-1}(x)__poj_jax_end__sp'(x)=500+100\Phi^{-1}(x)
__poj_jax_start__sp(x)=\left\{\begin{array}{lr}100&sp'(x)\le100\\ \lfloor sp'(x)\rfloor&100<sp'(x)\le501\\ \lceil sp'(x)\rceil&501<sp'(x)\le900\\ 900&sp'(x)>900\end{array}\right.__poj_jax_end__sp(x)=\left\{\begin{array}{lr}100&sp'(x)\le100\\ \lfloor sp'(x)\rfloor&100<sp'(x)\le501\\ \lceil sp'(x)\rceil&501<sp'(x)\le900\\ 900&sp'(x)>900\end{array}\right.

Following the above steps, every percentage can be link to a certain standard point.

As one of the best programmer nowadays, you are invited to write a program to transform the initial points to standard points.
输入解释
The input contains multiply test cases. The first line in each case is an integer N (1 <= N <= 1000000), representing the number of student. Then come N lines, each contains a student’s point (The point is an integer within the range [0, 150]). The next line is an integer M (1 <= M <= 200), representing the number of queries (These numbers are all from the last N lines). Then come M line, each contains an initial point (also in the range [0, 150]).

There may be blank lines between cases. And N = 0 represent the end of input.
输出解释
For each query in a case, output the standard point corresponding to the given initial point. You should print a blank line between cases.
输入样例
1
150
1
150

2
135
98
2
135
98
0
输出样例
100

500
100
提示
For a given function F(x), if we want to compute A (as show in (1)), we can select a position integer n, and then compute B (using the formulas given in (2) and (3)). It is known that if n is very large, the difference between A and B will be very small.
__poj_jax_start__\begin{array}{lc}A=\int\limits_a^bF(t)dt&(1)\\ \Delta=(b-a)/n&(2)\\ B=\sum\limits_{i=1}^n(F(a+\Delta*(i-1))+F(a+\Delta*i))*\frac{\Delta}{2}&(3)\end{array}__poj_jax_end__\begin{array}{lc}A=\int\limits_a^bF(t)dt&(1)\\ \Delta=(b-a)/n&(2)\\ B=\sum\limits_{i=1}^n(F(a+\Delta*(i-1))+F(a+\Delta*i))*\frac{\Delta}{2}&(3)\end{array}


Huge input,scanf is recommended.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2592

最后修改于 2020-10-29T06:36:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000 65536