Cod sursa(job #3280638)
| Utilizator | Data | 26 februarie 2025 22:16:37 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
#define lol long long
int get_zeros(int n){
int k = 0;
int put = 0;
while(n>=pow(5, put)){
put++;
}
put -=2;
return n/5 + put;
}
int main() {
lol p;
fin >> p;
int n = 0;
int a = get_zeros(n);
while(a != p){
a=get_zeros(n);
n+=5;
}
fout << n-5;
}
