标签:style blog class code java c
#include <algorithm> #include <iostream> #include <iomanip> #include <complex> #include <cstring> #include <cstdlib> #include <string> #include <vector> #include <cstdio> #include <cmath> #include <map> #include <set> using namespace std; //#pragma comment(linker,"/STACK:102400000,102400000") int MAIN() { int n, now = 0, ans = 0; cin >> n; for(int i = 1; i <= n; i++) { int v; cin >> v; if(now + v < 0) ans ++; else now += v; } cout << ans << endl; return 0; } int main() { #ifdef LOCAL_TEST freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif ios :: sync_with_stdio(false); cout << fixed << setprecision(16); return MAIN(); }
标签:style blog class code java c
原文地址:http://www.cnblogs.com/acmicpcstar/p/3721875.html