版本比较
914第一次课
正文
增加 7 行删除 7 行
52 行未改动535455565757585960612 行未改动6465666768686970717273747576767778798029 行未改动11011111211311411411511611711811912012112212212312412512612712712812913013113213313313413513613739 行未改动52 行未改动using namespace std;
const int N = 5005;int n, x;int a[N], s[N]; int a[N], s[N];
signed main() { qwq;2 行未改动 cin >> a[i]; a[i] -= x; s[i] = s[i-1] + a[i]; }
// 枚举区间 i,j 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;}```29 行未改动 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;}39 行未改动