Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;


__int64 dis[100050];
__int64 nutri[100050];
__int64 clock[100050];
__int64 clock_ret[100050];
__int64 cclock[100050];
__int64 cclock_ret[100050];
int main()
{
    __int64 sum=0;
    __int64 n,c;
    cin>>n>>c;
    __int64 ans=0;
    for(int i=1;i<=n;i++){

        scanf("%I64d",&dis[i]);
        scanf("%I64d",&nutri[i]);
        clock[i] = nutri[i-1]+nutri[i]-dis[i];
        sum+=nutri[i];
        nutri[i] += nutri[i-1];
        clock_ret[i] = max(clock_ret[i-1],clock[i]-dis[i]);
    }
    for(int i=n;i>0;i--){
        cclock[i] = sum - nutri[i-1]-(c-dis[i]);
        cclock_ret[i] = max(cclock_ret[i+1],cclock[i]-(c-dis[i]));
    }
    for(int i=1;i<=n;i++){
        ans = max(ans,clock[i]);
        ans = max(ans,cclock[i]);
        ans = max(ans,clock_ret[i-1]+cclock[i]);
        ans = max(ans,cclock_ret[i+1]+clock[i]);
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    7 | __int64 dis[100050];
      | ^~~~~~~
      | __int64_t
a.cc:8:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    8 | __int64 nutri[100050];
      | ^~~~~~~
      | __int64_t
a.cc:9:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 | __int64 clock[100050];
      | ^~~~~~~
      | __int64_t
a.cc:10:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   10 | __int64 clock_ret[100050];
      | ^~~~~~~
      | __int64_t
a.cc:11:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   11 | __int64 cclock[100050];
      | ^~~~~~~
      | __int64_t
a.cc:12:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   12 | __int64 cclock_ret[100050];
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:15:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   15 |     __int64 sum=0;
      |     ^~~~~~~
      |     __int64_t
a.cc:16:12: error: expected ';' before 'n'
   16 |     __int64 n,c;
      |            ^~
      |            ;
a.cc:17:10: error: 'n' was not declared in this scope
   17 |     cin>>n>>c;
      |          ^
a.cc:17:13: error: 'c' was not declared in this scope
   17 |     cin>>n>>c;
      |             ^
a.cc:18:12: error: expected ';' before 'ans'
   18 |     __int64 ans=0;
      |            ^~~~
      |            ;
a.cc:21:24: error: 'dis' was not declared in this scope; did you mean 'div'?
   21 |         scanf("%I64d",&dis[i]);
      |                        ^~~
      |                        div
a.cc:22:24: error: 'nutri' was not declared in this scope
   22 |         scanf("%I64d",&nutri[i]);
      |                        ^~~~~
a.cc:23:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |         clock[i] = nutri[i-1]+nutri[i]-dis[i];
      |                ^
a.cc:24:9: error: 'sum' was not declared in this scope
   24 |         sum+=nutri[i];
      |         ^~~
a.cc:26:9: error: 'clock_ret' was not declared in this scope; did you mean 'clock_t'?
   26 |         clock_ret[i] = max(clock_ret[i-1],clock[i]-dis[i]);
      |         ^~~~~~~~~
      |         clock_t
a.cc:26:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |         clock_ret[i] = max(clock_ret[i-1],clock[i]-dis[i]);
      |                                                  ^
a.cc:29:9: error: 'cclock' was not declared in this scope; did you mean 'clock'?
   29 |         cclock[i] = sum - nutri[i-1]-(c-dis[i]);
      |         ^~~~~~
      |         clock
a.cc:29:21: error: 'sum' was not declared in this scope
   29 |         cclock[i] = sum - nutri[i-1]-(c-dis[i]);
      |                     ^~~
a.cc:29:27: error: 'nutri' was not declared in this scope
   29 |         cclock[i] = sum - nutri[i-1]-(c-dis[i]);
      |                           ^~~~~
a.cc:29:41: error: 'dis' was not declared in this scope; did you mean 'div'?
   29 |         cclock[i] = sum - nutri[i-1]-(c-dis[i]);
      |                                         ^~~
      |                                         div
a.cc:30:9: error: 'cclock_ret' was not declared in this scope; did you mean 'clock_t'?
   30 |         cclock_ret[i] = max(cclock_ret[i+1],cclock[i]-(c-dis[i]));
      |         ^~~~~~~~~~
      |         clock_t
a.cc:33:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         ans = max(ans,clock[i]);
      |         ^~~
      |         abs
a.cc:33:30: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   33 |         ans = max(ans,clock[i]);
      |                              ^
a.cc:34:23: error: 'cclock' was not declared in this scope; did you mean 'clock'?
   34 |         ans = max(ans,cclock[i]);
      |                       ^~~~~~
      |                       clock
a.cc:35:23: error: 'clock_ret' was not declared in this scope; did you mean 'clock_t'?
   35 |         ans = max(ans,clock_ret[i-1]+cclock[i]);
      |                       ^~~~~~~~~
      |                       clock_t
a.cc:36:23: error: 'cclock_ret' was not declared in this scope; did you mean 'clock_t'?
   36 |         ans = max(ans,cclock_ret[i+1]+clock[i]);
      |                       ^~~~~~~~~~
      |                       clock_t
a.cc:36:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |         ans = max(ans,cclock_ret[i+1]+clock[i]);
      |                                              ^
a.cc:38:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     cout<<ans<<endl;
      |           ^~~
      |           abs