版本比较
0914东塘J2R开班测试
正文
增加 12 行删除 12 行
13 行未改动14151617181920212228 行未改动5152535455565758592 行未改动6263646566676869707172737475767728 行未改动10610710810911011111211311411511611711811912012112212312412512612712812913013113213385 行未改动21922022122222322422522622713 行未改动24124224324424524624724824925025125233 行未改动13 行未改动### 代码```cpp#include<bits/stdc++.h>using namespace std;long long a,b;int main(){cin>>a>>b;28 行未改动using namespace std;const int N = 5005;int n, x;int a[N], s[N];signed main() {ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)2 行未改动cin >> a[i];a[i] -= x;s[i] = s[i-1] + a[i];}int maxx = 0;for (int i=1; i<=n; i++) {for (int j=i; j<=n; j++) {int sum = s[j] - s[i-1];maxx = max(maxx, sum);}}cout << maxx;return 0;}```28 行未改动for (int i=1; i<=6; i++) {cin >> x;cnt[x]++;}int f = 0;for (int i=1; i<=9; i++) {if (cnt[i] >= 4) {f = 1;cnt[i] -= 4;}}if (f == 0) {cout << "Alien";return 0;}for (int i=1; i<=9; i++) {if (cnt[i] == 2) {f = 2;}}if (f == 2) cout << "Elephant";else cout << "Bear";return 0;}85 行未改动#define qwq ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)using namespace std;const int N = 1e5+5;struct P {int a, b;};bool cmp(P a1, P a2) {return a1.b < a2.b;}13 行未改动qwq;cin >> n;for (int i=1; i<=n; i++) cin >> a[i].a;for (int i=1; i<=n; i++) cin >> a[i].b;sort(a+1, a+1+n, cmp);for (int i=1; i<=n; i++) {s1[i] = s1[i-1] + a[i].a*a[i].b;s2[i] = s2[i-1] + a[i].a;}cin >> q;while (q--) {cin >> k;33 行未改动13 行未改动14151617181920212228 行未改动5152535455565758592 行未改动6263646566676869707172737475767728 行未改动10610710810911011111211311411511611711811912012112212312412512612712812913013113213385 行未改动21922022122222322422522622713 行未改动24124224324424524624724824925025125233 行未改动13 行未改动### 代码```cpp#include<bits/stdc++.h>using namespace std;long long a,b;int main(){cin>>a>>b;28 行未改动using namespace std;const int N = 5005;int n, x;int a[N], s[N];signed main() {ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)2 行未改动cin >> a[i];a[i] -= x;s[i] = s[i-1] + a[i];}int maxx = 0;for (int i=1; i<=n; i++) {for (int j=i; j<=n; j++) {int sum = s[j] - s[i-1];maxx = max(maxx, sum);}}cout << maxx;return 0;}```28 行未改动for (int i=1; i<=6; i++) {cin >> x;cnt[x]++;}int f = 0;for (int i=1; i<=9; i++) {if (cnt[i] >= 4) {f = 1;cnt[i] -= 4;}}if (f == 0) {cout << "Alien";return 0;}for (int i=1; i<=9; i++) {if (cnt[i] == 2) {f = 2;}}if (f == 2) cout << "Elephant";else cout << "Bear";return 0;}85 行未改动#define qwq ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)using namespace std;const int N = 1e5+5;struct P {int a, b;};bool cmp(P a1, P a2) {return a1.b < a2.b;}13 行未改动qwq;cin >> n;for (int i=1; i<=n; i++) cin >> a[i].a;for (int i=1; i<=n; i++) cin >> a[i].b;sort(a+1, a+1+n, cmp);for (int i=1; i<=n; i++) {s1[i] = s1[i-1] + a[i].a*a[i].b;s2[i] = s2[i-1] + a[i].a;}cin >> q;while (q--) {cin >> k;33 行未改动