We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I get the same thing... somethings changed on the server side to cause the alloc exception not be thrown... my guess is the container memory for this problem running was increased so it will never throw a mem exceed exception and they've not bothered to fix it.
Here's my solution... A TOTAL HACK.. god save us all if anyone actually writes production code like this to run nuclear power plants or does US federal reserve banking accounting.
try{if(A<10000000){// <-- HACK 10 MB limit to deal with server not thrown exception as it should.cout<<Server::compute(A,B)<<endl;}else{Server::compute(10,1);cout<<"Not enough memory"<<endl;}}catch(bad_alloc&error){cout<<"Not enough memory"<<endl;}catch(exception&error){cout<<"Exception: "<<error.what()<<endl;}catch(...){cout<<"Other Exception"<<endl;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Exceptional Server
You are viewing a single comment's thread. Return to all comments →
I get the same thing... somethings changed on the server side to cause the alloc exception not be thrown... my guess is the container memory for this problem running was increased so it will never throw a mem exceed exception and they've not bothered to fix it.
Here's my solution... A TOTAL HACK.. god save us all if anyone actually writes production code like this to run nuclear power plants or does US federal reserve banking accounting.