Search found 35 matches

by vsha041
Sun Feb 23, 2014 11:15 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18099

Re: 10107 - What is the Median?

Well I found out the problem. The key is that nth_element function only brings 1 element in its correct location and this element is the one where the algorithm is applied. For example if your vector contains 4 numbers - 23, 34, 1, 4 then nth_element(begin(v), begin(v) + 2, end(v)) will only bring t...
by vsha041
Sun Feb 23, 2014 9:41 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18099

Re: 10107 - What is the Median?

Hi I am getting Wrong Answer. However it does pass this forum's and my own test cases. Can anyone give me a hint as to what is wrong here? Thanks.

Code: Select all

Code removed after ACCEPTED
by vsha041
Sat Feb 22, 2014 6:11 am
Forum: Volume 105 (10500-10599)
Topic: 10507 - Waking up brain
Replies: 22
Views: 14226

Re: 10507 - Waking up brain

There are two tricky cases to consider: 1. Remember that all the specified areas of the brain should be awake. For example in the case below there are 5 areas. However after doing the analysis you will realize that 4 areas are awake - three already and then W. But that doesn't mean that the answer i...
by vsha041
Sat Feb 15, 2014 12:28 am
Forum: Volume 103 (10300-10399)
Topic: 10315 - Poker Hands
Replies: 63
Views: 26789

Re: 10315 - Poker Hands

The problem described there is very very different from the real world poker game so don't make any assumptions. Here are the differences: (By the way all 10 cards are different in the UVA Judge input, I checked that by throwing exceptions) In real world poker AH 2C 3S 4C 5C is a straight but for th...
by vsha041
Wed Feb 12, 2014 10:08 am
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 76879

Re: 10038 - Jolly Jumpers

Just remember that for n <= 1 the answer is Jolly. And for n >=2 you do your normal program flow to find the answer.

Go to advanced search