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 1131. Copying

It seems to be correct code, but i get WA with it. Can anybody help me?
Posted by Osama Ben Laden 6 Mar 2002 19:17
Here it is:

#include <fstream.h>

int main()
{
 long n,k,i,s=1;
 cin>>n>>k;
 for(i=1; i<k && s+s<n; i++)
  s += s;
 i += (n-s+k-1)/k;
 cout<<i;
 return 0;
}