3263 - I2P(I)2025_Chou_Hu_Hw6_ClassA Scoreboard

Time

2025/11/03 20:30:00 2025/11/10 18:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
14796 Narsimha
14811 Varaha

14796 - Narsimha   

Description

The schedule is a disaster.
 
Different formats everywhere, mismatched and confusing.
 
Narsimha’s patience is evaporating faster than my scores in I2P.
 
Only sorting the dates correctly can save the day.
 
                                                                                                                                            ↓   This will be you if you don't help him :(

                              Mahavatar Narsimha Movie Review: India's Biggest Animated Hit

 

You are writing a program to help organize his daily schedule.

You receive a list of dates in different formats:

  • YYYY-MM-DD

  • MM/DD/YYYY

  • DD Mon YYYY (e.g., 25 Oct 2025)

Your task is to sort these dates chronologically from earliest to latest.

 

month_map = { 'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12 }

 

Constraints

  • All input dates and formats are valid.

  • No two dates represent the same calendar day.

  • You do not need to check for duplicates.

 

Input

A single line of comma-separated dates.

Output

Print the dates sorted chronologically, one per line.

Original input format is preserved.

Sample Input  Download

Sample Output  Download

Tags




Discuss




14811 - Varaha   

Description

Varaha is very hungry

He wants you to go buy him some groceries.

As an I2P student, you have to make a shopping list to buy the foods for Varaha.
                              
                                                             The secret of the two appearances of Lord Varāhadeva
 

Write a program to manage a shopping list. Each item in the list has a name and a quantity.

 

The program should support the following commands:

  • add → Add an entry with a quantity. If the entry already exists, increase its quantity.

  • remove → Remove a quantity of an entry. If the quantity becomes 0 or negative, remove the entry completely.

  • show → Display the current shopping list

  • count → Print the total sum of all quantities in the list.

  • clear → Remove all entries from the shopping list.

 

items = {}

# Functions
def add():
    pass

def remove():
    pass

def show():
    pass

def count():
    pass

def clear():
    pass

# Command mapping using lambdas
actions = {
    # todo
}

# Main program
n = int(input())
for _ in range(n):
    cmd = input().strip()

    # todo

Input

  • The first line contains an integer n ,number of commands.

  • The next n lines contain the commands

 

For add and remove, the next line contains the entry name and quantity separated by a space.

For show, count, and clear, no additional input is required.

Output

  • show, print the shopping list.

  • count, print the total sum of quantities.

  • No output is required for add, remove, or clear.

Sample Input  Download

Sample Output  Download

Tags




Discuss