Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
string T;

int main() {
  cin >> T;
  for (int i = 0; i < T.size(); ++i) {
    if (T[i] == '?') {
      cout << 'D';
      continue;
    }
    cout << T[i];
  }
  cout << endl;
}
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
string T;

int main() {
  cin >> T;
  for (int i = 0; i < T.size(); ++i) {
    if (T[i] == '?') {
      cout << 'D';
      continue;
    }
    cout << T[i];
  }
  cout << endl;
}


Compiler output:
a.cc:54:13: error: redefinition of 'template<class T> bool chmax(T&, T)'
   54 | inline bool chmax(T& a, T b) {
      |             ^~~~~
a.cc:10:13: note: 'template<class T> bool chmax(T&, T)' previously declared here
   10 | inline bool chmax(T& a, T b) {
      |             ^~~~~
a.cc:63:13: error: redefinition of 'template<class T> bool chmin(T&, T)'
   63 | inline bool chmin(T& a, T b) {
      |             ^~~~~
a.cc:19:13: note: 'template<class T> bool chmin(T&, T)' previously declared here
   19 | inline bool chmin(T& a, T b) {
      |             ^~~~~
a.cc:71:11: error: redefinition of 'const int inf'
   71 | const int inf = 1000000007;
      |           ^~~
a.cc:27:11: note: 'const int inf' previously defined here
   27 | const int inf = 1000000007;
      |           ^~~
a.cc:72:11: error: redefinition of 'const int MOD'
   72 | const int MOD = 1000000007;
      |           ^~~
a.cc:28:11: note: 'const int MOD' previously defined here
   28 | const int MOD = 1000000007;
      |           ^~~
a.cc:73:17: error: redefinition of 'const long long int INF'
   73 | const long long INF = 1000000000000000007;
      |                 ^~~
a.cc:29:17: note: 'const long long int INF' previously defined here
   29 | const long long INF = 1000000000000000007;
      |                 ^~~
a.cc:76:8: error: redefinition of 'std::string T'
   76 | string T;
      |        ^
a.cc:32:8: note: 'std::string T' previously declared here
   32 | string T;
      |        ^
a.cc:78:5: error: redefinition of 'int main()'
   78 | int main() {
      |     ^~~~
a.cc:34:5: note: 'int main()' previously defined here
   34 | int main() {
      |     ^~~~