#P1193. 洛谷团队训练 VS 传统团队训练
洛谷团队训练 VS 传统团队训练
Description
Two coaches of the informatics group at XX Middle School are debating whether the school’s informatics group should adopt Luogu as the primary training tool. They decide to use a quantitative approach to decide whether to switch.
The school’s original training method is as follows: on the teacher’s machine in the computer room, use cena to load the testdata. Loading the data takes time , and this must be done for each problem. After a student finishes writing code, they can go to the teacher’s machine to submit and evaluate the program. However, because of the round trip, each evaluation incurs a waste of time . Therefore, students are also allowed to load the testdata on their own machines, and they can choose which problems to load as needed. This takes the same time as loading on the teacher’s machine, but the time spent per evaluation is reduced to . In addition, the school may use Excel to record each student’s training progress. If a student’s score on a problem is higher than the score recorded in the sheet, it will take time to update that record; otherwise no time is spent. If the student has not previously submitted that problem, the recorded score is considered to be .
With Luogu, you only need to upload the problems and testdata to Luogu, taking time . Each evaluation then takes only time . Recording scores? That’s Luogu’s job—once a submission is completed, the platform organizes the table for you, taking no time.
It seems this could save quite a bit of time... However, the coach who supports the traditional method argues that Luogu is not stable and may be unavailable in some cases. Therefore, first divide Luogu’s total time by its availability (a number less than , denoted ) and remove the fractional part. Furthermore, because traditional perceptions are hard to change and there is always distrust in handing problem data to Luogu (kkksc03: “Blame me?”), add a penalty time to Luogu’s total for a fair comparison.
Given the school’s training scenario, please help the two coaches analyze which choice to make.
Input Format
- The first line contains two integers , the number of problems and the number of students.
- The second line contains integers , the problem IDs involved.
- The third line contains integers , the student IDs.
- The fourth line contains seven integers . The meanings of the first six numbers are as described above. If is , scores are recorded in Excel; if is , they are not recorded.
- The fifth line contains a single integer , the number of evaluations.
- The next lines each contain an evaluation record, with denoting the problem ID, the student ID, and the score for that evaluation, respectively.
Output Format
Output three lines.
- The first line is the total time for the traditional method.
- The second line is the total time for using Luogu, including the penalty time.
- The third line is the conclusion. If the time using Luogu is less than the time for the traditional method, output
Use Luogu!. Otherwise, outputForget it....
4 4
501 502 503 504
2 3 5 7
50 30 10 5 93 50 1
10
501 2 10
501 2 80
501 2 70
502 3 0
502 3 0
504 5 100
503 7 0
503 7 0
503 7 0
503 7 10
480
372
Use Luogu!
2 3
101 102
1 2 3
70 60 50 1 80 100 0
6
101 1 100
101 2 100
101 3 100
102 1 100
102 2 100
102 3 100
500
650
Forget it...
Hint
【Sample Explanation #1】
Using the traditional method, loading problems takes . For students No. and No. , the times to use the teacher’s machine are and , respectively. However, clearly loading cena locally costs only and , which are better. Students No. and No. should just use the teacher’s machine, costing and . Student No. ’s first two evaluations are strictly increasing, so recording takes an extra time. Student No. is too weak and always gets , so no need to record. Students No. and No. each incur . Therefore, the total time is .
Using Luogu, uploading the problems takes . The evaluations cost . Considering availability, the time is $$(200+100) / 93% = 322,$$ so the final total time is . Therefore, choose Luogu.
Constraints
- In of the testdata, Excel score recording is not required.
- In of the testdata, both problem IDs and student IDs are between and , inclusive. (These two cases may overlap.)
- For of the testdata, it is guaranteed that , , , , , and student IDs and problem IDs are less than .
In fact, according to the certificate issued by Supervision, Luogu’s reliability (SLA) for Q1 2015 was . Also, perceptions can be changed.
Many of Luogu’s advantages are not quantifiable. Its essence lies in the community. Isn’t it great to learn and communicate with OIers nationwide?
One last note: last year’s “[Squeeze kkksc03]” notice is still valid; see details.
Translated by ChatGPT 5
京公网安备 11011102002149号