ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1605. Devil's Sequence

What is lacking in terms? What could I forget?
Posted by 8P 15 Feb 2010 21:23
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int n,s;
    cin>>n;
    if(n%10==7)
        s=int((n-1)*log((double)2)/log((double)10));
    else
        s=int(n * log((double)2)/log((double)10));
    cout<<s<<endl;
    return 0;
}

What is lacking in terms? What could I forget?