You are not logged in. Please login at www.codechef.com to post your questions!

×

CGDISH EDITORIAL - DISHES AND INGREDIENTS

PROBLEM LINK:


Practice

Contest

Setter - Aghamarsh V

Editorial - Aghamarsh V


DIFFICULTY :

Easy

PREREQUISITES :

Array Sorting , Binary Search

PROBLEM :

Given an array of ingredients A, we are to find whether a desired dish could be prepared or not.

EXPLANATION :

When the array of ingredients A is given,sort it so that binary search could be implemented later.

As the ingredients of the desired dish are given, they are searched for in the given array of ingredients A. If all the ingredients that are required to prepare a dish are present in the ingredients array A, then the dish could be prepared and we output YES. If any one of the desired ingredient is not present in the array A, the dish is incomplete and hence cannot be prepared. Hence we output NO.

Binary Search is to be applied to search for ingredients in array A, as the number of search operations are very large.

SOLUTION :

Will be updated soon

This question is marked "community wiki".

asked 03 Sep '18, 16:26

aghamarsh8's gravatar image

2★aghamarsh8
11
accept rate: 0%

edited 03 Sep '18, 23:01

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×15,852
×3,820
×1,056
×801
×68
×2

question asked: 03 Sep '18, 16:26

question was seen: 247 times

last updated: 03 Sep '18, 23:01