segments.cpp: In function 'int main()':
segments.cpp:19:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
19 | printf("%d\n",ans) ;
| ~^ ~~~
| | |
| int long long int
| %lld
segments.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d",&n) ;
| ~~~~~^~~~~~~~~
segments.cpp:9:40: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
9 | for(int i = 1 ; i <= n ; ++i) scanf("%lld",&a[i]) ;
| ~~~~~^~~~~~~~~~~~~~