Submission

Status:

P-PP-P-PPP

Subtask/Task Score:

70/100

Score: 70

User: Pera

Problemset: Ingredient Validator

Language: cpp

Time: 0.004 second

Submitted On: 2025-09-03 17:02:46

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    string season, moon, ingredient;
    cin >> season >> moon >> ingredient;

    if (season == "spring" || season == "summer") {
        if (moon == "full") {
            if (ingredient == "honey" || ingredient == "milk") {
                cout << "Ingredient accepted!" << endl;
            } else {
                cout << "Ingredient rejected!" << endl;
            }
        } else if (moon == "new" && ingredient != "chocolate") {
            cout << "Ingredient accepted!" << endl;
        } else {
            cout << "Ingredient rejected!" << endl;
        }
    } else if (season == "autumn" || season == "winter") {
        if (moon == "waning" || moon == "new") {
            if (ingredient == "chocolate" || ingredient == "milk") {
                cout << "Ingredient accepted!" << endl;
            } else {
                cout << "Ingredient rejected!" << endl;
            }
        } else {
            cout << "Ingredient rejected!" << endl;
        }
    } else {
        cout << "Ingredient rejected!" << endl;
    }
    return 0;
}