Language: C++

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pull = pair<ull, ll>;
#define INF 1000000
#define LLINF 10000000000000000ll
#define MOD 1000000007LL

bool dbgflag = false;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n, k;
  cin >> n >> k;
  vector<ll> dice(n);
  for (int i = 0; i < n; i++) cin >> dice[i];

  for (int i = 1; i < n; i++) dice[i] += dice[i-1];

  ll temp = dice[k-1];
  for (int i = 0; i + k < n; i++) {
    temp = max(temp, dice[i+k] - dice[i]);
    if (dbgflag) cout << temp << endl;
  }

  cout << (temp + k) / 2;
  cout << (((temp + k)%2 == 0) ? .00000 : .50000) << endl;

}

Compiler output:
a.cc:4:13: error: 'pair' does not name a type
    4 | using pii = pair<int, int>;
      |             ^~~~
a.cc:5:13: error: 'pair' does not name a type
    5 | using pll = pair<ll, ll>;
      |             ^~~~
a.cc:6:14: error: 'pair' does not name a type
    6 | using pull = pair<ull, ll>;
      |              ^~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'cin' was not declared in this scope
   14 |   cin.tie(0);
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:15:3: error: 'ios' has not been declared
   15 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:19:3: error: 'vector' was not declared in this scope
   19 |   vector<ll> dice(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:19:12: error: expected primary-expression before '>' token
   19 |   vector<ll> dice(n);
      |            ^
a.cc:19:14: error: 'dice' was not declared in this scope
   19 |   vector<ll> dice(n);
      |              ^~~~
a.cc:26:12: error: 'max' was not declared in this scope
   26 |     temp = max(temp, dice[i+k] - dice[i]);
      |            ^~~
a.cc:27:18: error: 'cout' was not declared in this scope
   27 |     if (dbgflag) cout << temp << endl;
      |                  ^~~~
a.cc:27:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:34: error: 'endl' was not declared in this scope
   27 |     if (dbgflag) cout << temp << endl;
      |                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:30:3: error: 'cout' was not declared in this scope
   30 |   cout << (temp + k) / 2;
      |   ^~~~
a.cc:30:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:54: error: 'endl' was not declared in this scope
   31 |   cout << (((temp + k)%2 == 0) ? .00000 : .50000) << endl;
      |                                                      ^~~~
a.cc:31:54: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'