Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Codeforces 556A
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, nn, zer = 0, one = 0;
- string str;
- cin >> n >> str;
- char mass[n];
- strcpy(mass, str.c_str());
- for( int i = 0; i < n; i++ )
- {
- if( mass[i] == '1' ){one++;}
- else{zer++;}
- }
- if( one > zer ){cout<<one-zer;}
- else{cout<<zer-one;}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement