- #include <bits/stdc++.h>
- using namespace std;
- #define N 1000006
- double LOG[N];
- int main(){
- for(int i = 1; i <N; i++){LOG[i] = log(i*1.00) + LOG[i-1];}
- int ts;
- cin>>ts;
- for(int k = 1; k <= ts; k++){
- int a, b;
- scanf("%d%d", &a, &b);
- printf("Case %d: %d\n",k, (int)(floor(LOG[a]/log(b*1.00))+1));
- }
- return 0;
- }
Thursday 27 July 2017
Lightoj 1045 - Digits of Factorial
Subscribe to:
Post Comments (Atom)
Most Featured Post
Lightoj 1159 - Batman
http://lightoj.com/volume_showproblem.php?problem=1159 problem analysis: First i thought of this as if s1, s2 and s3 are those three str...
-
Problem link: Problem Analysis: It is actually a basic Bisection problem , as we can see here we can not actually find a formula fo...
-
http://lightoj.com/volume_showproblem.php?problem=1382 Problem analysis: This is a rare problem i wrote about so far. After much strugg...
No comments:
Post a Comment