segments.cpp: In function 'int main()':
segments.cpp:19:65: error: invalid operands of types 'long long int' and 'long long int [500005]' to binary 'operator-'
19 | ll pt=lower_bound(pref+1, pref+n+1, 2*pref[i]-pref[pos[i]-1]-pref;
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
| | |
| long long int long long int [500005]
segments.cpp:8:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
8 | scanf("%lld", &n);
| ~~~~~^~~~~~~~~~~~
segments.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
11 | scanf("%lld", &a[i]);
| ~~~~~^~~~~~~~~~~~~~~