第四题后半部分: for (int i = 0; i < n; ++i) { int t; cin >> t; sum += t; v.push_back(sum); } int po = 1; bool f = true; int r = 0; while (po<v.size()&&f) { for (int i = po; i < v.size(); ++i) { if (ma <= v[i]) { ma = v[i]; po = i; } } for (int i = r; i < po&&i<v.size(); ++i) { if (v[po] - v[i] >= sum && !(i == 0 && po == v.size() - 1)) { f = false; cout << "Yes" << '\n&(392)#39;; break; } } r = po; ++po; } if (f) { cout << "No" << '\n&(392)#39;; } } return 0; }