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

×

# PROBLEM LINK:

Contest

Author: avi224

Editorialist: avi224

CAKEWALK.

STL

# PROBLEM:

Print the sum of all numbers in an array occurring exactly $K$ times. If there is no such number, print $-1$.

# EXPLANATION:

This can be implemented by using a map or unordered map in C++. Just take the sum of numbers whose frequency is $K$, considering each number only once.

Solution

This question is marked "community wiki".

asked 12 Apr '18, 23:34

4★avi224
218110
accept rate: 18%

One Answer:
 0 Where is the Author's solution code ? answered 29 Jul '18, 10:45 73●7 accept rate: 4%
 toggle preview community wiki:
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,613
×2

question asked: 12 Apr '18, 23:34

question was seen: 151 times

last updated: 12 Apr '18, 23:35