Created
March 16, 2017 09:06
-
-
Save splitline/6662c1b3844e0db75dc969f93d122449 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <cmath> | |
using namespace std; | |
int main() { | |
int y; | |
while(cin >> y){ | |
long long int bits=4*pow(2,(y-1900)/10); | |
long double max=log10(2)*bits,f,fLog; | |
cout << max << endl; | |
for(int i=3;;i++){ | |
f=0; | |
for(int j=i;j>=1;j--){ | |
f+=log10(j); | |
if(f>max)break; | |
} | |
if(f<=max) fLog=i; | |
else break; | |
} | |
cout << fLog; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment