Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programming language (URGENT PLS) Cartoons 2 There are N television channels available in Hungary (numbered from 1 to N) and for each of them

C++ programming language
(URGENT PLS)
image text in transcribed
image text in transcribed
Cartoons 2 There are N television channels available in Hungary (numbered from 1 to N) and for each of them we know which cartoons it showed this morning. The data are given with pairs: title of a cartoon and a channel identifier, meaning that the cartoon was shown by that channel. Write a program that determines the following: 1. The number of cartoons that were shown by a given channel (with identifier K). The count and list of channels that showed the cartoon which appears first in the input. 3. The number of different channels that showed at least one cartoon 4. The cartoon in the input which was shown by the least channels. 5. Two cartoons that were shown by the same number of channels. Input The first line of the standard input contains the number of channels (I5NS1000), the number of data pairs (1SMS2000), and a channel identifier (15KSN). In the next M*2 lines, there is a data pair in every two lines: the identifier number of a channel (1 SE SN), and the title of a cartoon which was shown by that channel. For simplicity, the titles are written in one word with at most 10 letters of the English alphabet. A channel showed at most 10 cartoons, and the number of different cartoons does not exceed 1000. There are no duplicate data entries (a channel cannot show a cartoon multiple times). Output The standard output should contain a line with a single #character before the solution of each subtask. This # character line is followed by as many lines as needed for the output of a subtask. If you cannot solve a subtask, you should output only the line containing the #character If the output format is not correct (less/more #characters are in the output), you will get "Output format error", even if you have correct solutions for some subtasks. Subtask 1 (20 points): Print the number of cartoons which were shown by the channel K. Subtask 2 (20 points). The first line should contain the count of channels which showed the cartoon that is in the first data pair. The second line should contain the list of the identifiers of these channels, in the same order as they appear in the input with that cartoon Subtask 3 (20 points): Print a single number, the count of different channels that showed at least one cartoon Subtask 4 (20 points): Print the cartoon that was shown by the least number of channels. In case of multiple possible solutions, you must give the cartoon that is the first in their alphabetical order. Subtask 5 (20 points): Print two cartoons (in any order) separated by a space, which were shown by the same number of channels. If there are multiple possible solutions, give the pair of cartoons with the most channels (among these pairs), and if there are still more than one possibilities, you can print any of them. If there is no such pair of cartoons, print 0 0. See the example on the next page. Output Example Input 6 5 2 1 IceAge 2 Zootopia Zootopia 3 IceAge 5 ScoobyDoo 2. 13 # 4 # ScoobyDoo IceAge Zootopia Your submitted solution is only valid if it contains the following paragraphs in the top of the pro- gram. Please fill in your name and Neptun code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Am I providing feedback consistently?

Answered: 1 week ago