Who Wins?
InterviewTime limit1sMemory limit1024 MB
Given two lists of coding skills, count how many cross-team matches HI wins, how many ARC wins, and how many end in a draw.
- Level
Easy3 of 10
- Topics
- Prefix sum, Sorting, Array
- Solved
- No attempts yet
Problem
HI-ARC is holding a friendly competition at the end of the semester, split into the HI team and the ARC team. The HI team has members and the ARC team has members. Every member of one team plays exactly one match against every member of the other team, so the competition consists of matches. Each participant has a coding skill. In a match, the participant with the higher coding skill wins, and if the two skills are equal, the match is a draw.
Hayak wants to know the results of the competition early. Predict the results for Hayak.
Input
The first line contains the number of HI team members and the number of ARC team members , separated by a space.
The second line contains a sequence of length , the coding skills of the HI team members, separated by spaces.
The third line contains a sequence of length , the coding skills of the ARC team members, separated by spaces.
Output
Print three integers separated by spaces: the number of wins for HI team participants, the number of wins for ARC team participants, and the number of draws.