Editorial - 2023 Mini Contest 4
C2341 - Steet Name
This task is a test of carefulness. Some common mistakes:
- Using integer methods to check the first word, when the number given can exceed integer limits.
- Forgetting to check for leading zero.
- Assuming
Street
will only appear once in a valid street name.
C2342 - Rock's Yoga Classes
Solution 1
Consider the algorithm used to merge sorted vectors. Instead of merging, we pull elements from each vector into a separate new vector, skipping when the currently processed element from both vectors are equal.
Solution 2
Use an array to count the number of occurrences of each student, using the student's ID as the index. Then go through each list and skip if the student's count is 2.
C2343 - Unique Words
Use a vector to store the words. For each word in the input, turn it into all lowercase
and remove trailing punctuation to prevent double counting.
You can use functions from <algorithm>
to make your code shorter.