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

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <utility>
using namespace std;
const int INF=0x3f3f3f3f;
typedef long long LL;
struct edge{
    int to,cap,cost,rev;
    edge(int to,int cap,int cost,int rev):to(to),cap(cap),cost(cost),rev(rev){}
};
const int MAX_V=10010;
int V,dist[MAX_V],prevv[MAX_V],preve[MAX_V];
vector<edge> G[MAX_V];
void add_edge(int from,int to,int cap,int cost){
    G[from].push_back(edge(to,cap,cost,G[to].size()));
    G[to].push_back(edge(from,0,-cost,G[from].size()-1));
}
int min_cost_flow(int s,int t,int f){
    int res=0;
    while(f>0){
        fill(dist,dist+V,INF);
        dist[s]=0;
        bool update=1;
        while(update){
            update=0;
            for(int v=0;v<V;v++){
                if(dist[v]==INF)continue;
                for(int i=0;i<G[v].size();i++){
                    edge &e=G[v][i];
                    if(e.cap>0&&dist[e.to]>dist[v]+e.cost){
                        dist[e.to]=dist[v]+e.cost;
                        prevv[e.to]=v;
                        preve[e.to]=i;
                        update=1;
                    }
                }
            }
        }
        if(dist[t]==INF)return -1;
        int d=f;
        for(int v=t;v!=s;v=prevv[v]){
            d=min(d,G[prevv[v]][preve[v]].cap);
        }f-=d;
        res+=d*dist[t];
        for(int v=t;v!=s;v=prevv[v]){
            edge &e=G[prevv[v]][preve[v]];
            e.cap-=d;
            G[v][e.rev].cap+=d;
        }
    }return res;
}
void clear(){for(int i=0;i<=V;i++)G[i].clear();}
const int MAX_N=10010;
int M,N,K,w[MAX_N],lst[MAX_N],a[MAX_N];
int solve(){
    for(int i=1;i<=N;i++)scanf("%d",&w[i]);
    for(int i=1;i<=K;i++)scanf("%d",&a[i]);
if(M == 1) {
    int cnt=unique(a+1,a+K+1)-(a+1);
    int res=0;
    for(int i=1;i<=cnt;i++){
        res+=w[a[i]];}
printf("%d\n", res);
 return;}
   int cnt = K;
    int res=0;
    memset(lst,0,sizeof(lst));
    V=cnt+1; clear();
    for(int i=1;i<=cnt;i++){
        res+=w[a[i]];
        if(lst[a[i]])add_edge(lst[a[i]],i-1,1,-w[a[i]]);
        lst[a[i]]=i;
    }for(int i=1;i<cnt;i++)add_edge(i,i+1,INF,0);
    printf("%d\n",res+min_cost_flow(1,cnt,M-1));
}
int main(){
    while(~scanf("%d%d%d",&M,&N,&K))solve();
    return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:66:2: error: return-statement with no value, in function returning 'int' [-fpermissive]
   66 |  return;}
      |  ^~~~~~
a.cc:76:11: warning: control reaches end of non-void function [-Wreturn-type]
   76 |     printf("%d\n",res+min_cost_flow(1,cnt,M-1));
      |     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <stack>
#include <queue>
#include <numeric>
#include <cstring>

#define REP(i, a, b) for(i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)

using namespace std;

int main(){
    string in;
    vector<int> count;
   
    cin >> in;
    count.resize(4);
    
    rep(i, in.length()){
        if(in[i] == 'K') count[0]++;
        if(in[i] == 'U') count[1]++;
        if(in[i] == 'P') count[2]++;
        if(in[i] == 'C') count[3]++;
    }
    sort(count.begin(), count.end());

    cout << count[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'i' was not declared in this scope; did you mean 'in'?
   31 |     rep(i, in.length()){
      |         ^
a.cc:19:26: note: in definition of macro 'REP'
   19 | #define REP(i, a, b) for(i = a; i < b; i++)
      |                          ^
a.cc:31:5: note: in expansion of macro 'rep'
   31 |     rep(i, in.length()){
      |     ^~~
Language: C++

#include <iostream>
using namespace std;int t[201];
void main(){char c;while(cin>>c)t[c]++;cout<<min(t['K'],min(t['U'],min(t['P'],t['C'])))<<endl;}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){char c;while(cin>>c)t[c]++;cout<<min(t['K'],min(t['U'],min(t['P'],t['C'])))<<endl;}
      | ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(void)
{
  char str[300];
  int k=0,u=0,p=0,c=0;
  int kupc=0;
  scanf("%s",str);

  for(int i = 0 ; i < strlen(str) ; i++) {
    if(str[i] == 'K') k++;
    else if(str[i] == 'U') u++;
    else if(str[i] == 'P') p++;
    else if(str[i] == 'C') c++;
  }
  while(1) {
    kupc++;
    k--;
    if(k == 0) break;
    u--;
    if(u == 0) break;
    p--;
    if(p == 0) break;
    c--;
    if(c == 0) break;
  }
  cout << kupc << endl;
  return 0;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'strlen' was not declared in this scope
   12 |   for(int i = 0 ; i < strlen(str) ; i++) {
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(void)
{
  char str[300];
  int k=0,u=0,p=0,c=0;
  int kupc=0;
  scanf("%s",str);

  for(int i = 0 ; i < strlen(str) ; i++) {
    if(str[i] == 'K') k++;
    else if(str[i] == 'U') u++;
    else if(str[i] == 'P') p++;
    else if(str[i] == 'C') c++;
  }
  while(1) {
    kupc++;
    k--;
    if(k == 0) break;
    u--;
    if(u == 0) break;
    p--;
    if(p == 0) break;
    c--;
    if(c == 0) break;
  }
  cout << kupc << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'strlen' was not declared in this scope
   12 |   for(int i = 0 ; i < strlen(str) ; i++) {
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(void)
{
  char str[300];
  int k=0,u=0,p=0,c=0;
  int kupc=0;
  scanf("%s",str);

  for(int i = 0 ; i < strlen(str) ; i++){
    if(str[i] == 'K') k++;
    else if(str[i] == 'U') u++;
    else if(str[i] == 'P') p++;
    else if(str[i] == 'C') c++;
  }
  while(1){
    kupc++;
    k--;
    if(k == 0) break;
    u--;
    if(u == 0) break;
    p--;
    if(p == 0) break;
    c--;
    if(c == 0) break;
  }
  cout << kupc << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'strlen' was not declared in this scope
   12 |   for(int i = 0 ; i < strlen(str) ; i++){
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(void)
{
  char str[300];
  int k=0,u=0,p=0,c=0;
  int kupc=0;
  scanf("%s",str);

  for(int i = 0 ; i < strlen(str) ; i++){
    if(str[i] == 'K') k++;
    else if(str[i] == 'U') u++;
    else if(str[i] == 'P') p++;
    else if(str[i] == 'C') c++;
  }
  while(1){
    kupc++;
    k--;
    if(k == 0) break;
    u--;
    if(u == 0) break;
    p--;
    if(p == 0) break;
    c--;
    if(c == 0) break;
  }
  cout << kupc << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
   11 |   for(int i = 0 ; i < strlen(str) ; i++){
      |                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(void)
{
  char str[301];
  int k=0,u=0,p=0,c=0;
  int kupc=0;

  scanf("%s",str);
  
  for(int i = 0 ; i < strlen(str) ; i++){
    if(str[i] == 'K') k++;
    else if(str[i] == 'U') u++;
    else if(str[i] == 'P') p++;
    else if(str[i] == 'C') c++;
  }
  while(1){
    kupc++;
    k--;
    if(k == 0) break;
    u--;
    if(u == 0) break;
    p--;
    if(p == 0) break;
    c--;
    if(c == 0) break;
  }
  cout << kupc << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'strlen' was not declared in this scope
   13 |   for(int i = 0 ; i < strlen(str) ; i++){
      |                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include<iostream>
using namespace std;int n[99];main({for(;~scanf("%1c",n);)n[*n]++;cout<<min(n[75],min(n[85],min(n[80],n[67])))<<endl;}

Compiler output:
a.cc:2:35: error: expected constructor, destructor, or type conversion before '(' token
    2 | using namespace std;int n[99];main({for(;~scanf("%1c",n);)n[*n]++;cout<<min(n[75],min(n[85],min(n[80],n[67])))<<endl;}
      |                                   ^
Language: C++

//19
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
  string s;
  cin>>s;
  int a=1<<30;
  for(int i=0;i<4;i++){
    a=min(a,count(s.begin(),s.end(),"KUPC"[i]));
  }
  cout<<a<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: no matching function for call to 'min(int&, std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type)'
   13 |     a=min(a,count(s.begin(),s.end(),"KUPC"[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:13:10: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, void>::difference_type' {aka 'long int'})
   13 |     a=min(a,count(s.begin(),s.end(),"KUPC"[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:13:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   13 |     a=min(a,count(s.begin(),s.end(),"KUPC"[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

int main(){
  char buf[256];
  while(~scanf("%s",buf)){
    printf("%d\n",
	   min(min(count(buf,buf+256,'K'),count(buf,buf+256,'U')),
	       min(count(buf,buf+256,'P'),count(buf,buf+256,'C')));
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:67: error: expected ')' before ';' token
   38 |                min(count(buf,buf+256,'P'),count(buf,buf+256,'C')));
      |                                                                   ^
      |                                                                   )
a.cc:36:11: note: to match this '('
   36 |     printf("%d\n",
      |           ^
Language: C++

#include <iostream>
#include <string>
int buf[500];
int main()
{
         string s;
         cin >> s;
         for(int i=0;i<s.size();i++)
         {
                   buf[s[i]]++;
         }
         int ans;
         ans=min(min(buf['K'],buf['U']),min(buf['P'],buf['C']));
         cout << ans << endl;
         return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'string' was not declared in this scope
    6 |          string s;
      |          ^~~~~~
a.cc:6:10: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |          cin >> s;
      |          ^~~
      |          std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:17: error: 's' was not declared in this scope
    7 |          cin >> s;
      |                 ^
a.cc:13:18: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |          ans=min(min(buf['K'],buf['U']),min(buf['P'],buf['C']));
      |                  ^~~
      |                  std::min
In file included from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:13:14: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |          ans=min(min(buf['K'],buf['U']),min(buf['P'],buf['C']));
      |              ^~~
      |              std::min
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:14:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |          cout << ans << endl;
      |          ^~~~
      |          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |          cout << ans << endl;
      |                         ^~~~
      |                         std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	int k=0,u=0,p=0,c=0;
	int ans[4];
	string str;
	cin>>str;
	for(int i=0;i<str.size();i++){
		if(str[i]-'A'==10)k++;
		else if(str[i]-'A'==20)u++;
		else if(str[i]-'A'==15)p++;
		else if(str[i]-'A'==3)k++;
	}
	ans[0]=k;
	ans[1]=u;
	ans[2]=p;
	ans[3]=c;
	sort(ans,ans+4);
	cout<<ans[1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(ans,ans+4);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>

using namespace std;

int main(int argc, char const* argv[])
{
    string s;
    cin >> s;
    string::iterator ite=s.begin();
    vector<int> a(4);

    for (ite = s.begin(); ite < s.end(); ite++) 
    {
        if (*ite == 'K') {a[0]++;}
        if (*ite == 'U') {a[1]++;}
        if (*ite == 'P') {a[2]++;}
        if (*ite == 'C') {a[3]++;}
    }
    int min;
    sort( a.begin(), a.end());
    min = a[0];
    cout << min << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort( a.begin(), a.end());
      |     ^~~~
      |     short
Language: C

  1 #include <stdio.h>
  2 #define N 50
  3 #define MIN(a,b) ((a<b)?(a):(b))
  4 
  5 int main(void){
  6         char work[N][N];
  7         int map[N][N];
  8         int n,m;
  9         int i,j;
 10         int dp[N][N];
 11         scanf("%d %d",&n,&m);
 12         for(i=0;i<n;i++){
 13                 scanf("%s",work[i]);
 14                 for(j=0;j<m;j++){
 15                         map[i][j]=work[i][j]-'0';
 16                         dp[i][j]=0;
 17                 }
 18         }
 19 
 20         for(i=1;i<n;i++) dp[i][0]=map[i][0]+dp[i-1][0];
 21         for(i=1;i<m;i++) dp[0][i]=map[0][i]+dp[0][i-1];
 22 
 23         for(i=1;i<n;i++){
 24                 for(j=1;j<m;j++){
 25                         dp[i][j]=MIN(dp[i-1][j],dp[i][j-1])+map[i][j];
 26                 }
 27         }
 28 
 29         printf("%d\n",dp[n-1][m-1]);
 30         return 0;
 31 }
 32 

Compiler output:
main.c:1:3: error: expected identifier or '(' before numeric constant
    1 |   1 #include <stdio.h>
      |   ^
main.c:1:5: error: stray '#' in program
    1 |   1 #include <stdio.h>
      |     ^
main.c:2:5: error: stray '#' in program
    2 |   2 #define N 50
      |     ^
main.c:3:5: error: stray '#' in program
    3 |   3 #define MIN(a,b) ((a<b)?(a):(b))
      |     ^
main.c:32:2: error: expected identifier or '(' before numeric constant
   32 |  32
      |  ^~
Language: C

#include<stdio.h>
#include<stdlib.h>

int h,w;


void dikstla(int **map,int **sumc,int y,int x,int sum);

int main(void){
  int i,j;
  char **route,c;
  int **cicada,**cmap,num;
  scanf("%d %d",&h,&w);
  route=(char **)calloc(h,sizeof(char *));
  cicada=(int **)calloc(h,sizeof(int *));
  cmap=(int **)calloc(h,sizeof(int*));
  for(i=0;i<h;i++){
    *(route+i)=(char *)calloc(w+1,sizeof(char)); 
    *(cicada+i)=(int *)calloc(w,sizeof(int));
    *(cmap+i)=(int *)calloc(w,sizeof(int));
  }
  for(i=0;i<h;i++){
    scanf("%s",*(route+i));
  }
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      c=*(*(route+i)+j);
      //putchar(c);
      *(*(cicada+i)+j)=c-'0';
    }  
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      *(*(cmap+i)+j)=100;
    }
  }
  dikstla(cicada,cmap,0,0,0);
  printf("%u\n",*(*(cmap+h-1)+w-1));
  for(i=0;i<h;i++){
    free(*(route+i));
    free(*(cicada+i));
    free(*(cmap+i));
    }
  free(route);
  free(cicada);
  free(cmap);
  return 0;
}

void dikstla(int **map,int **sumc,int y,int x,int sum){
  int res=0,p,q;
  res=sum+*(*(map+y)+x);
  if(*(*(sumc+y)+x)>res){
    *(*(sumc+y)+x)=res;
    if(y<h-1) dikstla(map,sumc,y+1,x,*(*(sumc+y)+x));
    if(x<w-1) dikstla(map,sumc,y,x+1,*(*(sumc+y)+x));
  }
}

Compiler output:
main.c: In function 'main':
main.c:57:1: error: expected declaration or statement at end of input
   57 | }
      | ^
Language: C

#include<stdio.h>
int main(){
	int H,W;
	char map[50][50];
	int i,j,k;
	scanf("%d %d",&H,&W);
	getchar();
	for(i=0;i<H;i++){
		for(j=0;j<W;j++){
			map[i][j]=getchar();
			map[i][j]-='0';
		}
		getchar();
	}}
	for(i=0;i<H;i++){
		for(j=0;j<W;j++){
			if(i==0){
				if(j!=0){
					map[i][j]+=map[i][j-1];
				}
			}else{
				if(j==0){
					map[i][j]+=map[i-1][j];
				}else{
					map[i][j]+=(map[i][j-1]<map[i-1][j])?map[i][j-1]:map[i-1][j];
				}
			}
		}
	}
	printf("%d\n",map[H-1][W-1]);
	return 0;
}

Compiler output:
main.c:15:9: error: expected identifier or '(' before 'for'
   15 |         for(i=0;i<H;i++){
      |         ^~~
main.c:15:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |         for(i=0;i<H;i++){
      |                  ^
main.c:15:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |         for(i=0;i<H;i++){
      |                      ^~
main.c:30:16: error: expected declaration specifiers or '...' before string constant
   30 |         printf("%d\n",map[H-1][W-1]);
      |                ^~~~~~
main.c:30:23: error: unknown type name 'map'
   30 |         printf("%d\n",map[H-1][W-1]);
      |                       ^~~
main.c:31:9: error: expected identifier or '(' before 'return'
   31 |         return 0;
      |         ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
   32 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#define min(a,b) ((a) < (b) ? (a) : (b))
using namespace std;

int main(){
	int height, width, map[50][50];
	cin >> height >> width;
	for (int i = 0; i < height; i++){
		for (int j = 0; j < width; j++){
			scanf_s("%1d",&map[i][j]);
		}
	}
	for (int i = 1; i < width; i++){
		map[0][i] += map[0][i - 1];
	}
	for (int i = 1; i < height; i++){
		map[i][0] += map[i-1][0];
	}
	for (int i = 1; i < height; i++){
		for (int j = 1; j < width; j++){
			map[i][j] += min(map[i - 1][j], map[i][j - 1]);
		}
	}
	cout << map[height - 1][width - 1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |                         scanf_s("%1d",&map[i][j]);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include <bits/stdc++.h>
#define MAX 9*50*50*2
using namespace std;
int H, W;
vector< vector<int> > memo;
vector< vector<int> > m;
int dy[] = {0,1}, dx[] = {1, 0};

int dfs(int y, int x){
  if(memo[y][x] != max)
    return memo[y][x];
  if(y == H-1 && x == W-1)
    return 0;
  int n[2];
  for(int p=0; p < 2; p++){
    int ny = y + dy[p], nx = x + dx[p];
    if(ny < H && nx < W){
      n[p] = dfs[ny][nx];
    }
  }
  memo[y][x] = min(n[0], n[1]);
  return memo[y][x];
}

int main(void){
  cin >> H >> W;
  m = vector< vector<int> > (H, vector<int>(W));
  memo = vector< vector<int> > (H, vector<int>(W, MAX));
  for(int p = 0; p < H; p++){
    string tmp; cin >> tmp;
    for(int j=0; j < tmp.length(); j++)
      m[p][j] = tmp[j] - '0';
  }

  cout << dfs(0,0) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:10:17: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '<unresolved overloaded function type>' to binary 'operator!='
   10 |   if(memo[y][x] != max)
a.cc:18:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |       n[p] = dfs[ny][nx];
      |                    ^
a.cc:18:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |       n[p] = dfs[ny][nx];
      |                        ^
a.cc:18:24: error: invalid conversion from 'int (*)(int, int)' to 'int' [-fpermissive]
   18 |       n[p] = dfs[ny][nx];
      |              ~~~~~~~~~~^
      |                        |
      |                        int (*)(int, int)
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int h, w, x[1000][1000], y[1000][1000];
char T[11] = "0123456789", char c;
int main() {
	cin >> h >> w;
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			cin >> c;
			for (int k = 0; k < 10; k++) {
				if (T[k] == c) {
					x[i][j] = k;
				}
			}
		}
	}
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			y[i][j] = min(x[i - 1][j], x[i][j - 1]) + x[i][j];
		}
	}
	cout << y[h][w] << endl;
	return 0;
}

Compiler output:
a.cc:5:28: error: expected unqualified-id before 'char'
    5 | char T[11] = "0123456789", char c;
      |                            ^~~~
a.cc: In function 'int main()':
a.cc:10:32: error: 'c' was not declared in this scope
   10 |                         cin >> c;
      |                                ^
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

int zyoutai[50][50], dp[51][51], a, b;
int main() {
	memset(dp, 1, sizeof(dp));
	dp[1][0] =dp[0][1]= 0;
	cin >> a >> b;
	for (int c = 0; c < a; c++) {
		for (int d = 0; d < b; d++) {
			scanf("%1d", &zyoutai[c][d]);
		}
	}
	for (int e = 0; e < a; e++) {
		for(int f=0;f<b;f++){
			dp[e + 1][f + 1] = min(dp[e][f + 1], dp[e + 1][f]) + zyoutai[e][f];
		}
	}
	cout << dp[a][b] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(dp, 1, sizeof(dp));
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<algorithm>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <string>

// ciada's distribution parameter
int cicadaNum[50][50];

int checkPattern(int num, int max, int total)
{
    int count = 0;

    for (int i = 0; i < total; i++)
    {
        int tmp = num & (0x1 << i);
        if (tmp != 0){
            ++count;
        }
    }

    if (max == count) {
        return 0;
    }
    return -1;
}

int cicadaSum(int pattern, int operationNum, int high, int wide)
{
    int iHigh = high - 1;
    int iWide = wide - 1;
    int tmp = cicadaNum[iHigh][iWide];
    int sum = tmp;
    //printf("%d ", tmp);
    for (int i = 0; i < operationNum; i++) {
        int op = (pattern >> i) & 0x1;
        if (op == 1) {
            tmp = cicadaNum[iHigh][--iWide];
            sum += tmp;
            //printf("%d ", tmp);
        }
        else {
            tmp = cicadaNum[--iHigh][iWide];
            sum += tmp;
            //printf("%d ", tmp);
        }
    }
    //printf("=%d\n", sum);
    return sum;
}

int main()
{
    memset(&cicadaNum[0][0],0, sizeof(cicadaNum));

    int high, wide;
    std::cin >> high >> wide;

    // operation number
    int operationNum = high + wide - 2;

    // get ciada's distribution
    std::string line;
    for (int iHigh = 0; iHigh < high; iHigh++) {
        std::cin >> line;
        for (int iWide = 0; iWide < wide; iWide++) {
            char c = line[iWide];
            cicadaNum[iHigh][iWide] = atoi(&c);
        }
    }

    // make scanning pattern (sample 101010... 1 is right. 0 is down)
    int pattern = 0;
    for (int i = 0; i < operationNum; i++) {
        pattern |= 0x1 << i;
    }

    //  calculate minimum number of encounter
    int minNum = 9*50*2;
    for (int i = 0; i < pattern; i++) {

        // all pattern check 
        if (checkPattern(i, wide - 1, high + wide - 2) == 0){
            int tmp = cicadaSum(i, operationNum, high, wide);
            if (tmp < minNum) {
                minNum = tmp;
            }
        }
    }

    std::cout << minNum << std::endl;

    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:51:5: error: 'memset' was not declared in this scope
   51 |     memset(&cicadaNum[0][0],0, sizeof(cicadaNum));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <cassert>
#include <iostream>
#include <vector>

/* デバッグ時はコメントアウトする */
#define NDEBUG

static const int MAX_WEIGHT = 50;	/* セミ地図の最大幅 */
static const int MAX_HEIGHT = 50;	/* セミ地図の最大高さ */

int scan_input_cicada(void)
{
	char in;
	std::cin >> in;
	return in - '0';
}

void cicada(void)
{
	int  weight, height;			/* input 幅、input 高さ */
	std::vector<int> min_encount;	/* メモ用最小遭遇数 */
	min_encount.resize(MAX_WEIGHT);


	/* -------------------- */
	/* 地図の幅、高さを取得 */
	/* -------------------- */
	std::cin >> height >> weight;
	
	/* -------------------------- */
	/* 最小セミ遭遇数の一覧を作成 */
	/* -------------------------- */
	/* 左上 */
	min_encount_vector[0] = scan_input_cicada();
	
	/* 一番上の一列 */
	for (int w = 1; w < weight; ++w)
	{
		min_encount[w] = min_encount[w - 1] + scan_input_cicada();
	}

	/* 二列目以降 */
	for (int h = 0; h < height; ++h)
	{
		/* 一番左 */
		min_encount[0] += scan_input_cicada();

		/* 左から2番目以降 */
		for (int w = 1; w < weight; ++w)
		{
			int left = min_encount[w - 1];
			int up   = min_encount[w];

			min_encount[w] = std::min(left, up) + scan_input_cicada();
		}
	}

	/* -------------------------- */
	/* 出会う蝉の数の最小値を出力 */
	/* -------------------------- */
	std::cout << min_encount[weight - 1][height - 1] << std::endl;

	return;
}

int main()
{
	cicada();
	return 0;
}



Compiler output:
a.cc: In function 'void cicada()':
a.cc:34:9: error: 'min_encount_vector' was not declared in this scope
   34 |         min_encount_vector[0] = scan_input_cicada();
      |         ^~~~~~~~~~~~~~~~~~
a.cc:61:45: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript
   61 |         std::cout << min_encount[weight - 1][height - 1] << std::endl;
      |                                             ^
Language: C++

#include<cstdio>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

const int INF=1<<29;

int main(){
	int h,w; scanf("%d%d ",&h,&w);
	char grid[50][51];
	rep(i,h) gets(grid[i]);

	int dp[50][50];
	dp[0][0]=0;
	rep(i,h) rep(j,w) if(i>0 || j>0) {
		dp[i][j]=INF;
		if(i>0) dp[i][j]=min(dp[i][j],dp[i-1][j]+grid[i][j]-'0');
		if(j>0) dp[i][j]=min(dp[i][j],dp[i][j-1]+grid[i][j]-'0');
	}
	printf("%d\n",dp[h-1][w-1]);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |         rep(i,h) gets(grid[i]);
      |                  ^~~~
      |                  getw
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;
int semi[51][51],h,w;
int min(int a,int b){
	if(a<b){
		return a;
	}else{
		return b;
	}
}
int route(int i,int j){
	int k,sum;
	if(i==h-1&&j==w-1){
		return 0;
	}else if(i==h-1){
		sum=0;
		for(k=j;k<w-1;k++){
			sum+=semi[h-1][k];
		}
		return sum;
	}else if(j==w-1){
		sum=0;
		for(k=i;k<h-1;k++){
			sum+=semi[k][w-1];
		}
		return sum;
	}else{
		return semi[i][j]+min(route(i+1,j),route(i,j+1));
	}
}
int main(){
	while(cin>>h>>w;){
		int i,j,k,n;
		char c[52];
		for(i=0;i<52;i++){
			c[i]='\0';
		}
		if(h==0&&w==0)break;
		for(i=0;i<51;i++){
			for(j=0;j<51;j++){
			semi[i][j]=-1;	
			}
		}
		for(i=0;i<h;i++){
			cin>>c;
			for(j=0;j<w;j++){
				semi[i][j]=(int)(c[j]-'0');
			}
		}
		cout<<route(0,0)<<endl;
	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:24: error: expected ')' before ';' token
   37 |         while(cin>>h>>w;){
      |              ~         ^
      |                        )
a.cc:37:25: error: expected primary-expression before ')' token
   37 |         while(cin>>h>>w;){
      |                         ^
Language: C++

#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }

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

	int h, w;
	cin >> h >> w;

	vector<vector<int> > cost(h, vector<int>(w));
	for(int i = 0; i < h; ++i) {
		string line;
		cin >> line;
		for(int j = 0; j < w; ++j)
			cost[i][j] = line[j] - '0';
	}

	vector<vector<int> > dp(h, vector<int>(w, INT_MAX));
	dp[0][0] = 0;
	for(int i = 0; i < h; ++i) {
		for(int j = 0; j < w; ++j) {
			if(i < h - 1)
				chmin(dp[i + 1][j], dp[i][j] + cost[i][j]);

			if(j < w - 1)
				chmin(dp[i][j + 1], dp[i][j] + cost[i][j]);
		}
	}

	cout << dp[h - 1][w - 1] << endl;

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:51: error: 'INT_MAX' was not declared in this scope
   23 |         vector<vector<int> > dp(h, vector<int>(w, INT_MAX));
      |                                                   ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  char mas[51][51];
  int h,w,memo[51][51];
  cin >> h >> w;
  memset(memo,0,sizeof(memo));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++) cin >> mas[i][j];
  }
  for(int i=0;i<h-1;i++) memo[i+1][0] = mas[i+1][0]-'0' + memo[i][0];
  for(int i=0;i<w-1;i++) memo[0][i+1] = mas[0][i+1]-'0' + memo[0][i];
  for(int i=1;i<h;i++){
    for(int j=1;j<w;j++){
      memo[i][j] = min(memo[i-1][j],memo[i][j-1]) + (mas[i][j]-'0');
    }
  }
  cout << memo[h-1][w-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'memset' was not declared in this scope
    9 |   memset(memo,0,sizeof(memo));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C

i,z,a;
main(f){
	for(puts("?aa");scanf("%s",&i);){
		a=i>>8;
		if(a){
			if(i&31^1|f&1<<a-97)return!puts("!OUT");
			f|=1<<a-97;
			printf("?%ca\n",a);
		}else{
			if(z++)return!puts("!OUT");
			puts("?aaa");
		}
	}
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | i,z,a;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
    1 | i,z,a;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | i,z,a;
      |     ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(f){
      | ^~~~
main.c: In function 'main':
main.c:2:1: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:3:13: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    3 |         for(puts("?aa");scanf("%s",&i);){
      |             ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
  +++ |+#include <stdio.h>
    1 | i,z,a;
main.c:3:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |         for(puts("?aa");scanf("%s",&i);){
      |                         ^~~~~
main.c:3:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:3:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |                         printf("?%ca\n",a);
      |                         ^~~~~~
main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:25: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
char i[9];main(){for(puts("?a");fflush(stdout),gets(i),i[1]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));*i=!puts("!OUT");}

Compiler output:
main.c:2:11: error: return type defaults to 'int' [-Wimplicit-int]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),gets(i),i[1]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));*i=!puts("!OUT");}
      |           ^~~~
main.c: In function 'main':
main.c:2:48: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),gets(i),i[1]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));*i=!puts("!OUT");}
      |                                                ^~~~
      |                                                fgets
Language: C

#include<stdio.h>
char i[];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));puts("!OUT");}

Compiler output:
main.c:2:10: error: return type defaults to 'int' [-Wimplicit-int]
    2 | char i[];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));puts("!OUT");}
      |          ^~~~
main.c:2:6: warning: array 'i' assumed to have one element
    2 | char i[];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]-94]++;printf("?%caa\n",i[1]));puts("!OUT");}
      |      ^
Language: C++

/*
    2014.07.03 1834~1846
    C language Lecture week ∞
*/

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

char yell[8] = "xai";

int main (void) {
    
    // AIに勝つにはアルファベットが26であることを利用して何らかの文字で攻めればよい。
    // 実は三文字でシステマチックに作って言っても勝てるはず
    
    // 開幕テンプレ
    printf ( "?bakaai\n" );
    fflush ( stdout );
    
    int ai_input_len;
    
    while(1){
        
        // 相手の出方を見る
        scanf ( "%s", ai_input );
        
        // 相手の最後の文字を最初の文字にして、二文字目を a, b, c, ... z, aa, ba, .. と変更していく。
        // 理論上52手目で勝てるはず
        ai_input_len = strlen ( ai_input );
        yell[0] = ai_input[ai_input_len-1];
        
        printf ( "%s\n", yell );
        
        yell[1] ++;
        if ( yell[1] > 'z' ) {
            yell[1] = 'a';
            yell[2] = 'a';
            yell[3] = 'i';
            yell[4] = 0;
        }
    }
    
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'ai_input' was not declared in this scope; did you mean 'ai_input_len'?
   25 |         scanf ( "%s", ai_input );
      |                       ^~~~~~~~
      |                       ai_input_len
Language: C++

#include <set>
#include <ctime>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <iostream>
using namespace std;
set<string> s; string t1, t2;
int main() {
	srand((unsigned)time(NULL));
	s.push("aaaaaaaaaa"); cout << "?aaaaaaaaaa" << endl;
	while(true) {
		cin >> t1;
		if(s.find(t1) != s.end() || t1[0] != 'a' || t1.size() > 2) {
			cout << "!OUT" << endl; break;
		}
		t2 = t1.substr(0, 1);
		for(int i = 0; i < 8; i++) t2 += rand() % 26 + 97;
		t2 += 'a';
		cout << "?" << t2 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'push'
   11 |         s.push("aaaaaaaaaa"); cout << "?aaaaaaaaaa" << endl;
      |           ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
main(){
  set<string>st;
  string ans,s="?a";
  st.inseet("a");
  while(1){
    cout<<s<<endl;
    cout.flush();
    if(s[0]=='!')break;
    cin>>ans;
    if(st.count(ans)||s[s.size()-1]!=ans[0])s="!OUT";
    else st.insert(ans),s="?"+ans[ans.size()-1]+ans;
  }
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:6: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'inseet'; did you mean 'insert'?
    7 |   st.inseet("a");
      |      ^~~~~~
      |      insert
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  unordered_set<string>st;
  string ans,s="?a";
  st.insert("a");
  while(1){
    cout<<s<<endl;
    cout.flush();
    if(s[0]=='!')break;
    cin>>ans;
    if(st.count(ans)||s[s.size()-1]!=ans[0])s="!OUT";
    else st.insert(ans),s="?"+ans[ans.size()-1])+ans+"a";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:48: error: expected ';' before ')' token
   13 |     else st.insert(ans),s="?"+ans[ans.size()-1])+ans+"a";
      |                                                ^
      |                                                ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  unordered_set<string>st;
  string ans,s="?a";
  st.insert("a");
  while(1){
    cout<<s<<endl;
    cout.flush();
    if(s[0]=='!')break;
    cin>>ans;
    if(st.count(ans)||s[s.size()-1]!=ans[0])s="!OUT";
    else st.insert(ans),s="?"+(""+ans[ans.size()-1])+ans+"a";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: invalid operands of types 'const char [2]' and 'const char*' to binary 'operator+'
   13 |     else st.insert(ans),s="?"+(""+ans[ans.size()-1])+ans+"a";
      |                           ~~~^~~~~~~~~~~~~~~~~~~~~~~
      |                           |      |
      |                           |      const char*
      |                           const char [2]
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#include<random>
#pragma warning(disable:4996)
using namespace std;

string say(string st) {
	cout<<st<<endl;
	fflush(stdout);
	string re;cin>>re;
	return re;
}

string mk_rnd() {
	string st;
	random_device rnd;
	std::mt19937 mt(rnd());
	for (int i = 0; i <8; ++i) {
		st.push_back(mt()%26+'a');
	}
	return st;
}

int main() {
	set<string>use_st;

	string next = "?"+mk_rnd()+"a";
	while (true) {
		use_st.emplace(next);
		string said = say(next);
		if (use_st.find(said) != use_st.end()||st[0]!='a') {
			cout<<"!OUT"<<endl;
			return 0;
		}
		else {
			use_st.emplace(said);
		}

		next="?"+string(1,said.back())+mk_rnd()+"a";
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:32:56: error: 'st' was not declared in this scope; did you mean 'std'?
   32 |                 if (use_st.find(said) != use_st.end()||st[0]!='a') {
      |                                                        ^~
      |                                                        std
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

set<string> used;

void solve(){
	string str;
	str+='a';
	string res;
	char pt='a';
	while(1){
		used.insert(str);
		cout<<"?"<<str<<endl;
		cin>>res;
		if(res[0]!=str[str.size()-1]||(used.find(res)!=used.end())){
			cout<<"!OUT"<<endl;
			break;
		}
		used.insert(res);
		string nstr;
		nstr+=res[res.size()-1];
		nstr+=pt;
		while(1){
			if(used.end()==used.find(nstr)){
				break;
			}
			nstr+=pt;
		}
		str=nstr;
	}
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#import<stdio.h>
char i[9];main(){for(puts("?a");fflush(stdout),gets(i)[1]&&*i<98&!i[i[1]]++;printf("?%caa\n",i[1]));puts("!OUT");}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<stdio.h>
      |  ^~~~~~
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),gets(i)[1]&&*i<98&!i[i[1]]++;printf("?%caa\n",i[1]));puts("!OUT");}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:48: error: 'gets' was not declared in this scope; did you mean 'getw'?
    2 | char i[9];main(){for(puts("?a");fflush(stdout),gets(i)[1]&&*i<98&!i[i[1]]++;printf("?%caa\n",i[1]));puts("!OUT");}
      |                                                ^~~~
      |                                                getw
Language: C++

#import<stdio.h>
char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<stdio.h>
      |  ^~~~~~
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:104: error: expected ')' before ';' token
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}
      |                     ~                                                                                  ^
      |                                                                                                        )
Language: C++

#include<stdio.h>
char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}

Compiler output:
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:104: error: expected ')' before ';' token
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i+1);puts("!OUT");}
      |                     ~                                                                                  ^
      |                                                                                                        )
Language: C++

#import<stdio.h>
char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i[1]);puts("!OUT");}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<stdio.h>
      |  ^~~~~~
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i[1]);puts("!OUT");}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:105: error: expected ')' before ';' token
    2 | char i[9];main(){for(puts("?a");fflush(stdout),i[scanf("%s",i)]&&*i<98&!i[i[1]]++;printf("?%saa\n",i[1]);puts("!OUT");}
      |                     ~                                                                                   ^
      |                                                                                                         )
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;


int main(){
	string ans[200];
	string s;
	string out;
	out="a";
	cout<<out<<endl;
	count++;
	ans[0]=out;
	int count=0;
	out="aaa";
	while(1){
		cin>>s;
		fflush(stdout);
		if(s[0]!='a'||s.size()>2){
			cout<<"!OUT"<<endl;
			fflush(stdout);
			return 0;
		}
		
		for(int i=0;i<count;i++){
			if(ans[i]==s){
				cout<<"!OUT"<<endl;
				fflush(stdout);
				return 0;
			}
		}
		ans[count]=s;
		count++;
		
		cout<<"?"<<out<<endl;
		out[1]++;
		ans[count]=out;
		count++;
		
		fflush(stdout);
		
		
		
		count++;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: no post-increment operator for type
   16 |         count++;
      |              ^~