← 返回 akunacapital 的题目列表Binary Circuit Reordering
类型:online_judge
Given a binary array, move all 1s to the right end and calculate the maximum possible moves required. You need to follow a specific algorithm as described in the problem to calculate the maximum number of moves.
Input:
A list of integers consisting of 0s and 1s.
Output:
An integer representing the maximum number of moves.
Example: Input: [1, 0, 1, 0, 1, 0] Output: 6
Constraints:
The length of the array does not exceed 10^5.
Example
Input
1 0 1 0 1 0