054. When is my meeting?

Codeforces
IDCF10269054
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You have a meeting on a specific date. Given the current date and the date of the meeting, return how many days there are until the meeting. The first line will contain the first date and the second line will contain the second date. They will be given in the following format: "month day, year" If the meeting is on that date print "It is today", if it has passed print "Sorry you are X days late", otherwise print "There are X days until your meeting". You do not need to account for leap years. ## Input The first line will contain the first date and the second line will contain the second date. They will be given in the following format: "month day, year" ## Output If the meeting is on that date print "It is today", if it has passed print "Sorry you are X days late", otherwise print "There are X days until your meeting". [samples] ## Note You do not need to account for leap years.
**Definitions** Let $ D_1 = (m_1, d_1, y_1) $ be the current date, and $ D_2 = (m_2, d_2, y_2) $ be the meeting date, where $ m_i \in \{1, \dots, 12\} $, $ d_i \in \{1, \dots, 31\} $, $ y_i \in \mathbb{Z} $, and months have fixed days: $ \text{days}(m) = \begin{cases} 31 & m \in \{1,3,5,7,8,10,12\} \\ 30 & m \in \{4,6,9,11\} \\ 28 & m = 2 \end{cases} $ **Constraints** Dates are valid per the above day counts; no leap years. **Objective** Compute $ \Delta = \text{days}(D_2) - \text{days}(D_1) $, where $ \text{days}(D) $ is the total number of days from a fixed reference (e.g., year 0) to date $ D $. Then: - If $ \Delta = 0 $: output "It is today" - If $ \Delta < 0 $: output "Sorry you are $ |\Delta| $ days late" - If $ \Delta > 0 $: output "There are $ \Delta $ days until your meeting"
API Response (JSON)
{
  "problem": {
    "name": "054. When is my meeting?",
    "description": {
      "content": "You have a meeting on a specific date. Given the current date and the date of the meeting, return how many days there are until the meeting.  The first line will contain the first date and the second",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269054"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You have a meeting on a specific date. Given the current date and the date of the meeting, return how many days there are until the meeting. \n\nThe first line will contain the first date and the second...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ D_1 = (m_1, d_1, y_1) $ be the current date, and $ D_2 = (m_2, d_2, y_2) $ be the meeting date, where $ m_i \\in \\{1, \\dots, 12\\} $, $ d_i \\in \\{1, \\dots, 31\\} $, $ y_i \\in \\mat...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments