CCC '15 J1 - Special Day

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2015 Stage 1, Junior #1

February 18 is a special date for the CCC this year.

Write a program that asks the user for a numerical month and numerical day of the month and then determines whether that date occurs before, after, or on February 18.

  • If the date occurs before February 18, output the word Before.
  • If the date occurs after February 18, output the word After.
  • If the date is February 18, output the word Special.

Input Specification

The input consists of two integers each on a separate line. These integers represent a date in 2015.

The first line will contain the month, which will be an integer in the range from 1 (indicating January) to 12 (indicating December).

The second line will contain the day of the month, which will be an integer in the range from 1 to 31. You can assume that the day of the month will be valid for the given month.

Output Specification

Exactly one of Before, After, or Special will be printed on one line.

Sample Input 1

1
7

Output for Sample Input 1

Before

Sample Input 2

8
31

Output for Sample Input 2

After

Sample Input 3

2
18

Output for Sample Input 3

Special

Comments


  • 0
    kirbs  commented on April 19, 2026, 4:38 p.m.

    what does it mean if [your input clipped 'Before'] ?


    • 0
      do_ur_homwork  commented on April 19, 2026, 5:32 p.m.

      its your output clipped btw and it show you your output clipped(only part of your output)


      • 0
        kirbs  commented on April 20, 2026, 10:54 a.m. edited

        could you please help me fix it? My py script seems fine, i have no idea where to start looking T-T. thank u in advance!

        month = input()
        day = input()
        
        user_date = month + day
        
        if int(user_date) < 218:
            print('Before')
        elif int(user_date) == 218:
            print('Special')
        else:
            print('After')
        

        • 1
          dchoo333  commented on April 20, 2026, 1:15 p.m.

          Comparing by concatenating the strings is not accuratee. Notably, for the following input:

          11
          2

          Your code gives user_date as "112", which will be considered Before February 18, although it clearly is not. I'd suggest comparing the month and day separately.


  • 2
    ShibaInu140  commented on Jan. 25, 2026, 5:39 p.m.

    OMG i put 8 instead of 18 and was so confused why it just didn't work


  • 6
    mirabelleai  commented on Nov. 15, 2024, 4:25 a.m.

    Remember to put limit to the days in the months. It took me 3 days to find that mistake.