Message from C, C++ talks

July 2019

— Sorry. Congratulations.

— Thanks Roman, for helping me out.

— Can you help me out in one more thing. Lately I was submitting my solution to SPOJ .This is the question https://www.spoj.com/problems/BSEARCH1/ and I wrote this as my problem solution and it is working fine on my code blocks compiler but unable to get accepted on the SPOJ and stating to be runtime error. Can you give a look to the code. https://pastebin.com/j035fMCX

Message permanent page

— Is it some contest?

— 

No. No. It is not a contest. Do check the problem link, You will also get to know that it is just a simple problem question.I have some other code solution as well on my hand from my friend and it is almost similar to my code. But as I said it is unable to get accepted by SPOj.

— User Sleek has 1/2 warnings; be careful!
The latest warn was because:
irrelevant Twitter post

— I'm sorry😭😭

— Mistake

— So Can you help me ?

— Its just binary search no?

— Okay

— Yes it is just a simple binary Search .

— What if there's more than 100 elements given?

— Yeah...Even the constraints of the problem say 0 < N <= 10^5. And if accordingly I make an array with 100000 size. It says the Time exceeded. I did int arr[100000] but no help.

Message permanent page

— You can use std::vector and resize it dynamically