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

WA №3
Posted by AKruglyak 21 Feb 2012 21:48
Why?
This is my solution:

#include <iostream>
using namespace std;
int main(){
    long int a,b,f=0;
    long int k=1;
    cin>>a>>b;
    if (a==1) {
           f=0;
           cout<<f;
           return 0;

           }

    if (b>=a && a<=2)
            f=1;

    else if(a!=1){
    while (k<=b){
          f++;
          k*=2;

          }
    a -=k;
    while (a>0){
          f++;
          a=a-b;

          }
          }
          cout<<f;

    return 0;
    }
Re: WA №3
Posted by AzizIO 17 Oct 2012 03:59
Some test for your program
10 1 ans 9
3 8  ans 2
Re: WA №3
Posted by 6eJIa9IzZzTeHb 22 May 2014 22:33
AzizIO wrote 17 October 2012 03:59
Some test for your program
10 1 ans 9
3 8  ans 2
Спасибо, помогло=)