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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education