文章
34
粉丝
89
获赞
2
访问
18.5k
#include<bits/stdc++.h>
using namespace std;
const int N = 1e7+5;
int arr[N];
int dp[N];
//char s[N];
int main() {
int n;
// string s;
while (cin >> n) {
string s;
cin >> s;
memset(dp,0,sizeof(dp));
memset(arr,0,sizeof(arr));
int maxx = 0;
int ans = 0;
// int len = s.size();
for (int i = 0; i < n; i++) {
if (s[i] == '0') arr[i] = 1;
else arr[i] = -1;
dp[i] = arr[i];
if (s[i] == '1') ans++;
}
for (int i = 1; i < n; i++) {
...
登录后发布评论
暂无评论,来抢沙发