Language: C++

#include<bits/stdc++.h>
using namespce std;

int main(){
  cin >> n >> m;
  vector<int> p;
  vector<float> e;
  int num;
  for(int i=0;i<n;i++){
    cin >> num;
    p.push_back(num);
  }
  
  for(int i=0;i<n;i++){
    e.push_back((1+p[i])/2);
  }
  
  int res=-1;
  vector<float> cul;
  float c=0;
  for(int i=0;i<n;i++){
    c+=e[i];
    cul.push_back(c);
  }
  
  for(int i=0;i<=n-k;i++){
    res = max(res,cul[i+k-1]-cul[i]);
  }
  cout << res;
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n >> m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >> n >> m;
      |          ^
      |          yn
a.cc:5:15: error: 'm' was not declared in this scope; did you mean 'tm'?
    5 |   cin >> n >> m;
      |               ^
      |               tm
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> p;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> p;
      |          ^~~
a.cc:7:10: error: expected primary-expression before 'float'
    7 |   vector<float> e;
      |          ^~~~~
a.cc:11:5: error: 'p' was not declared in this scope
   11 |     p.push_back(num);
      |     ^
a.cc:15:5: error: 'e' was not declared in this scope
   15 |     e.push_back((1+p[i])/2);
      |     ^
a.cc:15:20: error: 'p' was not declared in this scope
   15 |     e.push_back((1+p[i])/2);
      |                    ^
a.cc:19:10: error: expected primary-expression before 'float'
   19 |   vector<float> cul;
      |          ^~~~~
a.cc:22:8: error: 'e' was not declared in this scope
   22 |     c+=e[i];
      |        ^
a.cc:23:5: error: 'cul' was not declared in this scope
   23 |     cul.push_back(c);
      |     ^~~
a.cc:26:20: error: 'k' was not declared in this scope
   26 |   for(int i=0;i<=n-k;i++){
      |                    ^
a.cc:27:19: error: 'cul' was not declared in this scope
   27 |     res = max(res,cul[i+k-1]-cul[i]);
      |                   ^~~
a.cc:27:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
   27 |     res = max(res,cul[i+k-1]-cul[i]);
      |           ^~~
      |           std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:29:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |   cout << res;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~