fork download
#include 
#include 
#include 
using namespace std; 
double _string_to_double(string& s, unsigned short radix)
{
    std::size_t decimal_pos = s.find('.');
    int decimals = 0;
    if(decimal_pos != std::string::npos)
    {
        s.erase(decimal_pos, 1);
        decimals = s.size() - decimal_pos;
    }
    size_t errpos;
    double answer = stoll(s, &errpos, radix) / std::pow(radix, decimals);;
    if(errpos < s.size())
        throw std::invalid_argument("parse error in string_to_double");
    return answer;
}
 
int main (){
    
string a = "1844674214124";
for(unsigned long long x = 10000000000000;x>0;--x){
 _string_to_double(a,10);
}
return 0;
}
Time limit exceeded #stdin #stdout 5s 3424KB
stdin
Standard input is empty
stdout

Standard output is empty