Login
Register
Problem list
Online status
lin zehao
:
2023-04-27 17:12:37
极简主义 #include
using namespace std; int main() { int m, n, src; cin >> m; for (int i = 0; i < m; i++) { cin >> n; int temp_max = -1e9; int temp_last = -1e9; for (int j = 0; j < n; j++) { cin >> src; temp_last = max(temp_last + src, src); temp_max = max(temp_max, temp_last); } cout << temp_max << endl; } }
XianLYY
:
2022-05-08 22:15:10
1
吴卫为
:
2020-11-27 18:39:59
5 -1 -5 -2 -1 -3 输出的结果为什么不是5呢
Post Your Comment