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


[closed] Wrong answer IPCTRAIN

Could somebody help me in finding which testcase my code is failing in the que IPCTRAIN

Code Link

asked 01 Oct '17, 22:45

divik544's gravatar image

accept rate: 10%

closed 02 Oct '17, 05:36

The question has been closed for the following reason "The question is answered, right answer was accepted" by divik544 02 Oct '17, 05:36

Answer is hidden as author is suspended. Click here to view.

answered 01 Oct '17, 23:35

raj79's gravatar image

accept rate: 10%

I knew the priority queue approach but wanted to try it with sets btw Thanks!! just appended and multi before set and it got a AC :)

(02 Oct '17, 05:32) divik5444★

yes multiset is a better option to set in case of a heap if you are looking at storing duplicates

(02 Oct '17, 13:11) raj792★

Why are you using sets? Sets CANNOT store duplicates. As such, your approach fails if more than 1 instructor with same properties is present. Eg-

3 5
3 1 1000
3 1 1000
3 1 1000
Your Output
2000 (only 1 instructor added in set)
Expected Output

Perhaps increasing lectures in case of encountering same type of instructor can help.


answered 01 Oct '17, 23:25

vijju123's gravatar image

5★vijju123 ♦♦
accept rate: 18%

Multiset would be a better option Thanks btw!:)

(02 Oct '17, 05:35) divik5444★

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 01 Oct '17, 22:45

question was seen: 245 times

last updated: 02 Oct '17, 13:11