CCC '23 J3 - Special Event

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 3.0s
Memory limit: 1G

Problem type
Canadian Computing Competition: 2023 Stage 1, Junior #3

You are trying to schedule a special event on one of five possible days.

Your job is to determine on which day you should schedule the event, so that the largest number of interested people are able to attend.

Input Specification

The first line of input will contain a positive integer N, representing the number of people interested in attending your event. The next N lines will each contain one person's availability using one character for each of Day 1, Day 2, Day 3, Day 4, and Day 5 (in that order). The character Y means the person is able to attend and a period (.) means the person is not able to attend.

The following table shows how the available 15 marks are distributed:

Marks Description
6 There will be exactly one day on which every person will be able to attend.
6 There will be exactly one day on which the largest number of people will be able to attend.
3 There might be more than one day on which the largest number of people will be able to attend.

Output Specification

The output will consist of one line listing the day number(s) on which the largest number of interested people are able to attend.

If there is more than one day on which the largest number of people are able to attend, output all of these day numbers in increasing order and separated by commas (without spaces).

Sample Input 1

3
YY.Y.
...Y.
.YYY.

Sample Output 1

4

Explanation for Sample 1

All three people are able to attend on Day 4, and they are not all available on any other day.

Sample Input 2

5
YY..Y
.YY.Y
.Y.Y.
.YY.Y
Y...Y

Sample Output 2

2,5

Explanation for Sample 2

There is no day on which all five people are able to attend. Four people are able to attend on both Day 2 and Day 5.


Comments


  • 1
    maxsun0727  commented on Nov. 16, 2025, 3:29 p.m.

    I want to go to school just like this


  • 1
    tacos  commented on Sept. 6, 2025, 9:41 p.m. edit 2

    hi everyone. When i am trying to find the index for my days, i do not know what to do.

    the code below:

    https://dmoj.ca/src/7484140


    • 3
      danplus6  commented on Jan. 20, 2026, 4:06 a.m. edited

      brother dont post your code, instead post the url to your submission, we dont wanna spoil the solution for others


      • 1
        tacos  commented on Jan. 30, 2026, 10:06 p.m.

        🆗


        • 0
          Chris_Shang  commented on Jan. 31, 2026, 5:32 p.m.

          hi tacos


        • 1
          do_ur_homwork  commented on Jan. 30, 2026, 11:43 p.m. edit 2

          The problem with your code:

          big_index=0
          for j in range(5):
              if count[j]==people:
                  big_index=j+1
                  if big_index>0:
                      print(",",end="")
                  print(big_index)
                  big_index+=1

          Run the code in your head, if big_index>0: doesn't work as you want it to.

          Edit: I think you figured. Also join the discord if you nead help for questions for faster and better replies. I also want to say smth to u.


  • 3
    Apostla  commented on Sept. 20, 2024, 10:33 a.m. edit 3

    ummm... what are the constraints for N?


  • 2
    hemitvpatel  commented on July 9, 2024, 2:47 a.m.

    cool thing i learned... i didn't know strings had index pos weird but rlly cool lmao


  • -13
    teddycitrus  commented on Feb. 22, 2024, 7:15 p.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    Sickkle  commented on Feb. 20, 2024, 2:02 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • 4
      AmIJohnLi  commented on Feb. 20, 2024, 2:55 a.m.

      How your question on the ccc will be marked


      • 3
        HisMonDon  commented on Feb. 21, 2024, 2:21 a.m.

        man it literally gives the mark distributions above