Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
222867 | 232214陈皓轩 | *小美的加法 | C++ | Wrong Answer | 70 | 28 MS | 1832 KB | 455 | 2023-12-17 13:35:15 |
#include <iostream> using namespace std; int n; long long cnt[100005], a[100005]; int main() { cin >> n; for (int i = 1; i <= n; i++) { int t;//没个卵用 cin >> t; cnt[i] = t + cnt[i - 1], a[i] = t; //cout << cnt[i] << '\n'; } long long ans(0); for (int i = 1; i < n; i++) { ans = max(ans, cnt[n] - a[i] - a[i + 1] + a[i] * a[i + 1]); //cout << cnt[n] - a[i] - a[i + 1] + a[i] * a[i + 1] << '\n'; } cout << ans; }