DMOPC '16 Contest 1 P0 - C.C. and Cheese-kun

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

One summer evening, while curled up with her beloved Cheese-kun plushie, C.C. begins craving pizza. Although she would really like a large, extra-cheesy pizza, her stomach is willing to settle for anything. Without hesitation, she snatches up Lelouch's credit card and makes a very important phone call…

  • C.C. will be absolutely satisfied if the pizza she gets has a width of 3 units and an extra-cheesiness of at least 95%.
  • C.C. will be fairly satisfied if the pizza she gets has a width of 1 unit and an extra-cheesiness of at most 50%.
  • C.C. will be very satisfied with any other pizza she receives.

Input Specification

The first line of input will contain a single integer W (1W3), denoting the width of the pizza C.C. receives.

The second line of input will contain another integer C (0C100), representing the percentage of the pizza covered in extra cheese.

Output Specification

A single line containing C.C.'s satisfaction with her order in the form: C.C. is M satisfied with her pizza.

Make sure your output matches this exactly, including any spacing and punctuation.

Here, M is a string describing her satisfaction, which will be one of: absolutely, fairly or very.

Sample Input

Copy
2
70

Sample Output

Copy
C.C. is very satisfied with her pizza.

Explanation

The pizza has a width of 2 units and a cheesiness of 70%. Since C.C. is neither absolutely nor fairly satisfied, she is very satisfied.


Comments


  • 0
    Mewflow  commented 15 days ago

    Watchout for at least and at most, ruined my logic first because I didnt read it exactly.


  • -2
    Paras_P3  commented 64 days ago edited
    Copy
    # My code geting wrong in tests 3 and 5 please let me know where I am doing mistake.
    
    width_of_pizza = int(input())
    extra_cheese = int(input())
    
    if (width_of_pizza >=1 and width_of_pizza <=3) and (extra_cheese>=0 and extra_cheese<=100):
    
        if (width_of_pizza == 3 and extra_cheese >= 95):
            setisfaction = ('absolutely')
        elif (width_of_pizza == 1 and (extra_cheese >= 50 and extra_cheese < 95 )):
            setisfaction = ('fairly')
        else:
            setisfaction = ('very')
    print(f'C.C. is {setisfaction} satisfied with her pizza.')
    

    • -1
      Humanthe2nd  commented 22 days ago

      C.C. will be fairly satisfied if the pizza she gets has a width of 1 unit and an extra-cheesiness of at most 50%

      your code treats it as "at least".


  • 0
    Jobanana  commented 93 days ago

    Too funny... I can see a little scenario about Code Gease in this question (lol) .


  • -4
    bethmiles  commented on Nov. 18, 2024, 12:18 p.m. edited
    Copy
    W = int(input())
    C = int(input())
    
    if W==3 and C >= 95:
        M = "absolutely"
    elif W==1 and C<=50:
        M = "fairly"
    else:
        M = "very"
    
    print ("C.C is " + M + " satisfied with her pizza")
    

    • -1
      defined  commented on Nov. 18, 2024, 11:03 p.m.

      It is C.C. and not C.C and you need a full stop at the end.


  • -8
    Hello_Dminty  commented on July 23, 2024, 8:39 p.m. edit 9

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


    • -1
      htoshiro  commented on July 23, 2024, 10:31 p.m.

      again, at least 95%


  • -3
    skeatw  commented on July 13, 2024, 8:27 a.m. edited

    Why doesn't test №2 pass?

    Copy
    W = int(input())  # ширина пиццы
    C = int(input())  # процент пиццы, покрытой доп. сыром
    if W == 3 and C > 95:
        print('C.C. is absolutely satisfied with her pizza.')
    elif W == 1 and C < 50:
        print('C.C. is fairly satisfied with her pizza.')
    else:
        print('C.C. is very satisfied with her pizza.')
    

    • -2
      htoshiro  commented on July 23, 2024, 10:31 p.m.

      at least 95%


  • -2
    kevinduan2041  commented on March 19, 2024, 12:30 a.m.

    My test case #3 is wrong, can someone help me?


    • -2
      caelrobertsperry  commented on Dec. 9, 2024, 3:57 p.m.

      *wah wah wah. p


    • -2
      nkbuipccybycdqfidt  commented on July 8, 2024, 11:35 a.m.

      W != 0 or C != 0

      if width is 1 and extra cheese is 0 C.C. is still very pleased as she has a pizza.


    • -4
      volcano  commented on March 19, 2024, 1:40 a.m.

      C.C. will be fairly satisfied if the pizza she gets has a width of 1 unit and an extra-cheesiness of at most 50%.

      Not exactly 50%.


  • -4
    JoeP  commented on Nov. 19, 2023, 12:59 p.m. edit 2

    My code for this problem delivers in test case #3 and #7 WA all other AC what's wrong?

    Copy
    width = int(input())
    
    cheesins = int(input())
    
    if width == 1 and cheesins == 50:
    
        M = ('fairly')
    
    elif width == 3 and cheesins == 95:
    
    
        M = ('absolutely')
    
    else:
    
        M = ('very')
    
    
    print('C.C. is',M,'satisfied with her pizza.')
    

    Thanks in advance for your advice!

    JoeP


    • -2
      b_nary  commented on Nov. 19, 2023, 4:48 p.m. edited

      The words "at least 95%" and "at most 50%" in the instructions do not mean that the extra-cheesiness has to be exactly 95% or 50% for C.C. to be absolutely or fairly satisfied.