Sign in $ create-account
~/problems ~/discussion ~/contests ~/submission
← ~/problems
P2012

Binary to Decimal

Easy
// Description
Convert a binary number to its decimal representation.
// Input
A single line containing a binary string (length <= 31).
// Output
The decimal value of the binary number.
// Hint
Each digit contributes its bit weight; or just parse base 2.
// Samples
Sample Input
1010
Sample Output
10
// Problem Info
DifficultyEasy
Acceptance60%
Time Limit1000 ms
Memory Limit65536 KB
Accepted6
Implementation
// Discussion

No Discussion