Professional Documents
Culture Documents
(https://www.codechef.com/certification/data-structures-and-algorithms/about?
Home (/) » Compete (/contests/) » April Challenge 2019 Division 2 (/APRIL19B?order=desc&sortBy=successful_submissions) » Maximum Remaining
utm_source=website&utm_medium=adstrip&utm_campaign=mar31adstrip)
Tweet
Like Share 22 people like this. Be the first of your friends.
(https://twitter.com/share)
All submissions for this problem are available.### Read problem statements in All Submissions (/APRIL19B/status/MAXREM)
Hindi
(http://www.codechef.com/download/translated/APRIL19/hindi/MAXREM.pdf),
Successful Submissions
Bengali
(http://www.codechef.com/download/translated/APRIL19/bengali/MAXREM.pdf),
Mandarin Chinese
(http://www.codechef.com/download/translated/APRIL19/mandarin/MAXREM.pdf),
Russian
(http://www.codechef.com/download/translated/APRIL19/russian/MAXREM.pdf),
and Vietnamese
(http://www.codechef.com/download/translated/APRIL19/vietnamese/MAXREM.pdf)
as well.
Chef and Dhyey have become friends recently. Chef wants to test Dhyey's
intelligence by giving him a puzzle to solve.
Input
The first line of each test case contains a single integer N .
The second line contains N space-separated integers A1 , A2 , … , AN .
Output
For each test case, print a single line containing one integer — the answer to the
puzzle.
Constraints
5
2 ≤ N ≤ 10
1 ≤ A i ≤ 10
9
for each valid i
Subtasks
Subtask #1 (30 points): 2 ≤ N ≤ 1, 000
We use cookies to improve your experience and for analytical purposes. Read our Privacy Policy (/privacy-policy) and Terms (/terms) to know more. You consent to our cookies if
Example Input 1 Okay
you continue to use our website.
https://www.codechef.com/APRIL19B/problems/MAXREM 1/3
25/04/2019
5 Maximum Remaining | CodeChef
1 2 3 4 5
Example Output 1
4
Example Input 2
6
5 5 5 2 3 8
Example Output 2
5
Editorial: https://discuss.codechef.com/problems/MAXREM
(https://discuss.codechef.com/problems/MAXREM)
Languages: C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS
gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D,
PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS,
PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM,
LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6,
TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS
Comments
© 2009 Directi Group (http://directi.com). All Rights Reserved. CodeChef uses SPOJ © by Sphere Research Labs (http://www.sphere-research.com)
In order to report copyright violations of any kind, send in an email to copyright@codechef.com (mailto:copyright@codechef.com)
(http://directi.com)
Initiatives
We use cookies to improve your experience and for analytical purposes. Read our Privacy Policy (/privacy-policy) and Terms (/terms) to know more. You consent to our cookies if
Okay
you continue to use our website.
https://www.codechef.com/APRIL19B/problems/MAXREM 3/3