正文
增加 2 行删除 2 行
20 行未改动21222324252627282930313233343536373812 行未改动20 行未改动#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N = 1e3 + 5;ll n, a[N], js, os;bool check(ll x){ll ans = os * 2 + js - (ll)ceil(x / 2.0) * 2 - x / 2;return ans >= 0 && ans % 2 == 0 && js >= x / 2;//思路同上}int main(){cin >> n;for(int i = 1; i <= n; i++){cin >> a[i];}for(int i = 1; i <= n; i++){//统计奇数和偶数if(!(a[i] % 2)){os++;}else{12 行未改动20 行未改动21222324252627282930313233343536373812 行未改动20 行未改动#include<bits/stdc++.h>using namespace std;typedef long long ll;const ll N = 1e3 + 5;ll n, a[N], js, os;bool check(ll x){ll ans = os * 2 + js - (ll)ceil(x / 2.0) * 2 - x / 2;return ans >= 0 && ans % 2 == 0 && js >= x / 2;//思路同上}int main(){cin >> n;for(int i = 1; i <= n; i++){cin >> a[i];}for(int i = 1; i <= n; i++){//统计奇数和偶数if(!(a[i] % 2)){os++;}else{12 行未改动