文章
14
粉丝
0
获赞
15
访问
3.5k
 
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
int n;
    while (cin >> n) {
        string s;
        cin >> s;
        int initial_ones = 0;
        for (char c : s) {
            if (c == '1') {
                initial_ones++;
            }
        }
        if (initial_ones == n) {
            cout << n << endl;
            continue;
        }
        int max_gain = 0;
        int current_gai...
登录后发布评论
暂无评论,来抢沙发