criyle/codenet-compile-errors huggingface dataset:
Language: C++


#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string T;
  cin >> T;
  int N;
  N = T.size();
  for (int i= 0; i<N; i++) {
    if (T.at(i)=="?") {
    if (T.at(i-1)=="P") {
      T.at(i)=="D";
    }
      else if (T.(i+1)=="D") {
        T.at(i)=="P";
      }
    }
    else {
    }
    cout << T <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if (T.at(i)=="?") {
      |         ~~~~~~~^~~~~
a.cc:12:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if (T.at(i-1)=="P") {
      |         ~~~~~~~~~^~~~~
a.cc:13:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       T.at(i)=="D";
      |       ~~~~~~~^~~~~
a.cc:15:18: error: expected unqualified-id before '(' token
   15 |       else if (T.(i+1)=="D") {
      |                  ^
a.cc:16:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         T.at(i)=="P";
      |         ~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

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

int main() {
string t;cin>>t;

// 無限大の値
const long long INF = 1LL << 60;

// DP テーブル
long long dp[100010];

// DP テーブル全体を初期化 (最小化問題なので INF に初期化)
for (int i = 0; i < 100010; ++i) dp[i] = INF;

// 初期条件
dp[0] = 0;

// ループ
for (int i = 0; i < t.length(); ++i) {
    if(t.at[i] == '?'){
      t.at[i] = 'P';
      
    }

    chmax(dp[i], dp[i] + 1);
}


// 解を得て出力
cout << t << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   33 |     if(t.at[i] == '?'){
      |            ^
a.cc:34:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |       t.at[i] = 'P';
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#include<iostream>
#include<bitset>

int PD(string A){
 int t = 0;
 int s = A.size();
   rep(i,s){
   if(A.at(i) == 'D'){
   t = t + 1;
   }
   }
   rep(i,s){
   if(A.at(i) == 'P'){
   if(A.at(i + 1) == 'D'){
   t = t + 1;
   }
   }
   }
   return t;
 }

int main() {

 string T;
 cin >> T;
  int s = T.size();
  int count = 0;
  
  rep(i,s){
  if(T.at(i) == '?'){
  count += 1;
  }
  }
  
  int a = 1;
  rep(i,count){
  a = a*2;
  }
  string X;
  rep(i,s){
  if(T.at(i) == '?'){
   X.at(i) = 'D';
  }
    else{
    X.at(i) = T.at(i);
    }
  }
  int P = PD(X);
  
 vector<string> ct(a);
 vector<int> tt(a);
   
  rep(j,s){
  bitset<32> value(j);
   string TX = value;
   rep(i,s){
  if(T.at(i) == '?'){
   if(TX.at(i) == '0'){
   ct.at(j).at(i) = 'P';
  }
    else if(TX.at(i) == '1'){
     ct.at(j).at(i) = 'D';
    }
  }
  } 
  tt.at(j) = PD(ct.at(j));
    if(tt.at(j) >= P){
    X = ct.at(j);
    }
   }
  cout << X << endl;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:16: error: conversion from 'std::bitset<32>' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   60 |    string TX = value;
      |                ^~~~~
Language: C++

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

int main() {
  string S;
  int x =S.size();
  
  if(x%2==0){
    for(int i=0;i<x/2;i++){
      if(char(i)=='?' && char(i+1)=='D')
        cout<<"PD";
      if(char(i)=='P' && char(i+1)=='?')
        cout<<"PD";
      if(char(i)=='D' && char(i+1)=='?'){
        if(char(i+2)=='D')
          cout<<DP;
        else
          cout<<"DD";
      if(char(i)=='?' && char(i+1)=='P')
          cout<<"DP";
      }    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'DP' was not declared in this scope
   16 |           cout<<DP;
      |                 ^~
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:8:13: note: to match this '{'
    8 |   if(x%2==0){
      |             ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  char c[3]="PD?";
  char a[200000];//文字列PD?
  int b;//aの文字数
  scanf("%s",a);
  b=strlen(a);
  for(int i=0;i<b;i++){
    if(a[i]==c[2]){
      if(a[i+1]==c[2]){
        if((i==0)||(a[i-1]==c[0])){
          a[i]='D';
        }
        else if(a[i-1]==c[1]){
          a[i]='P';
        }
      }
      else if((a[i+1]==c[0])||(a[i+1]==c[3]){
        a[i]='D';
      }
      else if(a[i+1]==c[1]){
        a[i]='P';
      }
    }
  }
  printf("%s",a);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:45: error: expected ')' before '{' token
   19 |       else if((a[i+1]==c[0])||(a[i+1]==c[3]){
      |              ~                              ^
      |                                             )
main.c:25:5: error: expected expression before '}' token
   25 |     }
      |     ^
Language: C

#include<stdio.h>

int main(void){
    int i;
    char T[200001];

    scanf_s("%s", T, 200001);

    for(i = 0;T[i] == '\0'; i++){
        if(T[i] == '?'){
            if(T[i - 1] == 'P') T[i] = 'D';
            else if(T[i + 1] == 'D') T[i] = 'P';
            else if(T[i + 1] == 'P') T[i] = 'D';
            else if(T[i + 1] == '?') T[i] = 'P';
        }
    }
    printf("%s", T);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |     scanf_s("%s", T, 200001);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#include<iostream>
#include<bitset>

int PD(string A){
 int t = 0;
 int s = A.size();
   rep(i,s){
   if(A.at(i) == 'D'){
   t = t + 1;
   }
   }
   rep(i,s){
   if(A.at(i) == 'P'){
   if(A.at(i + 1) == 'D'){
   t = t + 1;
   }
   }
   }
   return t;
 }

int main() {

 string T;
 cin >> T;
  int p = 0;
  int s = T.size();
  int count = 0;
  
  rep(i,s){
  if(T.at(i) == '?'){
  count += 1;
  }
  }
  
  int a = 1;
  rep(i,count){
  a = a*2;
  }
  string X;
  rep(i,s){
  if(T.at(i) == '?'){
   X.at(i) = 'D';
  }
    else{
    X.at(i) = T.at(i);
    }
  }
  int P = PD(X);
  
 vector<string> ct(a);
 vector<int> tt(a);
   
  rep(j,s){
  bitset<32> value(j);
   rep(i,s){
  if(T.at(i) == '?'){
   if(value.at(i) == '0'){
   ct.at(j).at(i) = 'P';
  }
    else if(j == '1'){
     ct.at(j.)at(i) = 'D';
    }
  }
  } 
  tt.at(j) = PD(ct.at(j));
    if(tt.at(j) >= P){
    X = ct.at(j);
    }
   }
  cout << X << endl;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: 'class std::bitset<32>' has no member named 'at'
   63 |    if(value.at(i) == '0'){
      |             ^~
a.cc:67:14: error: expected unqualified-id before ')' token
   67 |      ct.at(j.)at(i) = 'D';
      |              ^
Language: C

#include <stdio.h>
#include <math.h>
 
int main(void) {

	char s[200001], t[200001] ;
	int i;
	
	scanf("%s", s);

	for(i = 0; s[i] != '\0'; i++){
		else if(s[i] == 'P'){
			t[i] = 'P';
			continue;
		}
		else if(s[i] == 'D'){
			t[i] = 'D';
			continue;
		}
//////////////////////////////////////////////
		else if(s[i] == '?' && (s[i - 1] == 'P' || s[i + 1] == 'P' || s[i + 1] == '\0'))
			t[i] = 'D';
		else if(s[i] == '?' && s[i + 1] == 'D')
			t[i] = 'P';
		else if(s[i] == '?' && s[i + 1] == '?'){
			t[i] = 'D';
			t[i + 1] = 'D';
			i++;
		}
	}
	
	printf("%s", t);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:17: error: 'else' without a previous 'if'
   12 |                 else if(s[i] == 'P'){
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#include<iostream>
#include<bitset>

int PD(string A){
 int t = 0;
 int s = A.size();
   rep(i,s){
   if(A.at(i) == 'D'){
   t = t + 1;
   }
   }
   rep(i,s){
   if(A.at(i) == 'P'){
   if(A.at(i + 1) == 'D'){
   t = t + 1;
   }
   }
   }
   return t;
 }

int main() {

 string T;
 cin >> T;
  int p = 0;
  int s = T.size();
  int count = 0;
  
  rep(i,s){
  if(T.at(i) == '?'){
  count += 1;
  }
  }
  
  int a = 1;
  rep(i,count){
  a = a*2;
  }
  string X;
  rep(i,s){
  if(T.at(i) == '?'){
   X.at(i) = 'D';
  }
    else{
    X.at(i) = T.at(i);
    }
  }
  int P = PD(X);
  
 vector<string> ct(a);
 vector<int> tt(a);
   
  rep(j,s){
  bitset<32> value(j);
   rep(i,s){
  if(T.at(i) == '?'){
   if(value.at(i) == 0){
   ct.at(j).at(i) = 'P';
  }
    else if(j == 1){
     ct.at(j).at(i) = 'D';
    }
  }
  } 
  tt.at(j) = PD(ct.at(j));
    if(tt.at(j) >= D){
    X = ct.at(j);
    }
   }
  cout << X << endl;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: 'class std::bitset<32>' has no member named 'at'
   63 |    if(value.at(i) == 0){
      |             ^~
a.cc:72:20: error: 'D' was not declared in this scope
   72 |     if(tt.at(j) >= D){
      |                    ^
Language: C

#include<stdio.h>

int main(void){
    int i;
    char T[200001];
    char nT[200001];

    scanf_s("%s", T, 200001);

    for(i = 0;T[i] == '\0'; i++){
        if(T[i] == '?'){
            if(T[i - 1] == 'P') nT[i] = 'D';
            else if(T[i + 1] == 'D') nT[i] = 'P';
            else if(T[i + 1] == 'P') nT[i] = 'D';
            else if(T[i + 1] == '?') nT[i] = 'P';
        }
        else nT[i] = T[i];
    }
    printf("%s", nT);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |     scanf_s("%s", T, 200001);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#include<iostream>
#include<bitset>

int PD(string A){
 int t = 0;
 int s = A.size();
   rep(i,s){
   if(A.at(i) == 'D'){
   t = t + 1;
   }
   }
   rep(i,s){
   if(A.at(i) == 'P'){
   if(A.at(i + 1) == 'D'){
   t = t + 1;
   }
   }
   }
   return t;
 }

int main() {

 string T;
 cin >> T;
  int p = 0;
  int s = T.size();
  int count = 0;
  
  rep(i,s){
  if(T.at(i) == '?'){
  count += 1;
  }
  }
  
  int a = 1;
  rep(i,count){
  a = a*2;
  }
  string X;
  rep(i,s){
  if(T.at(i) == '?'){
   X.at(i) = 'D';
  }
    else{
    X.at(i) = T.at(i);
    }
  }
  P = PD(X);
  
 vector<string> ct(a);
 vector<int> tt(a);
   
  rep(j,s){
  bitset<32> value(j);
   rep(i,s){
  if(T.at(i) == '?'){
   if(value.at(i) == 0){
   ct.at(j).at(i) = 'P';
  }
    else if(j == 1){
     ct.at(j.)at(i) = 'D';
    }
  }
  } 
  tt.at(j) = PD(ct.at(j));
    if(tt.at(j) >= D){
    X = ct.at(j);
    }
   }
  cout << X << endl;
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: expected unqualified-id before '=' token
   54 |   P = PD(X);
      |     ^
a.cc:63:13: error: 'class std::bitset<32>' has no member named 'at'
   63 |    if(value.at(i) == 0){
      |             ^~
a.cc:67:14: error: expected unqualified-id before ')' token
   67 |      ct.at(j.)at(i) = 'D';
      |              ^
a.cc:72:20: error: 'D' was not declared in this scope
   72 |     if(tt.at(j) >= D){
      |                    ^
Language: C

#include <stdio.h>
 
int main(void) {
  char T[200000], A[200000];
  if(scanf("%s", T)==1);
  int i, frag;
  for (i=0; i<200000; i++) {
    if(T[i]=='P'||T[i]=='D') {
		A[i]=T[i];
    }
    else if (T[i]=='?') {
      if (A[i-1]=='D'&&(T[i+1]=='D'||(T[i+1]=='?')) {
        A[i]='P';
      }
      else {
      	A[i]='D';
      }
    }
    else {
      break;
    }
  }
  printf("%s", A);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:52: error: expected ')' before '{' token
   12 |       if (A[i-1]=='D'&&(T[i+1]=='D'||(T[i+1]=='?')) {
      |          ~                                         ^~
      |                                                    )
main.c:18:5: error: expected expression before '}' token
   18 |     }
      |     ^
Language: C++

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

int main(){
  string T;
  char S[200010];
  char U[200010];
  int count1 = 0, count2 = 0;
  for(int i = 0; i < T.size(); i++){
    if(T[i] =! '?'){
      S[i] = T[i];
    }else{ 
      S[i] = 'D';
    }
  }
  for(int i = 0; i < T.size(); i++){
    if(T[i] =! '?'){
      U[i] = T[i];
    }else{ 
      U[i] = 'P';
    }
  }
    
  
  
  for(int i = 0; i < S.size() - 1; i ++){
    if((S[i] == 'D'&& S[i + 1] == 'D') || ( S[i] == 'P' && S[i + 1] == 'D')){
      count1++;
    }
  }

  
for(int i = 0; i < U.size() - 1; i ++){
  if((U[i] == 'D'&& U[i + 1] == 'D') || ( U[i] == 'P' && U[i + 1] == 'D')){
    count2++;
       }
    }
int c;
if(count1 >= count2) c = count1;
else c = count2;

 cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: request for member 'size' in 'S', which is of non-class type 'char [200010]'
   26 |   for(int i = 0; i < S.size() - 1; i ++){
      |                        ^~~~
a.cc:33:22: error: request for member 'size' in 'U', which is of non-class type 'char [200010]'
   33 | for(int i = 0; i < U.size() - 1; i ++){
      |                      ^~~~
Language: C

#include <stdio.h>
 
int main(void) {
  char T[200000], A[200000];
  if(scanf("%s", T)==1);
  int i, frag;
  for (i=0; i<200000; i++) {
    if(T[i]=='P'||T[i]=='D') {
		A[i]=T[i];
    }
    else if (T[i]=='?') {
      if (T[i-1]=='D'&&(T[i+1]=='D'||(T[i+1]=='?') {
        A[i]='P';
      }
      else {
      	A[i]='D';
      }
    }
    else {
      break;
    }
  }
  printf("%s", A);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:51: error: expected ')' before '{' token
   12 |       if (T[i-1]=='D'&&(T[i+1]=='D'||(T[i+1]=='?') {
      |                        ~                          ^~
      |                                                   )
main.c:17:8: error: expected ')' before '}' token
   17 |       }
      |        ^
      |        )
   18 |     }
      |     ~   
main.c:12:10: note: to match this '('
   12 |       if (T[i-1]=='D'&&(T[i+1]=='D'||(T[i+1]=='?') {
      |          ^
main.c:18:5: error: expected expression before '}' token
   18 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
 
  string data;
  cin >> data;
  
  for(int i=0;i<(int)data.size()-1;i++){
    if(data.substr(i, 1)=="?"){
		data.replace(i+1, 1, "D");
    }
	if(data.substr(i, 1)=="P" && data.substr(i+1, 1)=="?"){
		data.replace(i+1, 1, "D");
    }else if(data.substr(i, 1)=="D" && data.substr(i+1, 1)=="?"){
      	data.replace(i+1, 1, "D");
    }
  }
  }
  cout << data << endl;
  return 0;
}

Compiler output:
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << data << endl;
      |   ^~~~
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

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

int main(){

  string str;
  cin >> str;
  int len = str.length();

  for(int i=0;i<len;i++){
    if(len==1 && str[0]=='?'){
      str[0]='D';
      return;
    }else{
      if(str[i]=='?'){
        if(i==0){
          if(str[i+1]!='P') str[i]='P';
          else str[i]='D';
        }else if(i==(len-1)){
          str[i]='D';
        }else{
          if(str[i-1]=='D' && str[i+1]!='P') str[i]='P';
          else str[i]='D';
        }
      }
    }
  }
  cout << str << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |       return;
      |       ^~~~~~
Language: Java


import java.util.Scanner;

public class Postdocs {
  public static void Main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] out = s.toCharArray();
    
    int index = 0;
    if(out[index] == '?') out[index] = 'D';
    index++;
    while(index < out.length) {
      if(out[index] == '?') {
        if(out[index-1] == 'P') {
          out[index] = 'D';
        }
        else {
          if(index < out.length - 1 && out[index+1] == '?') {
            out[index] = 'P';
            out[index+1] = 'D';
          }
          else {
            out[index] = 'D';
          }
        }
      }
      index++;
    }
    
    
    String outStr = new String(out);
    System.out.println(outStr);
    
  }
}


Compiler output:
Main.java:4: error: class Postdocs is public, should be declared in a file named Postdocs.java
public class Postdocs {
       ^
1 error
Language: C

#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
    char str[1000];
    int l,i;
    scanf("%s",&str);
    l=strlen(str);
    for(i=2;i<l+2;i++)
    {
        if(i%2==0)
        {
            printf("P");
        }
        else
            printf("D");
    }
    printf("\n");


}


Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

 #include <bits/stdc++.h>

using namespace std;
int main(){
    cin >> input;

    string pd = input;
    string capital,preCapital,newCapital,ans;

    for(int i = 0; i < (int)pd.size(); ++i){
        newCapital = pd[i];        

        if(newCapital == "?"){
          capital = 'D';
        }else{
          capital = newCapital;
        }

        ans = ans + capital;
    }
    
    printf("%s\n",ans.c_str());


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'input' was not declared in this scope; did you mean 'int'?
    5 |     cin >> input;
      |            ^~~~~
      |            int
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(int i=s;i <= n;i++)

int main()
{
  string str;
  cin >> str;
  
  int length=0;
  while(str[length]!=0)
    length++;
  
  if(str[0]=='?')
    str[i]='D';
  rep(i,1,length)
  {
    if(str[i]=='?')
    {
      str[i]='D';
    }  
  }   
  cout <<str << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     str[i]='D';
      |         ^
Language: C

#include <stdio.h>
#include <string.h>

int main() {
	size_t len;
	int b = 0;
	char t[10005];
	scanf_s("%s", t, 10005);
	len = strlen(t);
	b = len;
	for (int i = 0; i < b; i++) {
		if (t[i] == '?') t[i] = 'D';
	}
	printf("%s", t);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%s", t, 10005);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
    char str[1000];
    int l,i;
    scanf("%s",&str);
    l=strlen(str);
    for(i=2;i<l+2;i++)
    {
        if(i%2==0)
        {
            printf("P");
        }
        else
            printf("D");
    }
    printf("\n");


}


Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for(ll i = a; i < (ll)(b); i++)

#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

using namespace std;
using ll = long long;
using vel = vector<ll>;
using ves = vector<string>;
using veb = vector<bool>;

using qul = queue<ll>;

int main() {
    string T, T2,T3;
    char mae = 'P';
    cin >> T;
    T = T + 'S';
    T2 = T;
    ll len = T.size(),count1 = 0,count2 = 0;
    
    REP(i, len + 1) {
        if(mae == 'P' && T[i] == '?') {
            T[i] = 'D';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == '?') {
            T[i] = 'P';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == 'D') {
            T[i] = 'P';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == 'P') {
            T[i] = 'D';
        }

        mae = T[i];
    }

    mae = 'S';
    REP(i,count1){
        if(T[i] == 'D')
            count1++;
        else if(mae == 'P' && T[i] == 'D')
            count1++;

        mae = T[i];
    }


    T3 = T;

    mae = 'D';
    T = T2;
    ll len = T.size();

    REP(i, len + 1) {
        if(mae == 'P' && T[i] == '?') {
            T[i] = 'D';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == '?') {
            T[i] = 'P';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == 'D') {
            T[i] = 'P';
        } else if(mae == 'D' && T[i] == '?' && T[i + 1] == 'P') {
            T[i] = 'D';
        }

        mae = T[i];
    }

    mae = 'S';
    REP(i, count1) {
        if(T[i] == 'D')
            count2++;
        else if(mae == 'P' && T[i] == 'D')
            count2++;

        mae = T[i];
    }

    if(count1 > count2){
        cout << T3.erase(len) << endl;
    } else {
        cout << T3.erase(len) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:8: error: redeclaration of 'll len'
   54 |     ll len = T.size();
      |        ^~~
a.cc:23:8: note: 'll len' previously declared here
   23 |     ll len = T.size(),count1 = 0,count2 = 0;
      |        ^~~
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    String text = scanner.next();
    
    if(text.charAt(text.length - 1) == '?'){
        text = text.substring(0, text.length - 1) + "D";
    }
    
    while(text.indexOf("?") > -1){
        text = text.replaceAll("P\\?", "PD");
        text = text.replaceAll("\\?D", "PD");
    }
    
    System.out.println(text);
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
    if(text.charAt(text.length - 1) == '?'){
                       ^
  symbol:   variable length
  location: variable text of type String
Main.java:9: error: cannot find symbol
        text = text.substring(0, text.length - 1) + "D";
                                     ^
  symbol:   variable length
  location: variable text of type String
2 errors
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    String text = scanner.next();
    
    if(text.charAt(text.length - 1) == '?'){
        text = text.substring(0, text.length - 1) + "D";
    }
    
    while(text.indexOf("?") > -1){
        text = text.replaceAll("P\?", "PD");
        text = text.replaceAll("\?D", "PD");
    }
    
    System.out.println(text);
  }
}

Compiler output:
Main.java:13: error: illegal escape character
        text = text.replaceAll("P\?", "PD");
                                  ^
Main.java:14: error: illegal escape character
        text = text.replaceAll("\?D", "PD");
                                 ^
2 errors
Language: C++

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

int main(){
  string T;
  if('?' = 'P'){
    
  int count1 = 0, count2 = 0;
  for(int i = 0; i < T.size() - 1; i ++){
    if((T[i] == 'D'&& T[i + 1] == 'D') || ( T[i] == 'P' && T[i + 1] == 'D')){
      count1++;
    }
  }
}else if('?' = 'D'){
for(int i = 0; i < T.size() - 1; i ++){
  if((T[i] == 'D'&& T[i + 1] == 'D') || ( T[i] == 'P' && T[i + 1] == 'D')){
    count2++;
  }
}

int c;
if(count1 >= count2) c = count1;
else c = count2;

 cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: lvalue required as left operand of assignment
    6 |   if('?' = 'P'){
      |      ^~~
a.cc:14:10: error: lvalue required as left operand of assignment
   14 | }else if('?' = 'D'){
      |          ^~~
a.cc:17:5: error: 'count2' was not declared in this scope
   17 |     count2++;
      |     ^~~~~~
a.cc:22:4: error: 'count1' was not declared in this scope
   22 | if(count1 >= count2) c = count1;
      |    ^~~~~~
a.cc:22:14: error: 'count2' was not declared in this scope
   22 | if(count1 >= count2) c = count1;
      |              ^~~~~~
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string t;
  cin >> t;
  int i;
  for(i=0;i<ts.size();i++){
    if(t.at(i)=='?'){
      if(t.at(i-1)=='P'){
        t.at(i)='D';
      }
      else if(t.at(i-1)=='D'){
        t.at(i)='P';
      }
    }
  }
  cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'ts' was not declared in this scope; did you mean 't'?
    8 |   for(i=0;i<ts.size();i++){
      |             ^~
      |             t
Language: C

#include <stdio.h>
#include <math.h>
 
int main(void) {

	char s[200001], t[200001] ;
	int i;
	
	scanf("%s", s);

	for(i = 0; ; i++){
		if(s[i] == '\0')
			break;
		else if(s[i] == 'P'){
			t[i] = 'P';
			continue;
		}
		else if(s[i] == 'D'){
			t[i] = 'D';
			continue;
		}
//////////////////////////////////////////////
		else if(s[i] == '?' && s[i - 1] == 'P' || s[i + 1] == 'P')
			t[i] = 'D';
		else if(s[i] == '?' && s[i + 1] == 'D')
			t[i] = 'D';
		else if(s[i] == '?' && s[i + 1] == '?'){
			t[i] = 'P';
			t[i + 1] = 'D';
			i++;
		}
		}
	}
	
	printf("%s", t);
	
	
	return 0;
}

Compiler output:
main.c:35:16: error: expected declaration specifiers or '...' before string constant
   35 |         printf("%s", t);
      |                ^~~~
main.c:35:22: error: unknown type name 't'
   35 |         printf("%s", t);
      |                      ^
main.c:38:9: error: expected identifier or '(' before 'return'
   38 |         return 0;
      |         ^~~~~~
main.c:39:1: error: expected identifier or '(' before '}' token
   39 | }
      | ^
Language: C

#include<stdio.h>
#include<string>

int main(){
  char doctor[20000];
  int i;

  scanf("%s",doctor);
  
  for(i=0;i<sizeof(doctor);i++){
    if(doctor[i] == '?'){
      doctor[i] = 'D';
    }
  }
  printf("%s",doctor);
  return 0;
}

Compiler output:
main.c:2:9: fatal error: string: No such file or directory
    2 | #include<string>
      |         ^~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  string t;cin>>t;
  long long s=t.size();
  for(long long i=0;i<s;i++){
    if(t.at(i)=='?'){
      if(t.at(i-1)=='P')
        t.at(i)='D';
      int a=0;
      else{
        if(i!=s-1){
          /*if(t.at(i+1)=='D'||t.at(i+1)=='?')
            t.at(i)='P';
          else
            t.at(i)='D';*/
          a++;
        }
        else
          t.at(i)='D';
      }
      if(a==1){
        if(t.at(i+1)=='D'||t.at(i+1)=='?')
            t.at(i)='P';
          else
            t.at(i)='D'
      }
    }
  }
  cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: expected '}' before 'else'
   12 |       else{
      |       ^~~~
a.cc:8:21: note: to match this '{'
    8 |     if(t.at(i)=='?'){
      |                     ^
a.cc:18:11: error: 'a' was not declared in this scope
   18 |           a++;
      |           ^
a.cc:23:10: error: 'a' was not declared in this scope
   23 |       if(a==1){
      |          ^
a.cc:27:24: error: expected ';' before '}' token
   27 |             t.at(i)='D'
      |                        ^
      |                        ;
   28 |       }
      |       ~                 
a.cc: At global scope:
a.cc:31:3: error: 'cout' does not name a type
   31 |   cout << t << endl;
      |   ^~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

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

int main(void){
	string t;
	long int i,countD=0,countPD=0;
	cin >> t;
	if(t[0]=='?'){
		if(t[1]=='D')t[0]='P';
		else t[0]=='D';
	}
	i=1;
	while(t[i]!='\0'){
		if(t[i]=='?'){
			else if(t[i+1]=='D')t[i]='P';
			//if (t[i-1]=='P')t[i]='D';
			
			else t[i]='D';
		}
		i++;
	}

	if(t[0]=='D')countD++;
	//for(i=1;i<t.length();i++){
		i=1;
		while(t[i]!='\0'){
		if(t[i]=='D'){
			countD++;
			if(t[i-1]=='P')countPD++;
		}
		i++;
	}
	cout << t << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected '}' before 'else'
   15 |                         else if(t[i+1]=='D')t[i]='P';
      |                         ^~~~
a.cc:14:30: note: to match this '{'
   14 |                 if(t[i]=='?'){
      |                              ^
a.cc: At global scope:
a.cc:23:9: error: expected unqualified-id before 'if'
   23 |         if(t[0]=='D')countD++;
      |         ^~
a.cc:25:17: error: 'i' does not name a type
   25 |                 i=1;
      |                 ^
a.cc:26:17: error: expected unqualified-id before 'while'
   26 |                 while(t[i]!='\0'){
      |                 ^~~~~
a.cc:33:9: error: 'cout' does not name a type
   33 |         cout << t << endl;
      |         ^~~~
a.cc:34:1: error: expected unqualified-id before 'return'
   34 | return 0;
      | ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
 
  string data;
  cin >> data;
  for(int i=0;i<(int)data.size()-1;i++){
	if(data.substr(i, 1)=="P"){
		data[i+1].push_back("D");
    }else if(data.substr(i, 1)=="D"){
		data[i+1].push_back("P");
    }
  }
  cout << data << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: request for member 'push_back' in 'data.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   11 |                 data[i+1].push_back("D");
      |                           ^~~~~~~~~
a.cc:13:27: error: request for member 'push_back' in 'data.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   13 |                 data[i+1].push_back("P");
      |                           ^~~~~~~~~
Language: C++

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

#define ll long long
#define ld long double

const int MOD = 1e9 + 7;
#define INF 2e9

#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement) regex_replace(_str, regex(_ptn), _replacement)

# define pb push_back

# define INIT() cin.tie(0); ios::sync_with_stdio(false); cout << fixed << std::setprecision(20)

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

string s;
int main() {
    INIT();
    cin >> s;
    char prev = 'D';
    s = REPLACE(s, "\\?D", "PD");
    for(ll i = 0; i< s.size(); i++) {
        if(s[i] == '?') {
            s[i] = 'D'
        }
        cout << s[i];
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:23: error: expected ';' before '}' token
   36 |             s[i] = 'D'
      |                       ^
      |                       ;
   37 |         }
      |         ~
Language: C++

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

int main() {

  string T;
  cin >> T;
  
  for( char c : T){
    if(c == "?"){
      c = "D";
    }
    cout << c;
  }
    cout << endl;
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(c == "?"){
      |        ~~^~~~~~
a.cc:11:11: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 |       c = "D";
      |           ^~~
      |           |
      |           const char*
a.cc: At global scope:
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');

    if(sb.charAt(sb.length() - 2) == '?'){
        sb.setChatAt(sb.length() - 2, 'D');
    }
    
    while(sb.indexOf("?") > -1){
      for(int i = 1; i < sb.length() - 1; i++){
        if(sb.charAt(i) == '?'){
          if(sb.charAt(i - 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == 'D'){
            sb.setCharAt(i, 'P');
          }else if(sb.charAt(i + 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == '?'){
            continue;
          }
        }
      }
    }
        
    System.out.println(sb.substring(1, sb.length() - 1));
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
        sb.setChatAt(sb.length() - 2, 'D');
          ^
  symbol:   method setChatAt(int,char)
  location: variable sb of type StringBuilder
1 error
Language: C++

#include<iostream>
#include<string>
#include <sstream>
#include <stdio.h>
#include <math.h>
using namespace std;
 
int main() {
    long string t; 
    cin >> t; 
   
    for(long long i=0;i < t.size()-1;i+=1){
        if(t[i]=='?'){
            if(t[i+1]=='D'){
                t[i]='P';
            }else{
                t[i]='D';     
            }
            
        }
    }
    if(t[t.size()-1]=='?'){
     t[t.size()-1]='D';
    }
    cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected initializer before 't'
    9 |     long string t;
      |                 ^
a.cc:10:12: error: 't' was not declared in this scope; did you mean 'tm'?
   10 |     cin >> t;
      |            ^
      |            tm
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');

    if(sb.charAt(sb.length() - 2) == '?'){
        sb.setChatAt(sb.length() - 2, 'D')
    }
    
    while(sb.indexOf("?") > -1){
      for(int i = 1; i < sb.length() - 1; i++){
        if(sb.charAt(i) == '?'){
          if(sb.charAt(i - 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == 'D'){
            sb.setCharAt(i, 'P');
          }else if(sb.charAt(i + 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == '?'){
            continue;
          }
        }
      }
    }
        
    System.out.println(sb.substring(1, sb.length() - 1));
  }
}

Compiler output:
Main.java:9: error: ';' expected
        sb.setChatAt(sb.length() - 2, 'D')
                                          ^
1 error
Language: C++

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

int main() {

  string T;
  cin >> T;
  
  for( char c : T){
    if(c == "?"){
      c = "D";
    }
    cout << c;
  }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(c == "?"){
      |        ~~^~~~~~
a.cc:11:11: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 |       c = "D";
      |           ^~~
      |           |
      |           const char*
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');

    while(sb.indexOf("?") > -1)
      for(int i = 1; i < sb.length() - 1; i++){
        if(sb.charAt(i) == '?'){
          if(sb.charAt(i - 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == 'D'){
            sb.setCharAt(i, 'P');
          }else if(sb.charAt(i + 1) == 'P'){
            sb.setCharAt(i, 'D');
          }else if(sb.charAt(i + 1) == '?'){
            continue;
          }
        }
      }
    }
        
    System.out.println(sb.substring(1, sb.length() - 1));
  }
}

Compiler output:
Main.java:24: error: <identifier> expected
    System.out.println(sb.substring(1, sb.length() - 1));
                      ^
Main.java:24: error: <identifier> expected
    System.out.println(sb.substring(1, sb.length() - 1));
                                   ^
Main.java:26: error: class, interface, enum, or record expected
}
^
3 errors
Language: C

#include <iostream>
#include <string>

using namespace std;

int main(const int, const char **)
{
  string s;
  cin >> s;

  size_t pos = 0;
  while ((pos = s.find("??", pos)) != string::npos) {
    s[pos] = 'P'; s[pos+1] = 'D';
    pos += 2;
  }
  pos=0;
  while ((pos = s.find("?D", pos)) != string::npos) {
    s[pos] = 'P';
    pos += 2;
  }
  for (size_t i = 0; i < s.size(); ++i) {
    if (s[i] == '?' ) s[i] = 'D';
  }

  cout << s << endl;
  return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String... args){
    Scanner scanner = new Scanner(System.in);
    StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');

    for(int i = 1; i < sb.length() - 1; i++){
      if(sb.charAt(i) == '?'){
        if(sb.charAt(i - 1) == 'P'){
          sb.setCharAt(i, 'D');
        }else if(sb.charAt(i + 1) == 'D'){
          sb.setCharAt(i, 'P');
        }else if(sb.charAt(i + 1) == 'P'){
          sb.setCharAt(i, 'D');
        else if(sb.charAt(i + 1) == '?'){
            sb.setCharAt(i, 'P');
            sb.setCharAt(i + 1, 'D');
        }
      }
    }
        
    System.out.println(sb.substring(1, sb.length() - 1));
  }
}

Compiler output:
Main.java:16: error: 'else' without 'if'
        else if(sb.charAt(i + 1) == '?'){
        ^
Main.java:25: error: reached end of file while parsing
}
 ^
2 errors
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
 
  string data;
  cin >> data;
  for(int i=0;i<data.length()-1;i++){
	if(data.substr(i, 1)=="P"){
		data[i+1]="D";
    }else if(data.substr(i, 1)=="D"){
		data[i+1]="P";
    }
  }
  cout << data << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |                 data[i+1]="D";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:13:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   13 |                 data[i+1]="P";
      |                           ^~~
      |                           |
      |                           const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VB = vector<bool>;
using VS = vector<string>;
using graph = vector<vector<int>>;

int main()
{
string t;
cin>>t;
int a;
a=t.length();
if (t.at(0)=='?')
{
    t.at(0)='D'
}


for (int  i = 1; i < a-1; i++)
{
    if (t.at(i)=='?'&&t.at(i-1)=='D'&&t.at(i+1)=='D')
{
    t.at(i)='P';
}
    if (t.at(i)=='?'&&t.at(i-1)=='P')
{
    t.at(i)='D';
}
else if (t.at(i)=='?'&&t.at(i+1)=='?')
{
    if (t.at(i-1)=='D')
    {
t.at(i)='P';t.at(i+1)='D';
    }
    else
    {
        t.at(i)='D';
    }
  
    

}
else if (t.at(i)=='?')
{
     t.at(i)='D';
}

}
if (t.at(a-1)=='?')
{
   t.at(a-1)='D';
}

cout<<t<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected ';' before '}' token
   21 |     t.at(0)='D'
      |                ^
      |                ;
   22 | }
      | ~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
 
  string data;
  cin >> data;
  for(int i=0;i<data.length()-1;i++){
	if(data[i]=="P"){
		data[i+1]="D";
    }else if(data[i]=="D"){
		data[i+1]="P";
    }
  }
  cout << data << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(data[i]=="P"){
a.cc:11:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |                 data[i+1]="D";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:12:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     }else if(data[i]=="D"){
a.cc:13:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   13 |                 data[i+1]="P";
      |                           ^~~
      |                           |
      |                           const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai arccos(-1);
#define keta(n) cout << fixed << setprecision((n));
#define ll long long;
int main(){
  string t;
  cin>>t;
  string word = t.find(?);
  cout<<word;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected primary-expression before '?' token
   12 |   string word = t.find(?);
      |                        ^
a.cc:12:25: error: expected primary-expression before ')' token
   12 |   string word = t.find(?);
      |                         ^
a.cc:12:25: error: expected ':' before ')' token
   12 |   string word = t.find(?);
      |                         ^
      |                         :
a.cc:12:25: error: expected primary-expression before ')' token
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define srep(i,s,t) for (int i = s; i < t; i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
using namespace std;
typedef vector<vector<char>> field_t;

typedef pair<int, int> point_t;
vector<vector<pair<int,int>>> z(100010);

int main()
{
    string T;
    cin >> T;
    size_t u=T.size();
    for(int i=0;i<u;i++){
        if(T.at(i)=='?'){
            
                T.at(i)='D';
                  
            }
        }
    }
    cout << T <<endl;
    return 0;
}

Compiler output:
a.cc:24:5: error: 'cout' does not name a type
   24 |     cout << T <<endl;
      |     ^~~~
a.cc:25:5: error: expected unqualified-id before 'return'
   25 |     return 0;
      |     ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: Java

    import java.util.Scanner;
     
    public class Main{
      public static void main(String... args){
        Scanner scanner = new Scanner(System.in);
        StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');
        
        while(sb.indexOf("?") > -1){
          for(int i = 0 i < sb.length() - 1; i--){
            if(sb.charAt(i) == '?'){
              if(sb.charAt(i - 1) == 'P'){
                sb.setCharAt(i, 'D');
              if(sb.charAt(i + 1) == 'D'){
                sb.setCharAt(i, 'P');
              }else if(sb.charAt(i + 1) == '?'){
                  continue;
              }
            }
          }
        }
        
        System.out.println(sb.substring(1, sb.length() - 1));
      }
    }

Compiler output:
Main.java:9: error: ';' expected
          for(int i = 0 i < sb.length() - 1; i--){
                       ^
Main.java:24: error: reached end of file while parsing
    }
     ^
2 errors
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
 
  string data;
  cin >> data;
  for(int i=0;i<data.length()-1;i++){
	if(data[i]=="P"){
		data[i+1]="D";
    }else if(data[i]=="D"){
		data[i+1]="P";
    }
  }
  cout << data << endl;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(data[i]=="P"){
a.cc:11:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |                 data[i+1]="D";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:12:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     }else if(data[i]=="D"){
a.cc:13:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   13 |                 data[i+1]="P";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:17:12: error: expected '}' at end of input
   17 |   return 0;
      |            ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>
#include <sstream>
#include <stdio.h>
#include <math.h>
using namespace std;

int main() {
    string t; 
    cin >> t; 
   
    for(double i=0;i < t.size()-1;i+=1){
        if(t[i]=='?'){
            if(t[i+1]=='D'){
                t[i]='P';
            }else{
                t[i]='D';     
            }
            
        }
    }
    t[t.size()-1]='D'
    cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: expected ';' before 'cout'
   22 |     t[t.size()-1]='D'
      |                      ^
      |                      ;
   23 |     cout << t << endl;
      |     ~~~~
Language: Java

    import java.util.Scanner;
     
    public class Main{
      public static void main(String... args){
        Scanner scanner = new Scanner(System.in);
        StringBuilder sb = new StringBuilder('\n' + scanner.next() + '\n');
        
        for(int i = sb.length() - 1; i < > 0; i--){
          if(sb.charAt(i) == '?'){
            if(sb.charAt(i + 1) == 'D'){
              sb.setCharAt(i, 'P');
            }else if(sb.charAt(i + 1) == '?'){
                sb.setCharAt(i, 'D');
            }else{
              sb.setCharAt(i, 'D');
            }
          }
        }
        
        System.out.println(sb.substring(1, sb.length() - 1));
      }
    }

Compiler output:
Main.java:8: error: illegal start of expression
        for(int i = sb.length() - 1; i < > 0; i--){
                                         ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VB = vector<bool>;
using VS = vector<string>;
using graph = vector<vector<int>>;

int main()
{
string t;
cin>>t;
int a;
a=t.length();


for (int  i = 0; i < a-1; i++)
{
    if (t.at(i)=='?'&&t.at(i-1)=='D'&&t.at(i+1)=='D')
{
    t.at(i)='P';
}
else if (t.at(i)=='?'&&t.at(i+1)=='?')
{
    if (t.at(i-1)=='D')
    {
t.at(i)='P';t.at(i+1)='D';
    }
    else
    {
        t.at(i)='D';
    }
    else
    {
        t.at(i)='D';
    }
    

}


}
if (t.at(a-1)=='?')
{
   t.at(a-1)='D';
}

cout<<t<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: expected '}' before 'else'
   37 |     else
      |     ^~~~
a.cc:28:1: note: to match this '{'
   28 | {
      | ^
a.cc: At global scope:
a.cc:47:1: error: expected unqualified-id before 'if'
   47 | if (t.at(a-1)=='?')
      | ^~
a.cc:52:1: error: 'cout' does not name a type
   52 | cout<<t<<endl;
      | ^~~~
a.cc:53:5: error: expected unqualified-id before 'return'
   53 |     return 0;
      |     ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^