Please code in python Being tired of the challenging assignments given by the MCS Professors, students have collectively decided to have a roasting contest with the professors. We divide participants into two teams: students and professors. Each participant gets 500 points for their team when they roast a participant from the opposing team. Moreover, if the same participant roasts someone from the opposing team again within 10 minutes, their team gets an additional 500 points. For example, if a participant roasts twice within 10 minutes, their team gets 500+500 = 1000 points. As another example, if a participant roasts for the first time, roasts for the second time within io minutes, and then roasts within 10 minutes of their second roast, their team gets 500 + (500 + 500) + (500 + 500) = 2500 points. Input The first line contains the integer n (1 <= n <= 200), the number of times participants roasted each other in the contest The second line contains the integer ml denoting the total number of students The third line contains the integer m2 denoting the total number of professors Each of the following n lines contains one of the following: ° t_i sj pk ° t_i pk sj In the lines above, 0 <= t_i <= 120, 1<= j <= m1, 1<= k <= m2 denoting student sj , professor pk, and time t_i (in minutes). Note here that while j and k are integers, s and p are characters denoting “student” and “professor” respectively. The line t_i sj pk denotes that student j roasted professor k at time t_i, while t_i pk sj denotes that professor k roasted student j at time t_i. The numbers t_i are distinct and are in increasing order

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.9CP
icon
Related questions
Question

Please code in python

Being tired of the challenging assignments given by the MCS Professors, students have collectively decided to have a roasting contest with the professors. We divide participants into two teams: students and professors. Each participant gets 500 points for their team when they roast a participant from the opposing team. Moreover, if the same participant roasts someone from the opposing team again within 10 minutes, their team gets an additional 500 points.

For example, if a participant roasts twice within 10 minutes, their team gets

500+500 = 1000 points.

As another example, if a participant roasts for the first time, roasts for the second time within io minutes, and then roasts within 10 minutes of their second roast, their team gets 500 + (500 + 500) + (500 + 500) = 2500 points.

Input

  • The first line contains the integer n (1 <= n <= 200), the number of times participants roasted each other in the contest
  • The second line contains the integer ml denoting the total number of students
  • The third line contains the integer m2 denoting the total number of professors
  • Each of the following n lines contains one of the following:

°   t_i     sj   pk

°   t_i     pk   sj

  • In the lines above, 0 <= t_i <= 120, 1<= j <= m1, 1<= k <= m2 denoting student sj , professor pk, and time t_i (in minutes). Note here that while j and k are integers, s and p are characters denoting “student” and “professor” respectively. The line t_i sj pk denotes that student j roasted professor k at time t_i, while t_i pk sj denotes that professor k roasted student j at time t_i.
  • The numbers t_i are distinct and are in increasing order
Sample Input 2
4
4
1 s1 p1
3 p1 s2
4 s2 p2
5 p4 s1
Sample Output 2
1000 1000
Sample Input 3
4
1 s1 p1
3 p1 s2
4 s2 p2
p4 s1
6 p4 s2
7 s2 p4
Sample Output 3
2000 2000
Transcribed Image Text:Sample Input 2 4 4 1 s1 p1 3 p1 s2 4 s2 p2 5 p4 s1 Sample Output 2 1000 1000 Sample Input 3 4 1 s1 p1 3 p1 s2 4 s2 p2 p4 s1 6 p4 s2 7 s2 p4 Sample Output 3 2000 2000
Output
One line with the total score of team students, a space, and the total score of
team professors.
Sample Input 1
3
3
3
1 s1 p2
2 s1 p1
3 р1 s2
Sample Output i
1500 500
Transcribed Image Text:Output One line with the total score of team students, a space, and the total score of team professors. Sample Input 1 3 3 3 1 s1 p2 2 s1 p1 3 р1 s2 Sample Output i 1500 500
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Topological Sort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L