이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
while(b!=0){
int temp=b;
b=a%b;
a=temp;
}
return a;
}
int lcm(int a, int b){
return(a*b)/gcd(a, b);
}
int rec(int aa, int bb){
int res=aa;
for(int i=aa+1; i<=bb; i++){
res=lcm(res, i);
}
return res;
}
int cnt(int n){
int c=0;
while(n%10==0){
c++;
n/=10;
}
return c;
}
int main(){
int a, b;
cin>>a>>b;
int ans=rec(a, b);
cout<<cnt(ans);
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |