Getting Wrong ! Where have I gone wrong?

Click Here for Problem Statement

#include < iostream>

#include< map>

using namespace std;

map < long long int,long long int> mem;

long long int temp,t1,t2,t3;

long long int f(long long int x)

{

if(mem[x])

{

    return mem[x];

}

else if(x<6)

{

    return x;

}

else

{

    temp=f(x/2)+f(x/3)+f(x/4);

}

mem[x]=temp;

return temp;

}

int main()

{

long long int n;

while(cin>>n)

{

    cout << max(n,f(n)); 

    cout << endl; 

}

return 0;

}

If you got the answer then please close the thread… :slight_smile:

how do i close??

you may see these options

edit|close|more ▼

select close…!