Language: C++

class Solution {
public:

    int c(int n, int m, const vector<int>& t1, const vector<int>& t2, int k) {
       int res = 0;
       int i1, i2;
       i1 = i2 = 0;
       vector<ll> s1(n + 1 , 0), s2(m + 1, 0);
       for(int i = 1; i < n + 1; ++i) { s1[i] = s1[i - 1] + t1[i]; }
       for(int i = 1; i < m + 1; ++i) { s2[i] = s2[i - 1] + t2[i]; }

       int l = 0, r = n + m;
       while(l <= r) {
           int mid = (l + r) / 2;

           ll tres = INT64_MAX;
           for(int k = 0; k <= mid; ++k) {
               tres = min(tres, s1[k] + s2[mid - k]);
           }
           if(tres <= k) {
               res = mid;
               l = mid + 1;
           }
           else {
               r = mid - 1;
           }
       }



       return res;
    }
};

Compiler output:
a.cc:4:31: error: 'vector' does not name a type
    4 |     int c(int n, int m, const vector<int>& t1, const vector<int>& t2, int k) {
      |                               ^~~~~~
a.cc:4:37: error: expected ',' or '...' before '<' token
    4 |     int c(int n, int m, const vector<int>& t1, const vector<int>& t2, int k) {
      |                                     ^
a.cc: In member function 'int Solution::c(int, int, int)':
a.cc:8:8: error: 'vector' was not declared in this scope
    8 |        vector<ll> s1(n + 1 , 0), s2(m + 1, 0);
      |        ^~~~~~
a.cc:8:15: error: 'll' was not declared in this scope
    8 |        vector<ll> s1(n + 1 , 0), s2(m + 1, 0);
      |               ^~
a.cc:8:19: error: 's1' was not declared in this scope; did you mean 'i1'?
    8 |        vector<ll> s1(n + 1 , 0), s2(m + 1, 0);
      |                   ^~
      |                   i1
a.cc:8:34: error: 's2' was not declared in this scope; did you mean 'i2'?
    8 |        vector<ll> s1(n + 1 , 0), s2(m + 1, 0);
      |                                  ^~
      |                                  i2
a.cc:9:61: error: 't1' was not declared in this scope; did you mean 'i1'?
    9 |        for(int i = 1; i < n + 1; ++i) { s1[i] = s1[i - 1] + t1[i]; }
      |                                                             ^~
      |                                                             i1
a.cc:10:61: error: 't2' was not declared in this scope; did you mean 'i2'?
   10 |        for(int i = 1; i < m + 1; ++i) { s2[i] = s2[i - 1] + t2[i]; }
      |                                                             ^~
      |                                                             i2
a.cc:16:15: error: expected ';' before 'tres'
   16 |            ll tres = INT64_MAX;
      |               ^~~~
a.cc:18:16: error: 'tres' was not declared in this scope; did you mean 'res'?
   18 |                tres = min(tres, s1[k] + s2[mid - k]);
      |                ^~~~
      |                res
a.cc:18:23: error: 'min' was not declared in this scope; did you mean 'mid'?
   18 |                tres = min(tres, s1[k] + s2[mid - k]);
      |                       ^~~
      |                       mid
a.cc:20:15: error: 'tres' was not declared in this scope; did you mean 'res'?
   20 |            if(tres <= k) {
      |               ^~~~
      |               res
a.cc:20:23: error: 'k' was not declared in this scope
   20 |            if(tres <= k) {
      |                       ^