Solved by 1225 users: ...
UserDateAttemptTimeCMSC
xtender`12 apr 2010`Perl1000.101
sb3ar`28 jan 2008`Ruby800.0244
bush`03 mar 2006`Ruby100.0345
sb3ar`11 jan 2008`Ruby700.0246
sb3ar`12 dec 2007`Ruby600.0247
tarc`05 oct 2009`Python400.1947
skim1776`03 jul 2011`Ruby100.0349
s01A06`14 mar 2011`C2600.0150
s01A06`14 mar 2011`C2900.0150
xtender`12 apr 2010`Perl800.0650
xtender`12 apr 2010`Perl900.0650
s01A06`14 mar 2011`C2200.0151
s01A06`14 mar 2011`C2400.0151
fetetriste`23 nov 2007`C++300.0251
Nakilon`08 jan 2010`Ruby700.1451
yuyang7`22 apr 2009`Scheme100.3351
Serik`14 mar 2005`FPC1?.??51
fetetriste`23 nov 2007`C++200.0152
Nakilon`08 jan 2010`Ruby1100.0952
tarc`05 oct 2009`Python300.1652
 C++ 580 FPC 273 C 229 Java 70 Kylix 54 Ruby 16 Python 14 Scheme 4 Lua 3 Perl 3 Haskell 2
` >  >  >  >  >  >  >  >  >  > `

## Operations

Time limit = 5 second(s)

Memory limit = 8 Mb

You can perform the following operations.
• i = i+1;
• i = i-1;
• i = i/2 if i is even
The number i is integer. Find the minimal number of operations to get 0.

Input Integer 0 ≤ N ≤ 2000000

 Input#1```4 ``` Output#1```3 ```
 Input#2```15 ``` Output#2```6 ```
 Input#3```59 ``` Output#3```9 ```

Author:
Voroztsov Artem, IV MIPT Contest

<PREV | Problem set | Search related messages | NEXT>

 © acm.mipt DevGroupThe page was generated in 230ms