This is very confusing for me; we cant use import statements; Please create code for me with the following input numbers because I'm very confused number of roasts ; 3 number of students ; 3 number of professors ; 3   student1 roasts professor2 for the first time, then 5 minutes later roasts him again (gets students 1500 points) student 2 roasts professor2 once (gets students additional 500 points) student 3 roasts professor1, then 8 minutes later roasts professor 2, then 3 minutes later roasts professor 3 ( gets students  additional 2500 points professor1 roasts student1 for first time, then 9 minutes later roasts student 2 (gets professors 1500 points professor2 roasts student2 for the first time, then 11 minutes later roasts student 3 (gets professors another 1000 points) professor roasts student 2 (gets team another 500 points)

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question

This is very confusing for me;

we cant use import statements;

Please create code for me with the following input numbers because I'm very confused

number of roasts ; 3

number of students ; 3

number of professors ; 3

 

student1 roasts professor2 for the first time, then 5 minutes later roasts him again (gets students 1500 points)

student 2 roasts professor2 once (gets students additional 500 points)

student 3 roasts professor1, then 8 minutes later roasts professor 2, then 3 minutes later roasts professor 3 ( gets students  additional 2500 points

professor1 roasts student1 for first time, then 9 minutes later roasts student 2 (gets professors 1500 points

professor2 roasts student2 for the first time, then 11 minutes later roasts student 3 (gets professors another 1000 points)

professor roasts student 2 (gets team another 500 points)

 

Output
One line with the total score of team students, a space, and the total score of team
professors.
Sample Input 1
3
3
1 s1 p2
2 s1 p1
3 р1 s2
Sample Output 1
1500 500
Sample Input 2
4
4
1 s1 p1
3 р1 s2
4 s2 p2
5 р4 s1
Sample Output 2
1000 1000
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 1 s1 p2 2 s1 p1 3 р1 s2 Sample Output 1 1500 500 Sample Input 2 4 4 1 s1 p1 3 р1 s2 4 s2 p2 5 р4 s1 Sample Output 2 1000 1000
Q1: MCS Roast
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 10 minutes, and then roasts within 10 minutes of their second roast,
their team gets 500 + (500 + 500) + (500 + 500) = 2500 points.
Filename
Your filename for this question must be q1.py.
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 m1 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:
o t_i sj pk
t_i pk sj
In the lines above, o <= 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.
Transcribed Image Text:Q1: MCS Roast 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 10 minutes, and then roasts within 10 minutes of their second roast, their team gets 500 + (500 + 500) + (500 + 500) = 2500 points. Filename Your filename for this question must be q1.py. 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 m1 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: o t_i sj pk t_i pk sj In the lines above, o <= 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.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
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
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole