RoAlgo Contest #12 - NiceContest | A. Nice PP

This was the problem page during the contest. Access the current page here.
Time limit: 1s Memory limit: 256MB Input: Output:

Bahoi started playing the online rhythm game osu! and he's trying to farm as much PP (performance points) as possible. Since the scoring system in osu! is not perfect, Bahoi sniped his score on a map with a worse score and, as a result, lost PP. Upset by this atrocity, Bahoi quit osu! and is attempting to create a clone to his liking.

For simplicity, he has currently implemented a single object: the hit circle. It is characterized by the time it appears at in milliseconds (a natural number tit_i) and its position in the 2D plane (natural numbers xix_i, yiy_i). In Bahosu! (a very original name), the scoring system used is precisely the PP system. He has the following idea for implementing the BPP (Bahoi PP) system: PP is divided into 3 categories, namely Aim PP, Speed PP, and Accuracy PP. Aim PP is calculated as the sum of the Euclidean distances divided by the time differences, multiplied by 1010, between all consecutive pairs of hit circles. Speed PP is calculated as the sum of the inverses of the time differences, multiplied by 100100, between all consecutive pairs of hit circles. Accuracy PP for an accuracy measured in percentage AA, is calculated as ((A/40)2.51)10\frac{({(A/40)}^{2.51})}{10}. Total PP is calculated as (AimPP+SpeedPP)AccuracyPP(AimPP+SpeedPP)*AccuracyPP.

Task

Given a map (a sequence of hit circles) and Bahoi's accuracy (a real number from 00 to 100100, in percentage), calculate the PP he obtained.

Input data

The first line will contain the natural number NN, representing the number of hit circles, and the real number AA, representing Bahoi's accuracy.
The next NN lines describe the ii-th circle with the triplet of natural numbers xi yi tix_i \ y_i \ t_i, as described above.

Output data

Print a single real number, representing the PP obtained by Bahoi.

Constraints and clarifications

  • 1N100 0001 \leq N \leq 100\ 000
  • 0A1000 \leq A \leq 100
  • 0x[i],y[i]4800 \leq x[i], y[i] \leq 480
  • 0t[i]1 000 0000 \leq t[i] \leq 1\ 000\ 000
  • ti<ti+1t_i < t_{i+1}
  • It is guaranteed that the result can be calculated using long double variables in C++.
  • It is recommended to use the long double data type for real number operations in C++.
  • It is recommended to display the result with 1818 decimal places using std::setprecision(18) in C++.
  • Bahoi has not discovered osu!lazer, where you cannot lose PP.

Scoring

Let A=result obtained by the committeeA = \text{result obtained by the committee} and B=result obtained by the contestantB = \text{result obtained by the contestant}.
If 0.8<AB<1.20.8 < \frac{A}{B} < 1.2, result BB is considered correct (100%100 \% of the test).
If 0.4<AB<1.60.4 < \frac{A}{B} < 1.6, result BB is considered partially correct (40%40 \% of the test).

Example 1

stdin

10 100
0 0 0
60 0 101
30 70 202
100 0 404
140 0 505
100 70 606
140 70 707
180 0 909
240 0 1010
210 70 1111

stdout

59.5172

Explanation

Below is a graphical representation of the map Bahoi played:

Bahoi played it perfectly, achieving 100%100 \% accuracy.

Bahoi's Aim PP is: 51.757151.7571
Bahoi's Speed PP is: 7.92077.9207
Bahoi's Accuracy PP is: 0.99730.9973
Therefore, Bahoi's Total PP is: (51.7571+7.9207)0.997359.5172(51.7571 + 7.9207) * 0.9973 \approx 59.5172.

Example 2

stdin

10 95.6
0 0 0
60 0 101
30 70 202
100 0 404
140 0 505
100 70 606
140 70 707
180 0 909
240 0 1010
210 70 1111

stdout

53.1608

Explanation

In example 2, Bahoi played the exact same map, but with a worse accuracy (95.6%95.6 \%).

Bahoi's Aim PP is: 51.757151.7571
Bahoi's Speed PP is: 7.92077.9207
Bahoi's Accuracy PP is: 0.89070.8907
Therefore, Bahoi's Total PP is: (51.7571+7.9207)0.890753.1608(51.7571 + 7.9207) * 0.8907 \approx 53.1608.

Log in or sign up to be able to send submissions!