Canadian Computing Competition: 2022 Stage 1, Senior #3
You are composing music for the Cool Clarinet Competition (CCC). You have been instructed to make a piece of music with exactly notes. A note is represented as a positive integer, indicating the pitch of the note.
We call a non-empty sequence of consecutive notes in the piece a sample. For instance, , , and are samples of . Note that is not a sample of . We call two samples different if they start or end at a different position in the piece.
We call a sample good if no two notes in the sample have the same pitch.
The clarinet players are picky in two ways. First, they will not play any note with pitch higher than . Second, they want a piece with exactly good samples.
Can you construct a piece to satisfy the clarinet players?
Input Specification
The first and only line of input will contain space-separated integers, , , and .
The following table shows how the available 15 marks are distributed.
Marks Awarded | Bounds on | Bounds on | Bounds on |
---|---|---|---|
marks | |||
marks | |||
marks | |||
marks |
Output Specification
If there is a piece of music that satisfies the given constraints, output integers between and , representing the pitches of the notes of the piece of music. If there is more than one such piece of music, any such piece of music may be outputted.
Otherwise, output .
Sample Input 1
3 2 5
Sample Output 1
1 2 1
Explanation of Output for Sample Input 1
Notice that the piece is composed of notes, each of which is one of possible pitches, and . That piece of music has a total of samples, but only good samples: , , , , . Notice that the two good samples of are different since they start at two different positions.
Note that the piece is the only other valid output for this input.
One example of an output that would be incorrect is , since it has notes with pitches larger than . Another incorrect output would be , since it only has four good samples: , , , and .
Sample Input 2
5 5 14
Sample Output 2
1 5 3 2 1
Explanation of Output for Sample Input 2
The 14 good samples are: , , , , , , , , , , , , , .
Sample Input 3
5 5 50
Sample Output 3
-1
Explanation of Output for Sample Input 3
There are no pieces with notes that can produce different good samples.
Comments
It seems CCC likes to ask constructive-type problems in recent years. (╯°□°)╯︵ ┻━┻
gg
gg go next
lowkey fun question just not when u have 3 hours to do it
I really don't like this problem.
does 0 count as a "positive integer"
No
This comment is hidden due to too much negative feedback. Show it anyway.
yes
Thanks for clearing that up, I was confused on that part too. 🙏🙏🙏
This comment is hidden due to too much negative feedback. Show it anyway.
bro created a throwaway account as if he was gonna get banned off DMOJ 😭
i rlly like this problem except i didnt solve it during ccc
angery ;-;
rip ccc score :(
CCC has become terrible this year, thanks to Mr. Riolku Gugeler and his team. Lots of server issues and users joining the wrong contest on the main CCC site this year. Some of them were blamed on the public. This doesn't happen in other programming contests but they got away with it because they didn't provide proper data to back their claims. It is easier to blame your server crashes and duplicate contests on the users, your team, or the wind blowing than learn a bit about load balancing to prevent overloading your servers, and naming conventions to prevent students from accidentally joining the contest outside North and South America.
This must have emboldened them to make the 2022 Senior contests a disaster. Take for example Problem S3 in 2022 - Good Samples. It has efficient solutions using Ad Hoc. However, these subjects are not in the Canadian high school math curricula, let alone computer studies.
In fact, Mr. Riolku Gugeler has SPECIFICALLY complained about difficult Ad Hoc problems. Take his comment on the Ad Hoc problem 'Loop Town' on last year's CCO:
Maybe there are other ways to solve it but they'd be extremely contorted. Ad Hoc provides a decisive advantage. Unsuspecting kids who attempt to circumvent or reinvent Ad Hoc will burn out their entire contest time and more.
The other problems in 2022 CCC Senior are equally out of whack. Either an illusionary image of Cancer Geo, some obscure 'Tree DP' technique being mandatory for S5, or overly implement-y and math-y questions like the question with the fours and fives. No fun data structures which make up a good portion of the IOI syllabus.
Since the organizers clearly didn't design this contest for a good IOI selection, nor to encourage the participants, they look like a bunch of one-trick-ponies who have ruined the contest on purpose. They get to look like geniuses to the corporate sponsors. You know, they get to show they are much smarter than the kids who couldn't invent on the spot all the advanced problem solving techniques that some of the organizers learned in university.
Considering that CCC participants will soon compete with the CCC organizers for jobs and grants, botching the contest in 2022 was a clever strategy for the organizers. They also got to make their favorites win by knocking down everyone else with unfair subject matter and server issues. Or maybe not?
We'll see if the powers that be are willing to fix the 2022 CCC botch. They need to get someone more responsible to redo the contest and properly select the IOI team. This contest used to run smoothly before Mr. Riolku Gugeler took over and wasted it. CCC is a tremendous asset for Canadian education, it is important for thousands and thousands of students each year, and it deserves honest and competent leadership.
https://dmoj.ca/post/158-ccc-19-problems-posted#comment-9190
I get that this is a long running gag that's not meant to be taken too seriously, but I think it is getting a bit out of hand.
Keenan (Riolku) Gugeler is not in charge of CCC. He (and most of the other committee members) are not involved in (and not responsible for) setting up the contest registration or handling server issues. Despite this, he is going above and beyond and is actively working on a solution to address the server issues, as well as other CCC Grader concerns. Students who joined the wrong contest will still be eligible for the Honour Roll and CCO, as this is based on the school you are registed with, not which contest you joined.
Keenan has definitely not complained about Ad Hoc problems in the past, and I fail to see how his comment on a single question's editorial is related to his opinion on the category. Saying a problem is hard does not mean that all problems in that category are hard, nor is it equivalent to a complaint about that problem or the category.
On the topic of the IOI syllabus, most fun data structure are actually considered out of scope. 2D data structures, wavelet matrices, skew heaps, static and dynamic graph data structures, most string data structures, and almost all geometry related data structures are considered out of scope. In fact, in recent years, there has been a shift towards Ad Hoc problems, with around half of the problems every year being Ad Hoc (https://dmoj.ca/problems/?show_types=1&category=5&page=3). That being said, CCC is not soley used for IOI selection (it is around one-third of the weight, with the remainder from CCO, which follows the IOI syllabus even more closely).
Funny enough, the intended solution (and the solution most contestants used) is much closer to greedy than Ad Hoc. For the other problems, S1 is something you would probably see on a Codeforces Div 2 Problem A. S2 tests basic understanding of the map data structure, which is usually taught by this time in Grade 12 computer science courses. S4 is a counting/combinatorics problem that would perhaps show up on a contest like USACO or AtCoder. S5 is tree dp which shows up almost everywhere in competitive programming. While the problem quality is not as high as some would have liked, it is certainly unfair to declare them to be "out of whack" when similar problems have showed up in many other competitive programming contests.
CCC scores (along with many other high school achievements) have very little impact on jobs and grants, especially after the first year of university.
As I mentioned before, work is currently being done to address many of the CCC Grader concerns, with Keenan contributing significantly. But as he is not the person in charge, his suggestions may not necessarily be implemented.
Hopefully this is the last time we will see this copy pasta. Certainly there are disappointments with the current state of CCC, but this copy pasta highlights all the wrong parts and none of the actual issues.
orz riolku
This comment is hidden due to too much negative feedback. Show it anyway.
If you memorize the data structures then why would you copy-paste them?
gg hardstuck p3