Skip to main content

Posts

Featured

Counter Game HackerRank Solved!

https://www.hackerrank.com/challenges/counter-game My idea is following: 1. check if input is power of 2. 2. if it is a power of 2, shift the input until it reach to 1, and winner is who ever reaches to 1 at the moment. 3. if it is not, try to find the max of a power of 2 less than input and subtract it from the input. then repeat steps. static void Main(String[] args) { var q = Int32.Parse(Console.ReadLine()); for ( int i = 0; i < q; i++) { ulong input = UInt64.Parse(Console.ReadLine()); int count = 0; while ( true ) { if (input == 1) { break ; } if ((input & (input - 1)) == 0) { while (input > 1) { input >>= 1; ...

Latest Posts

Sparse Arrays Solved!

Journey to the Moon Hackerrank Solved!

How to solve Sherlock and Cost in C#

Windows 7/8/2008 GodMode

HowTo: Syntax Highlighter in Blogger

RadMaskedText.Text property is not accepting value

How to find host name from IP address

Microsoft DOS taskkill command

How to burn a DVD-Video Disc with Nero Burning ROM

How to author & burn a DVD from VOB trailers/files