segments.cpp:7:1: error: 'i' does not name a type
7 | i,j,n,dp[N];
| ^
segments.cpp:9:2: error: expected constructor, destructor, or type conversion before '(' token
9 | u(p) { for (;p<N;p+=p&-p) fw[p]-=(fw[p]-x)*(x<fw[p]); }
| ^
segments.cpp:11:1: error: ISO C++ forbids declaration of 's' with no type [-fpermissive]
11 | s(){
| ^
segments.cpp: In function 'int s()':
segments.cpp:13:39: error: 'n' was not declared in this scope
13 | for(int j=(1<<19);j;j>>=1)if(c+j<=n&&(fw[j+c]<p?fw[j+c]:p)>x)c+=j,p=(fw[c]<p?fw[c]:p);
| ^
segments.cpp: At global scope:
segments.cpp:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
16 | main()
| ^~~~
segments.cpp: In function 'int main()':
segments.cpp:18:17: error: 'n' was not declared in this scope
18 | scanf("%d",&n);for(;++i<N;fw[i]=1e18);
| ^
segments.cpp:18:27: error: 'i' was not declared in this scope
18 | scanf("%d",&n);for(;++i<N;fw[i]=1e18);
| ^
segments.cpp:19:10: error: 'i' was not declared in this scope
19 | for (i=1;i<=n;++i) scanf("%lld",a+i),x=a[i]+=a[i-1],dp[i]=1+dp[j=n+1-s(),j>0?j:(j=0)],x=2*a[i]-a[j],u(n-i+1);
| ^
segments.cpp:19:57: error: 'dp' was not declared in this scope; did you mean 'p'?
19 | for (i=1;i<=n;++i) scanf("%lld",a+i),x=a[i]+=a[i-1],dp[i]=1+dp[j=n+1-s(),j>0?j:(j=0)],x=2*a[i]-a[j],u(n-i+1);
| ^~
| p
segments.cpp:19:68: error: 'j' was not declared in this scope
19 | for (i=1;i<=n;++i) scanf("%lld",a+i),x=a[i]+=a[i-1],dp[i]=1+dp[j=n+1-s(),j>0?j:(j=0)],x=2*a[i]-a[j],u(n-i+1);
| ^
segments.cpp:19:105: error: 'u' was not declared in this scope
19 | for (i=1;i<=n;++i) scanf("%lld",a+i),x=a[i]+=a[i-1],dp[i]=1+dp[j=n+1-s(),j>0?j:(j=0)],x=2*a[i]-a[j],u(n-i+1);
| ^
segments.cpp:20:17: error: 'dp' was not declared in this scope; did you mean 'p'?
20 | printf("%d",dp[n]);
| ^~
| p