用户输出
7
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#116942 | #1466. [L1-4] 排座位 | Accepted | 100 | 64 ms | 756 K | C++ 17 / 815 B | Sakura丶Charon | 2025-04-19 13:42:23 |
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define debug(...)
#else
#include <debug.hpp>
#endif
#define int long long
#define x first
#define y second
using namespace std;
const int mod = 998244353; // 1e9 + 7;
void pre() {}
void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int &i : a) cin >> i;
int maxx = 0, cnt = 0;
for (int i = 0; i < n; i += 2) {
cnt += a[i];
maxx = max(maxx, cnt);
}
cnt = 0;
for (int i = 1; i < n; i += 2) {
cnt += a[i];
maxx = max(maxx, cnt);
}
cout << maxx << '\n';
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int _ = 1;
// cin >> _;
pre();
while (_--) solve();
return 0;
}
10
-214442592 727638427 -162762810 810177901 -131419228 -206941528 662733475 71244559 36312067 -2914
<6 bytes omitted>
用户输出
1537816328
系统信息
Exited with return code 0
10
576108483 979325742 -644138027 217915108 -845952910 560588962 -136938729 -151086326 -320114929 -7
<9 bytes omitted>
用户输出
1757829812
系统信息
Exited with return code 0
50000
-180238264 -56633859 -124452422 -183424149 917572298 437550436 -425008284 -190677703 599835739
<519286 bytes omitted>
用户输出
200161258229
系统信息
Exited with return code 0
50000
-616351375 -353492348 -456056793 -191331979 449339946 13509555 -534962532 627945279 509684631
<519373 bytes omitted>
用户输出
188657527558
系统信息
Exited with return code 0
50000
-999838749 -941347120 -961367951 -863191546 -703541913 463798831 -536407870 -712811781 4091100
<519181 bytes omitted>
用户输出
161064767820
系统信息
Exited with return code 0
50000
-242188912 428086770 -805853130 639721639 885937994 344226731 -662848161 -808461448 -761778231
<519256 bytes omitted>
用户输出
157638398948
系统信息
Exited with return code 0
50000
336495166 -194686842 434790094 881974924 -299244430 -80492653 302289334 -712810337 122682228 -
<519274 bytes omitted>
用户输出
101751696542
系统信息
Exited with return code 0