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

×

CREP- Editorial

PROBLEM LINK:

Contest

Author: avi224

Editorialist: avi224

DIFFICULTY:

CAKEWALK.

PREREQUISITES:

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, 23:34

avi224's gravatar image

4★avi224
218110
accept rate: 25%

edited 12 Apr, 23:35


Where is the Author's solution code ?

link

answered 29 Jul, 10:45

osho_garg's gravatar image

3★osho_garg
787
accept rate: 5%

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,535
×2

question asked: 12 Apr, 23:34

question was seen: 141 times

last updated: 12 Apr, 23:35