Pagini recente » Autentificare | Istoria paginii runda/runda_1/clasament | Cod sursa (job #1592279) | Cod sursa (job #1657239) | Cod sursa (job #2071650)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
long p,pas,r,l;
int zero(long n)
{
int nrz=0;
while(n>=5)
{
nrz+=(n/=5);
}
return nrz;
}
int caut_bin(long x)
{
pas=1<<l;
r=0;
while(pas!=0)
{
if(zero(r+pas)<x)
{
r+=pas;
}
pas/=2;
}
r++;
return r;
}
int main()
{
f>>p;
l=16;
g<<caut_bin(p);
return 0;
}