只貼部分
#pragma GCC optimize("Ofast,fast-math,unroll-loops,no-stack-protector")int n,ans=0;char buf[2048],*p=buf;for(scanf("%d\n",&n),fread(buf,1,2048,stdin),++p;n--;p+=4)if(*p=='+')++ans;else --ans;