A. Case of the Zeros and Ones

简介:

题目链接:http://codeforces.com/contest/556/problem/A

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int m;
    string s;
    cin>>m>>s;
    int j=0;
    for(int i=0; i<m; i++)
    {
        if(s[i]=='0')
            j++;
    }
    cout<<abs(m-2*j);
    return 0;
}
目录
相关文章
成功解决ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
成功解决ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
成功解决but is 0 and 2 (computed from start 0 and end 9223372 over shape with rank 2 and stride-1)
成功解决but is 0 and 2 (computed from start 0 and end 9223372 over shape with rank 2 and stride-1)
解决AssertionError: size of input tensor and input format are different.tensor shape: (3, 138input_for
解决AssertionError: size of input tensor and input format are different.tensor shape: (3, 138input_for
310 0
np.random.choice 参数replace
np.random.choice 参数replace
94 0
|
Python
20181005case-----np.c_
1.在pandas里想获取某行的数据,可以用 name[[‘列名’,‘列名’]].iloc[行号] 例: full_country_stats[[“GDPpercaptial”,“Lifesatisfaction”]].iloc[remove_indices] 2.把pandas里的某列数据转换成可以进行运算的矩阵 np.c_p[name[‘列名’] ]
20181005case-----np.c_
Can not squeeze dim[1], expected a dimension of 1, got 21
Can not squeeze dim[1], expected a dimension of 1, got 21
435 0
成功解决np.array(zip(x1, x2)).reshape(len(x1), 2) ValueError: cannot reshape array of size 1 int
成功解决np.array(zip(x1, x2)).reshape(len(x1), 2) ValueError: cannot reshape array of size 1 int