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

×

FAVMIN - Editorial

PROBLEM LINK:

Practice Contest

Author: Varun Singh

DIFFICULTY:

CAKEWALK

PREREQUISITES:

None

PROBLEM:

Given the height of N minions, find the height of the tallest minion

QUICK EXPLANATION:

Scan the height of all the minions and find the largest number among them.

EXPLANATION:

For each test case, scan the height of all the minions one by one and keep a record of the largest number. The largest number is the answer.

ALTERNATIVE SOLUTION:

Alternatively, one can store all the numbers in an array, sort them in descending order and print the first element of the array. Although this will take slightly longer than the previous solution but given the input size, it won't make any noticeable difference.

AUTHOR'S SOLUTIONS:

Author's solution can be found here.

This question is marked "community wiki".

asked 31 Mar '17, 18:40

varuns_2729's gravatar image

4★varuns_2729
63
accept rate: 0%

edited 31 Mar '17, 19:16

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:

×1,695
×801

question asked: 31 Mar '17, 18:40

question was seen: 514 times

last updated: 31 Mar '17, 19:16