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

#include<bits/stdc++.h>

using namespace std;


int main(){

int W,H,C,cost;
cin>>W>>H>>C;

if(W==H)cost=C;

if(W>H){
for(int i=W;i>0;i--){

if(W%i==0){
if(H%i==0){
cost=((W/i)*(H/i))*C;
break;}
}

cout<<C<<endl;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:13:8: note: to match this '{'
   13 | if(W>H){
      |        ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main(){
int W,H,C,A,B;

cin >> W >> H >> C;

A = 1;

if(W = H){W = A}

if(W > H){
for(int i =2; i<=H;i++)if(W % i == 0) A = i;}

if(H > W){
for(int i=2;i<=W;i++)if(H % i == 0) A = i;}

 B = (W / A) * (H / A) * C;

cout << B << endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before '}' token
   11 | if(W = H){W = A}
      |                ^
      |                ;
Language: C++

import fractions 
A, B, C = [int(k) for k in raw_input().split(' ')]
print(C * ((A * B)/ (fractions.gcd(A, B) ** 2 )))



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import fractions
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;

int gcd(int a,int b){
    while(a && b){
        if(a<b)b %= a;
        else a %= b
    }
    return max(a,b);
}

int main(){
    int w,h,c;
    cin>>w>>h>>c;
    cout<<w*h/gcd(w,h)/gcd(w,h)*c<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:20: error: expected ';' before '}' token
    7 |         else a %= b
      |                    ^
      |                    ;
    8 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;

int gcd(int m,int n){
	if(n==0)return m;
	
	return gcd(n,m%n);
}

int main(){
	int W,H,C;
	cin >> W >> H >> C;

	int g = gcd(W,H);

	cout << W*G*C/(g*g) << endl;	

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: 'G' was not declared in this scope
   16 |         cout << W*G*C/(g*g) << endl;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 
 int H,H,C;cin>>W>>H>>C;
 int sum,cube;
 int ans;

  sum = W*H;
  
  for(int i = 0; i < 10000;i++){
      if(sum % i ==0){
        cube = i;
        break;
      }
      }
  
  ans = cube * C;
  std::cout << ans << std::endl;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: redeclaration of 'int H'
    5 |  int H,H,C;cin>>W>>H>>C;
      |        ^
a.cc:5:6: note: 'int H' previously declared here
    5 |  int H,H,C;cin>>W>>H>>C;
      |      ^
a.cc:5:17: error: 'W' was not declared in this scope
    5 |  int H,H,C;cin>>W>>H>>C;
      |                 ^
Language: C

#include<stdio.h>
int main(void){
	while(1){
		int n,p[1000][1000][1000]={0},i,o=0,j[3],r,f;
		scanf("%d",&n);
		if(n==0){
			break;
		}
		for(i=0;i<n;i++){
			scanf("%d%d%d",&j[0],&j[1],&j[2]);
			for(r=0;r<3;r++){
				for(e=r+1;e<3;e++){
					if(j[r]>j[e])
					f=j[r];
					j[r]=j[e];
					j[e]=f;
				}
			}
			if(p[j[0]][j[1]][j[2]]==1){
				o++;
			}
			p[j[0]][j[1]][j[2]]=1;
		}
		printf("%d\n",o);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:37: error: 'e' undeclared (first use in this function)
   12 |                                 for(e=r+1;e<3;e++){
      |                                     ^
main.c:12:37: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void)
{
 int n,a,i,b;
 b=0;
 scanf("%d",&n);
 int p[4][n]
 for(i=0;i<n;i++){
  scanf("%d %d %d",&p[0][i],&p[1][i],&p[2][i]);
  if(p[0][i]<p[1][i]){
   a=p[0][i];
   p[0][i]=p[1][i];
   p[1][i]=a;
  }
  if(p[0][i]<p[2][i]){
   a=p[0][i];
   p[0][i]=p[2][i];
   p[2][i]=a;
  }
  if(p[1][i]<p[2][i]){
   a=p[1][i];
   p[1][i]=p[2][i];
   p[2][i]=a;
???}
 }
 for(a=0;a<n;a++){
  for(i=a+1;i<n;i++){
   if(p[0][a]==p[0][i]){
    if(p[1][a]==p[1][i]){
     if(p[2][a]==p[2][i]){
      p[0][i]='\0';
      p[1][i]='\0';
      p[2][i]='\0';
     }
    }
   }
  }
 }
 for(a=0;a<n;a++){
  if(p[0][a]=='\0'){
   b++;
  }
 }
 printf("%d",b);
 return(0);
}

Compiler output:
main.c: In function 'main':
main.c:8:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    8 |  for(i=0;i<n;i++){
      |  ^~~
main.c:9:21: error: 'p' undeclared (first use in this function)
    9 |   scanf("%d %d %d",&p[0][i],&p[1][i],&p[2][i]);
      |                     ^
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:1: error: expected expression before '?' token
   24 | ???}
      | ^
Language: C

#include <stdio.h>

void swap(int *x, int *y){
    int temp = *x;
    *x = *y;
    *y = temp;
}

int main(void)
{

    int n, i, j, h = 0;

    int a[128];

    scanf("%d", &n);

    n *= 3;

    for(i = 0; i < n; i += 3)
        scanf("%d %d %d", &a[i], &a[i + 1], &a[i + 2]);

    for(i = 0; i < n; i += 3) {
        if(a[i] > a[i + 1]) swap(&a[i], &a[i + 1]);
        if(a[i] > a[i + 2]) swap(&a[i], &a[i + 2]);
        if(a[i + 1] > a[i + 2]) swap(&a[i + 1], &a[i + 2]);
    }

    for(i = 0; i < n; i += 3) {
        for(j = 0; i < n; i += 3) {
            if(a[i] == a[j] && a[i + 1] == a[j + 1] && a[i + 2] == a[j + 2]) {
                h++;
                a[j] = 0:
                a[j + 1] = 0:
                a[j + 2] = 0:
            }
        }
    }

    for(i = 0; i < n; i += 3)
        printf("%d %d %d\n", a[i], a[i + 1], a[i + 2]);

    printf("%d\n", h);

    return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:33:25: error: expected ';' before ':' token
   33 |                 a[j] = 0:
      |                         ^
      |                         ;
Language: C

#include<stdio.h>



#define emt 1000 + 1


bool check[ emt ][ emt ][ emt ] ;


int ans ;



int min( int a ,int b )
{
	return a > b ? b : a ;
}


int max( int a ,int b )
{
	return a > b ? a : b ;
}



int main()
{
	int n ;
	scanf( "%d" ,&n ) ;


	int a ,b ,c ;

	int i ;
	for( i = 0 ; i < n ; ++i )
	{
		scanf( "%d %d %d" ,&a ,&b ,&c ) ;


		int aa = min(  a ,min( b ,c )  ) ;

		int bb = min(  max( a ,b ) ,min(  max( b ,c ) ,max( a ,c )  )  ) ;

		int cc = max(  a ,max( b ,c )  ) ;



		if( check[ aa ][ bb ][ cc ] == true )
		{
			ans += check[ aa ][ bb ][ cc ] ;
		}

		else
		{		
			check[ aa ][ bb ][ cc ] = true ;
		}
	}


	printf( "%d\n" ,ans ) ;


	return 0 ;
}

Compiler output:
main.c:8:1: error: unknown type name 'bool'
    8 | bool check[ emt ][ emt ][ emt ] ;
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'main':
main.c:50:48: error: 'true' undeclared (first use in this function)
   50 |                 if( check[ aa ][ bb ][ cc ] == true )
      |                                                ^~~~
main.c:50:48: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:50:48: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


#define emt 1000 + 1


bool check[ emt ][ emt ][ emt ] ;


int ans ;



int min( int a ,int b )
{
	return a > b ? b : a ;
}


int max( int a ,int b )
{
	return a > b ? a : b ;
}



int main()
{
	int n ;
	scanf( "%d" ,&n ) ;


	int a ,b ,c ;

	int aa ,bb ,cc ;

	int i ;
	for( i = 0 ; i < n ; ++i )
	{
		scanf( "%d %d %d" ,&a ,&b ,&c ) ;


		aa = min(  a ,min( b ,c )  ) - 1 ;

		bb = min(  max( a ,b ) ,min(  max( b ,c ) ,max( a ,c )  )  ) - 1 ;

		cc = max(  a ,max( b ,c )  ) - 1 ;



		if( check[ aa ][ bb ][ cc ] == true )
		{
			ans += check[ aa ][ bb ][ cc ] ;
		}

		else
		{		
			check[ aa ][ bb ][ cc ] = true ;
		}
	}


	printf( "%d\n" ,ans ) ;


	return 0 ;
}

Compiler output:
main.c:7:1: error: unknown type name 'bool'
    7 | bool check[ emt ][ emt ][ emt ] ;
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c: In function 'main':
main.c:51:48: error: 'true' undeclared (first use in this function)
   51 |                 if( check[ aa ][ bb ][ cc ] == true )
      |                                                ^~~~
main.c:51:48: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:51:48: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
  map<int, bool> memo;
  int N;
  cin>>N;
  for(int i=0;i<N;i++){
    int p[3];
    cin>>p[0]>>p[1]>>p[2];
    sort(p,p+3);
    int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
    if(memo.find(k)!=memo.end()){
      cnt++;
    }else{
      memo[k]=true;
    }
  }
  cout<<cnt<<endll
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |       cnt++;
      |       ^~~
      |       int
a.cc:21:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   21 |   cout<<cnt<<endll
      |         ^~~
      |         int
a.cc:21:14: error: 'endll' was not declared in this scope
   21 |   cout<<cnt<<endll
      |              ^~~~~
Language: C++

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

int main(){
  map<int, bool> memo;
  int N;
  cin>>N;
  for(int i=0;i<N;i++){
    int p[3];
    cin>>p[0]>>p[1]>>p[2];
    sort(p,p+3);
    int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
    if(memo.find(k)!=memo.end()){
      cnt++;
    }else{
      memo[k]=true;
    }
  }
  cout<<cnt<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |       cnt++;
      |       ^~~
      |       int
a.cc:21:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   21 |   cout<<cnt<<endl;
      |         ^~~
      |         int
Language: C++

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

int main(){
  map<int,bool> memo;

  int N;
  cin >> N;

  int cnt=0;

  for(int i=0;i<N;i++){
    int p[3];
    cin >> p[0] >> p[1] >> p[2];

    sort(p,p+3);

    int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);

    if(memo.find(k)){
      cnt++;
    }else{
      memo[k] = true;
    }
  }

  cout << cnt << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: could not convert 'memo.std::map<int, bool>::find(k)' from 'std::map<int, bool>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, bool>, std::_Select1st<std::pair<const int, bool> >, std::less<int>, std::allocator<std::pair<const int, bool> > >::iterator'} to 'bool'
   22 |     if(memo.find(k)){
      |        ~~~~~~~~~^~~
      |                 |
      |                 std::map<int, bool>::iterator {aka std::_Rb_tree<int, std::pair<const int, bool>, std::_Select1st<std::pair<const int, bool> >, std::less<int>, std::allocator<std::pair<const int, bool> > >::iterator}
Language: C++

#include<iostream>
using namespace std;

main(){
    int n,i,i2,ans=0;
    cin >> n;
    int p[n*3],s[n],b[n],m[n];
    for (i=1;1<=n;i++) cin >> p[i*3-2] >> p[i*3-1] >> p[i*3];
    for (i=1;1<=n;i++) {
        if (p[i*3]<=p[i*3-2] && p[i*3]==p[i2*3-1]) {
            s[n]=p[i*3];
            if (p[i*3-2]<=p[i*3-1]){
                m[n]=p[i*3-2];
                b[n]=p[i*3-1];
            }
            if (p[i*3-1]<=p[i*3-2]) {
                m[n]=p[i*3-1];
                b[n]=p[i*3-2];
            }
        }
        else if (p[i*3-1]<=p[i*3-2] && p[i*3-1]==p[i2*3]) {
            s[n]=p[i*3-1];
            if (p[i*3-2]<=p[i*3]){
                m[n]=p[i*3-2];
                b[n]=p[i*3];
            }
            if (p[i*3]<=p[i*3-2]){
                m[n]=p[i*3];
                b[n]=p[i*3-2];
            }
        }
        else {
            s[n]=p[i*3-2];
            if (p[i*3-1]<=p[i*3]){
                m[n]=p[i*3-1];
                b[n]=p[i*3];
            }
            if (p[i*3]<=p[i*3-1]){
                m[n]=p[i*3];
                b[n]=p[i*3-1];
            }
        }
    } 
    for (i=1;i<=n;i++){
        for (i2=i+1;i2<=n;i2++){
            if (s[i]==s[i2] && m[i]==m[i2] && b[i]==b[i2]) ans++
        }
    }
    cout << ans << endl;
}




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:46:65: error: expected ';' before '}' token
   46 |             if (s[i]==s[i2] && m[i]==m[i2] && b[i]==b[i2]) ans++
      |                                                                 ^
      |                                                                 ;
   47 |         }
      |         ~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;


int main(){
  int n;
  cin >> n;
  int p[1005][3]={};
  int x[1005];
  
  for(int i=0;i<n;++i){
    for(int j=0;j<3;++j) cin >> p[i][j];
    sort(p[i].begin(),p[i].end());
    x[i]=100*p[i][0]+10*p[i][1]+p[i][2]; 
  }

  sort(x[i].begin(),x[i].end());
  
  int num=0;
  int j=0;
  for(int i=0;i<n;++i){
    for(;;++j){
      if(x[j]==x[j+1]) num++;
      else {
	j++;
	break;
      }
    }
  }
  cout << num <<endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: request for member 'begin' in 'p[i]', which is of non-class type 'int [3]'
   16 |     sort(p[i].begin(),p[i].end());
      |               ^~~~~
a.cc:16:28: error: request for member 'end' in 'p[i]', which is of non-class type 'int [3]'
   16 |     sort(p[i].begin(),p[i].end());
      |                            ^~~
a.cc:20:10: error: 'i' was not declared in this scope
   20 |   sort(x[i].begin(),x[i].end());
      |          ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;


int main(){
  int n;
  cin >> n;
  vector<vector<int>> p(n,vector<int> (3,0));
  vector<int> x(n);
  
  for(int i=0;i<n;++i){
    for(int j=0;j<3;++j) cin >> p[i][j];
    sort(p[i].begin(),p[i].end());
    x[i]=100*p[i][0]+10*p[i][1]+p[i][2]; 
  }

  sort(x[i].begin(),x[i].end());
  
  int num=0;
  int j=0;
  for(int i=0;i<n;++i){
    for(;;++j){
      if(x[j]==x[j+1]) num++;
      else {
	j++;
	break;
      }
    }
  }
  cout << num <<endl;
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'i' was not declared in this scope
   20 |   sort(x[i].begin(),x[i].end());
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    int a, b, c;
    vector<int> x;
    vector<vector<int> > y;
    for(int i = 0; i < n; i++) {
        cin >> a >> b >> c;
        x.push_back(a);
        x.push_back(b);
        x.push_back(c);
        sort(x.begin(), x.end());
        y.push_back(x);
    }
    sort(y.begin(), y.end());
    y.erase(unique(y.begin(), y.end()), y.end);
    cout << n - y.size() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >, <unresolved overloaded function type>)'
   17 |     y.erase(unique(y.begin(), y.end()), y.end);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:52: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to 'std::vector<std::vector<int> >::const_iterator'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |                                     ~~~~~~~~~~~~~~~^~~~~~
Language: C++

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

int main()
{
  int N;
  cin>>N;

  int p[N][3];
  for(int i=0; i<N; i++){
    cin>>p[i][0]>>p[i][1]>>p[i][2];
    sort(p[i][0],p[i][2]);

    for(int j=0; j<i; j++){
        if(p[j][0]==p[i][0] && p[j][1]==p[i][1] && p[j][2]==p[i][2])
    }
  }
}

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

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



main(){

 map<int,bool>memo; 
 int n;
 cin>>n;
 int cnt=0;

 for(int i=0;i<n;i++){
	int p[3];
	cin>>p[0]>>p[1]>>p[2];

	sort(p,p+3);

	int k=((p[0]-1)*1000+(p[1]-1)*1000+(p[2]-1);

	if(memo.find(k)!=memo.end()){
		cnt++;
	}else{
		memo[k]=true;
 }
cout<<cnt<<endl;

return 0;
}

Compiler output:
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:21:52: error: expected ')' before ';' token
   21 |         int k=((p[0]-1)*1000+(p[1]-1)*1000+(p[2]-1);
      |               ~                                    ^
      |                                                    )
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:8:7: note: to match this '{'
    8 | main(){
      |       ^
Language: C++

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

int main(){

	map<int ,bool> memo;

	int N;
	cin>>N;
	
	int cnt=0;
	
	for(int i=0;i<N;i++){
		int p[3];
		cin>>p[0]>>p[1]>>p[2];
		
		sort(p,p+3);

		int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
		
		if(memo.find(k)!=memo.end()){
			cnt++;
		}else{
			memo[k]=true;
		}

	}

	cont<<cnt<<endl;
		
	return 0;
		
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'cont' was not declared in this scope; did you mean 'cnt'?
   31 |         cont<<cnt<<endl;
      |         ^~~~
      |         cnt
Language: C++

#include<cstdio>
#include<iostream>
#include<slgorithm>
using namespace std;
int main(void){
	int n,p[1000][3],flg[1000],i,j,k,f,temp,cnt;
	cin>>n;
	for(i=0;i<n;i++) flg[i]=0;
	for(i=0;i<n;i++){
		for(j=0;j<3;j++) cin>>p[i][j];
	}
	for(i=0;i<n;i++){
		sort(p[i],p[i]+3);
	}
	cnt=0;
	for(i=0;i<n-1;i++){
		if(flg[i]!=1){
			for(j=i+1;j<n;j++){
				f=1;
				for(k=0;k<3;k++){
					if(p[i][k]!=p[j][k]){
						f=0;
						break;
					}
				}
				if(f==1){
					cnt++;
					flg[j]=1;
				}
			}		
		}
	}
	cout<<cnt<<endl;
	return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,sum;
cin>>n;
int a[1000][3];
for(int i=0;i<n;i++){
cin>>a[i][0]>>a[i][1]>>a[i][2];
sort(a[i],a[i}+3);
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(a[i][0]==a[j][0]&&a[i][1]==a[j][1]&&a[i][2]==a[j][2]){
a[j][0]=0;
a[j][1]=0;
a[j][2]=0;
}}}
for(int i=0;i<n;i++){
if(a[i][0]==0||a[i][1]==0||a[i][2]==0)sum++;break;
}
cout<<sum<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ']' before '}' token
   10 | sort(a[i],a[i}+3);
      |              ^
      |              ]
a.cc:10:14: error: expected ')' before '}' token
   10 | sort(a[i],a[i}+3);
      |     ~        ^
      |              )
a.cc:10:17: error: expected ';' before ')' token
   10 | sort(a[i],a[i}+3);
      |                 ^
      |                 ;
a.cc: At global scope:
a.cc:12:1: error: expected unqualified-id before 'for'
   12 | for(int i=0;i<n;i++){
      | ^~~
a.cc:12:13: error: 'i' does not name a type
   12 | for(int i=0;i<n;i++){
      |             ^
a.cc:12:17: error: 'i' does not name a type
   12 | for(int i=0;i<n;i++){
      |                 ^
a.cc:19:1: error: expected unqualified-id before 'for'
   19 | for(int i=0;i<n;i++){
      | ^~~
a.cc:19:13: error: 'i' does not name a type
   19 | for(int i=0;i<n;i++){
      |             ^
a.cc:19:17: error: 'i' does not name a type
   19 | for(int i=0;i<n;i++){
      |                 ^
a.cc:22:1: error: 'cout' does not name a type
   22 | cout<<sum<<endl;
      | ^~~~
a.cc:23:1: error: expected unqualified-id before 'return'
   23 | return 0;
      | ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
bool flag[1001][1001][1001]={};
  int n;
  cin >> n;
  int sum = 0;
  int a[3];
  rep(i,n){
    cin >> a[0] >> a[1] >> a[2];
    sort(a,a+3);
    if(flag[a[0]][a[1]][a[2]]) sum++;
    flag[a[0]][a[1]][a[2]] = true;
  }
  cout << sum << endl;
  return 0;
}



Compiler output:
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin >> n;
      |   ^~~
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                  ^~~
a.cc:9:3: note: in expansion of macro 'rep'
    9 |   rep(i,n){
      |   ^~~
a.cc:9:7: error: 'i' does not name a type
    9 |   rep(i,n){
      |       ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                               ^
a.cc:9:7: error: 'i' does not name a type
    9 |   rep(i,n){
      |       ^
a.cc:2:36: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0; i<n; i++)
      |                                    ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << sum << endl;
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include<iosteam>
#include<vector>


using namespace std;
int main(){
	int n;
	cin>>n;
	vector<int> p1,p2,p3;
	
	for(int i=1;i<=n;i++){
	p1.push_back(i);
	p2.push_back(i);
	p3.push_back(i);
	cin>>p1[i]>>p2[i]>>p3[i];
	for(int j=0;j<2;j++){
		if(p1[i]>=p2[i])swap(p1[i],p2[i]);
		if(p2[i]>=p3[i])swap(p2[i],p3[i]);
	}
	}
	
	int count;
	
	for(int i=1;i<=n;i++){
	for(int j=2;j<=n;j++){
		if(p1[i]==p1[j]&&p2[i]==p2[j]&&p3[i]==p3[j])count++;
	}
	}
	cout<<count<<endl;
	
	return 0;
}


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

#include<iostream>
#include<vector>


using namespace std;
int main(){
	int n;
	cin>>n;
	vector<int> p1,p2,p3;
	
	for(int i=1;i<=n;i++){
	p1.push_back(i);
	p2.push_back(i);
	p3.push_back(i);
	cin>>p1[i]>>p2[i]>>p3[i];
	for(int j=0;j<2;j++){
		if(p1[i]>=p2[i])swap(p1[i],p2[i]);
		if(p2[i]>=p3[i])swap(p2[i],p3[i]);
	}
	}
	
	int count=0;
	
	for(int i=1;i<=n-1;i++){
	for(int j=i+1;j<=n;j++){
		if(p1[i]==p1[j]&&p2[i]==p2[j]&&p3[i]==p3[j])count++;
	}
	}
	cout<<count<<endl;
	
	return 0;
}ｖ


Compiler output:
a.cc:32:2: error: '\U0000ff56' does not name a type
   32 | }ｖ
      |  ^~
Language: C++

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

int main(){
  int n;
  cin >> n;

  int p[5000];
  for(int i=0; i<n; i++){
    cin >> p[i];
  }

  int min_sum = 200000;

  for(int I=0; I<=p[0]; I++){
    int q[5000];
    for(int i=0; i<n; i++){
      q[i]=p[i];
    }

    int sum = I;
    q[0] -= I;

    for(int i=0; i<=n-2; i++){
      if(q[i]<=0){
        continue;
      }

      sum += q[i]*2;
      q[i+1] -= q[i];
    }

    if(q[n-i]>0){
      sum += q[n-1];
    }
    min_sum = min(min_sum, sum);
  }
  cout << min_sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: 'i' was not declared in this scope
   34 |     if(q[n-i]>0){
      |            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n,p[5000],x=0;
	cin>>n;
	for(int i=1;i<=n;i++){
	cin>>p[i];
	}
	for(int i=1;i<n;i++){
        while(p[i]>0){
			x+=p[i];
			p[i+1]-=p[i];
	}
	if(p[n]>0){
		x+=p[n];
	}
	cout<<x<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int n,p[5000],x=0;
	cin>>n;
	for(int i=1;i<=n;i++){
	cin>>p[i];
	}
	for(int i=1;i<n;i++){
        while(p[i]>0){
			x+=p[i];
			p[i]=0;
			p[i+1]-=p[i];
	}
	if(p[n]>0){
		x+=p[n];
	}
	cout<<x<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <stdio.h>
int main(){
    int n,p[1000],i,count;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        scanf("%d"&p[i]);
    }
    count=0;
    for(i=1;i<=n;i++){
        if(p[i]!=0 && p[i+1]!=0 && p[i+1]>p[i]){
            count=count+p[i+1];
        }
        if(p[i]!=0 && p[i+1]!=0 && p[i]>p[i+1]){
            count=count+p[i];
        }
        if(p[i]!=0 && p[i+1]==0){
            count=count+p[i];
        }
        if(p[i]==0 && p[i+1]!=0){
            count=count+p[i];
        }
    }
    printf("%d",count);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
    6 |         scanf("%d"&p[i]);
      |               ~~~~^~~~~
      |               |       |
      |               |       int
      |               const char [3]
Language: C++

// ?????????.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
// AOJ accept

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
	int N;
	int counti = 0;//inside
	int counto = 0;//outside
	int p[5000];
	int q[5000];
	
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin>>p[i];
		q[i] = p[i];
	}
	int i = N/2;
	int j = N/2;
	while(1) {	
		if (i == N-1) {
			counti += p[i];
			i = -1;
		}
		else if(i>0){			
			counti += p[i] * 2;
			p[i + 1] -= p[i];
			if (p[i + 1] < 0)
				p[i + 1] = 0;
			p[i] = 0;
			i++;
		}
		if (j == 0) {
			counti += p[j];
			j = -1;
		}
		else if(j>0){
			counti += p[j] * 2;
			p[j - 1] -= p[j];
			if (p[j - 1] < 0)
				p[j - 1] = 0; 
			p[j] = 0;
			j--;
		}
		if ((i==-1)&&(j==-1))
			break;
	}
	i = 0;
	j = N - 1;
	while (1) {
		counto += q[i] * 2;
		q[i + 1] -= q[i];
		q[i] = 0;
		if (q[i + 1] < 0)
			q[i + 1] = 0;
		i++;
		if (i == N / 2 + 1)
			break;
		counto += q[j] * 2;
		q[j - 1] -= q[j];
		q[j] = 0;
		if (q[j-1] < 0)
			q[j- 1] = 0;
		j--;
	}
	if (counti > counto)
		counti = counto;
	cout << counti << endl;
	return 0;
}

Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int n;
    cin >> n;
    int pans[n + 1];
    for(int i = 0; i < n; i++){
        cin >> pans[i];
    }
    int result = 20000;
    for(int i = 0; i <= pans[0]; i++){
        int tempPans[n];
        for(int j = 0; j < n; j++){
            tempPans[j] = pans[j];
        }
        int tempResult = 0;
        tempResult += i;
        tempPans[0] -= i;
        for(int j = 0; j < n; j++){
            if(tempPans[j] > 0){
                tempResult += tempPans[j] * 2;
                tempPans[j + 1] -= tempPans[j];
                temppans[j] = 0;
            }
        }
        result = min(result, tempResult);
    }
    cout << result << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'temppans' was not declared in this scope; did you mean 'tempPans'?
   24 |                 temppans[j] = 0;
      |                 ^~~~~~~~
      |                 tempPans
Language: C++

#include <iostream>
using namespace std;
#define REP(i,n)  for(int i=0;i<n;++i)
int n,a[5000],b[5000];
int main() {
	cin>>n;
	REP(i,n)cin>>b[i];
	int ans = 1e6;
	REP(i,b[0]+1){
		memcpy(a,b,sizeof(b));
		a[0]-=i;
		int t=i;
		REP(j,n-1){
			if(a[j]<1)continue;
			t+=a[j]*2;
			a[j+1]-=a[j];
		}
		t += max(0, a[n-1]);
		ans = min(ans, t);
	}
	cout << ans << endl;
	return 0;
}

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

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

int main(){

	int N;
	cin>>N;
		
	int p[5000];
	for(int i=0;i<N;i++){
		cin>>p[i];
	}

	int min_sum=20000;

	for(int i=0;i<p[0];i++){
		int q[5000];
		for(int j=0;j<N;j++){
			q[i]=p[i];
		}
		int sum=j;
		q[0]-=j;
		
		for(int j=0;j<N-2;j++){
			if(q[i]<=0)
				continue;
			sum +=q[i]*2;
			q[i+1] -=q[i];
		}
		if(q[N-1]>0){
			sum +=q[N-1];
		}

		min_sum=min(min_sum,sum);
	}

	cout<<min_sum<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'j' was not declared in this scope
   22 |                 int sum=j;
      |                         ^
Language: C++

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

int main(){
	int N;
	cin>>N;
	
	int p[5000];
	for(int i=0;i<N;i++){
		cin>>p[i];
	}
	
	int turn1=0;

	int q[5000];
	for(int i=0;i<N;i++){
		q[i]=p[i];
	}

	for(int i=0;i<N;i++){
		while(p[i]>0){
			if(i==0){
				if(p[0]>0){
					p[0]--;
					p[1]--;
					turn1+=2;
				}
				else{
					p[0]--;
					turn1++;
				}
			}
			else if(i==N-1){
				if(p[N-2]>0){
					p[N-1]--;
					p[N-2]--;
					turn1+=2;
				}
			}
			else{
				p[i]--;
				p[i+1]--;
				turn1+=2;
			}
		}
	}

	int turn2=0;

	for(int i=0;i<N;i++){
		while(p[i]>0){
			if(i==0){
				if(p[0]>0){
					p[0]--;
					turn2++;
				}
			}
			else if(i==N-1){
				if(p[i]>0){
					p[i]--;
					turn2++;
				}
				}
			}
			else{
				p[i]--;
				p[i+1]--;
				turn2+=2;
			}
		}
	}
	
	cout<<min(turn1,turn2)<<endl;
				
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:66:25: error: 'else' without a previous 'if'
   66 |                         else{
      |                         ^~~~
a.cc: At global scope:
a.cc:74:9: error: 'cout' does not name a type
   74 |         cout<<min(turn1,turn2)<<endl;
      |         ^~~~
a.cc:76:9: error: expected unqualified-id before 'return'
   76 |         return 0;
      |         ^~~~~~
a.cc:77:1: error: expected declaration before '}' token
   77 | }
      | ^
Language: C++

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

int main(){
	int N;
	cin>>N;
	int p[5000];
	for(int i=0;i<N;i++){
		cin>>p[i];
	}
	int min_sum=20000;
	for(int I=0;i<=p[0];I++){
		int q[5000];
		for(int i=0;i<N;i++){
			q[i]=p[i];
		}
		int sum=I;
		q[0]-=I;
		for(int i=0;i<N-2;i++){
			if(q[i]<=0){
				continue;
			}
			sum+=q[i]*2;
			q[i+1]-=q[i];
		}
		if(q[N-1]>0){
			sum+=q[N-1];
		}
		min_sum=min(min(min_sum,sum);
	}
	cout<<min_sum<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'i' was not declared in this scope
   13 |         for(int I=0;i<=p[0];I++){
      |                     ^
a.cc:30:45: error: expected ')' before ';' token
   30 |                 min_sum=min(min(min_sum,sum);
      |                            ~                ^
      |                                             )
Language: C++

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

int main()
{
  int N;
  cin>>N;

  int p[5000];
  for(int i=0;i<N;i++){
    cin>>p[i];
  }

  int min_sum=20000;

  for(int i=0;i<=p[0];i++){
    int q[5000];
    for(int i=0;i<N;i++){
      q[i]=p[i];
    }

    int sum=I;
    q[0]-=I;

    for(int i=0;i<N-2;i++){
      if(q[i]<=0){
        continue;
      }
      sum+=q[i]*2;
      q[i+1]-=q[i];
    }
    if(q[N-1]>0){
      sum+=q[N-1];
    }
    min_sum=min(min_sum,sum);
  }
  cout <<min_sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'I' was not declared in this scope
   23 |     int sum=I;
      |             ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
??
int main(){
????????int N;
????????cin>>N;
??????????
????????int p[5000];
????????for(int i=0;i<N;i++){
????????????????cin>>p[i];
????????}
??????????
????????int min_sum=20000;
??
????????for(int I=0;I<=p[0];I++){
????????????????int q[5000];
????????????????for(int i=0;i<N;i++){
????????????????????????q[i]=p[i];
????????????????}
??????????????????
????????????????int sum=I;
????????????????q[0]-=I;
??????????????????????????
????????????????for(int i=0;i<=N-2;i++){
????????????????????????if(q[i]<=0)
????????????????????????????????continue;
??????????????????
????????????????????????sum+=q[i]*2;
????????????????????????q[i+1]-=q[i];
????????????????}
??
????????????????if(q[N-1]>0){
????????????????????????sum+=q[N-1];
????????????????}
??????????????????
????????????????min_sum=min(min_sum,sum);
????????}
??
????????cout<<min_sum<<endl;
??????????????????????????????????
????????return 0;
}
????????

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:44:1: error: expected unqualified-id before '?' token
   44 | ????????
      | ^
Language: C++

for(int j = 0; j < 2; j++){
  V = S;
  for(int i = j; i < n-1; i++){
    while( !(V[i] <= 0) ){
      V[i]--; V[i+1]--;
      res+=2;
    }
  }

  while( !(V[n-1] <= 0) ){
      V[n-1]--; res++;
  }
  while( !(V[0] <= 0) ){
      V[0]--; res++;
  }
  ans = min(ans,res);
  cout << res << " ";
  res = 0;

}


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for(int j = 0; j < 2; j++){
      | ^~~
a.cc:1:16: error: 'j' does not name a type
    1 | for(int j = 0; j < 2; j++){
      |                ^
a.cc:1:23: error: 'j' does not name a type
    1 | for(int j = 0; j < 2; j++){
      |                       ^
Language: C

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



long speller( char *fake ,char *now ,int end )
{
	int ret = 0 ;

	int fake_p = 0 ,now_p = 0 ;


	if( now[ now_p ] < end )
	{
		return 1 ;
	}


	while( fake[ fake_p ] != '\0' )
	{
		if( fake[ fake_p ] == now[ now_p ] )
		{
			ret += speller( fake + fake_p + 1 ,now + 1 ,end - 1 ) ;

			now_p ;


			if( now[ now_p ] == '\0' )
			{
				return ret ;
			}
		}


		++fake_p ;
	}


	return ret ;	
}




int main()
{
	char fake_spell[ 1000 + 1 ] ;
	scanf( "%s" ,fake_spell ) ;

	char spell[ 1000 + 1 ] ;
	scanf( "%s" ,spell ) ;


	int end = strlen( fake_spell ) - strlen( spell ) + 1 ;


	printf( "%ld\n" ,speller( fake_spell ,spell ,end ) ) ;



	return 0 ;
}



/*

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



long speller( char *fake ,char *now )
{
	int ret = 0 ;

	int fake_p = 0 ,now_p = 0 ;


	if( now[ now_p ] == '\0' )
	{
		return 1 ;
	}


	while( fake[ fake_p ] != '\0' )
	{
		if( fake[ fake_p ] == now[ now_p ] )
		{
			ret += speller( fake + fake_p + 1 ,now + 1 ) ;

			now_p ;


			if( now[ now_p ] == '\0' )
			{
				return ret ;
			}
		}


		++fake_p ;
	}


	return ret ;	
}




int main()
{
	char fake_spell[ 1000 + 1 ] ;
	scanf( "%s" ,fake_spell ) ;

	char spell[ 1000 + 1 ] ;
	scanf( "%s" ,spell ) ;


	printf( "%ld\n" ,speller( fake_spell ,spell ) ) ;



	return 0 ;
}

Compiler output:
main.c:66:1: error: unterminated comment
   66 | /*
      | ^
Language: C++

// PCK2016予選７　イワシロ・イッツァ
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0341&lang=ja
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string T,B;
    int dp[1001][1001];
    cin >> T >> B;
 
    if(T[0]==B[0]){
        dp[0][0]=1;
    }
    else{
        dp[0][0]=0;
    }
    for(int j=1;j<T.size();j++){
       dp[0][j]=dp[0][j-1];
        if(T[j]==B[0]){
            dp[0][j]++;
        }
    }
 
    for(int i=1;i<B.size();i++){
        dp[i][0]=0;
        for(int j=1;j<T.size();j++){
            dp[i][j]=dp[i][j-1];
            if(B[i]==T[j]){
                dp[i][j]=(dp[i][j]+dp[i-1][j-1])%1000000007;
            }
        }
    }
    cout << dp[B.size()-1][T.size()-1] << endl;
}
 
Close
Sphere Research Labs. Ideone is powered by Sphere Engine™
home api widget faq credits desktop mobile 
terms of service privacy policy gdpr info

Feedback & Bugs
 Not using Hotjar yet?
Select an element on the page.



Compiler output:
a.cc:35:1: error: 'Close' does not name a type
   35 | Close
      | ^~~~~
Language: C++

include <bits/stdc++.h>

using namespace std;

typedef long long int64;

int64 memo[1111][1111];

 

int64 dfs(int i,int cnt);

string t,b;

 

int main(){

  for(int i = 0;i < 1111;i++){

    for(int j = 0;j < 1111;j++){

      memo[i][j] = -1;

    }

  }

  t += '0';

  string a;

  cin >> a >> b;

  t += a;

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

  return 0;

}

 

int64 dfs(int i,int cnt){

  int rec = 0;

  if(cnt == b.size())return 1;

  if(memo[i][cnt] != -1)return memo[i][cnt];

  for(int j = i + 1;j < t.size();j++){

    if(t[j] == b[cnt])rec = (rec + dfs(j,cnt + 1)) % 1000000007;

  }

  return memo[i][cnt] = rec % 1000000007;

}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:13:1: error: 'string' does not name a type
   13 | string t,b;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:29:3: error: 't' was not declared in this scope
   29 |   t += '0';
      |   ^
a.cc:31:3: error: 'string' was not declared in this scope
   31 |   string a;
      |   ^~~~~~
a.cc:33:3: error: 'cin' was not declared in this scope
   33 |   cin >> a >> b;
      |   ^~~
a.cc:33:10: error: 'a' was not declared in this scope
   33 |   cin >> a >> b;
      |          ^
a.cc:33:15: error: 'b' was not declared in this scope
   33 |   cin >> a >> b;
      |               ^
a.cc:37:3: error: 'cout' was not declared in this scope
   37 |   cout << dfs(0,0) << endl;
      |   ^~~~
a.cc:37:23: error: 'endl' was not declared in this scope
   37 |   cout << dfs(0,0) << endl;
      |                       ^~~~
a.cc: In function 'int64 dfs(int, int)':
a.cc:49:13: error: 'b' was not declared in this scope
   49 |   if(cnt == b.size())return 1;
      |             ^
a.cc:53:25: error: 't' was not declared in this scope
   53 |   for(int j = i + 1;j < t.size();j++){
      |                         ^
a.cc:55:16: error: 'b' was not declared in this scope
   55 |     if(t[j] == b[cnt])rec = (rec + dfs(j,cnt + 1)) % 1000000007;
      |                ^
Language: C++

#include<bits/stdc++.h>

//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????



void rep(){
  int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
}






































































using namespace std;
#define MAX_MOD 1000000007
long long dp[2000][2000] = {};//1???????????????->?????????t??????????????§???????????????2???????????????->?????????s??¨???????????§?????´?????????
int main() {
    string t, b;
    cin >> t >> b;
    dp[0][0] = 1;//t???????????????????????¶?????§???????????¶b??¨?????´?????????????????????????????????
    for (int i = 0;i < t.length();++i) {
        //t[i]?????????????????????
        //???????????§?????????????????£???????????????????????????????????\???????????????
        dp[i + 1][b.length()] += dp[i][b.length()];
        dp[i + 1][b.length()] %= MAX_MOD;
        for (int q = 0;q < b.length();++q) {
            //b[q]??¨t[i]????????´??????????????????
            if (b[q] == t[i]) {
                //t[i]??????????????¨?????????????????¨??§???s[q]??¨?????´???????????§?¬???????????????¢????????????
                dp[i + 1][q + 1] += dp[i][q];
                dp[i + 1][q + 1] %= MAX_MOD;//???????????¨???
            }
            //t[i]?????????????????????????????£?????¨????????????????¶????s[q]??¨?????´?????????????????¢???
            dp[i + 1][q] += dp[i][q];
        }
    }
    //t?????¨????????????????????§????????????b??¨??????????????????????????´????????????????????°?????????
    cout << dp[t.length()][b.length()] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void rep()':
a.cc:10:49: error: redeclaration of 'int b'
   10 |   int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
      |                                                 ^
a.cc:10:9: note: 'int b' previously declared here
   10 |   int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,a) for(int i=0;i<(a);++i)
#define MP make_pair
#define INF int(1e9)
using namespace std;
typedef pair<double, int> P;

int V, R;
double ans, flag[1000], flag2[1000];
vector <complex<double> > pt;
vector <double> edge[1000];
priority_queue<P> pq;
bool border(int I, int J)
{
	complex<double> f = pt[I], t = pt[J];
	complex<double> v = t - f;
	bool l = false, r = false;
	REP(i, V)
	{
		if(i == I || i == J) continue;
		complex<double> com = pt[i] - f;
		com = com * conj(v);
		if(com.imag() < 0) left = 1;
		if(com.imag() > 0) right = 1;
	}
	if(l == 0 || r == 0)
	{
		ans += abs(v);
		return true;
	}
	return false;
}
double dis(int f, int t)
{
	return abs(pt[t] - pt[f]);
}
int main()
{
	cin >> V >> R;
	pt.resize(V);
	REP(i, V)
	{
		double in1, in2;
		cin >> in1 >> in2;
		pt[i] = complex<double>(in1,in2);
	}
	REP(i, V)
	{
		edge[i].resize(V);
	}
	REP(i, V)
	{

		REP(j, i)
		{
			if(!border(i, j))
			{
				edge[i][j] = INF;
				edge[j][i] = INF;
			}
		}
	}
	REP(i, R)
	{
		int in1, in2;
		cin >> in1 >> in2;
		--in1; --in2;
		if(!edge[in1][in2]) continue;
		edge[in1][in2] = edge[in2][in1] = dis(in1, in2);
	}
	pq.push(MP(0, 0));
	fill(flag, flag + V, INF);
	flag[0] = 0;
	while(!pq.empty())
	{
		int now = pq.top().second, cost = pq.top().first * -1;
		pq.pop();
		REP(i, V)
		{
			if(flag[i] > flag[now] + edge[now][i])
			{
				flag[i] = flag[now] + edge[now][i];
				flag2[i] = edge[now][i];
				pq.push(MP(flag[i] * -1, i));
			}
		}
	}
	REP(i, V)
	{
		ans += flag2[i];
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'bool border(int, int)':
a.cc:24:41: error: assignment of function 'std::ios_base& std::left(ios_base&)'
   24 |                 if(com.imag() < 0) left = 1;
      |                                    ~~~~~^~~
a.cc:25:42: error: assignment of function 'std::ios_base& std::right(ios_base&)'
   25 |                 if(com.imag() > 0) right = 1;
      |                                    ~~~~~~^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int V,R;

double EPS=1e-10;
double add(double a,double b){
	if(abs(a+b)<EPS*(abs(a)+abs(b)))return 0;
	return a+b;
}

struct P{
double x,y;
P(){x=0;y=0;}
P(double x,double y):x(x),y(y){}

P operator +(P p){
	return P(add(x,p.x),add(y,p.y));
}

bool operator ==(P p){
	return p.x==x&&p.y==y;
}

P operator -(P p){
	return P(add(x,-p.x),add(y,-p.y));
}

double det(P p){
	return add(x*p.y,-y*p.x);
}

};

P table[1000];
double edge[101][101];
bool cmp_x(const P& p,const P& q){
	if(p.x!=q.x)return p.x<q.x;
	return p.y<q.y;
}

double dist(P p,P q){
	return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
}
vector<P> convex_hull(P* pps,int n){



	//sort(ps,ps+n,cmp_x);

	P ps[1000];
	
	for(int i=0;i<n;i++)ps[i]=pps[i];
	int k=0;
	vector<P>qs(n*2);
	
	sort(ps,ps+n,cmp_x);

	for(int i=0;i<n;i++){

		while(true){
			if(k<=1)break;
			if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
			k--;
		}
		
			qs[k++]=ps[i];
	}

		for(int i=n-2,t=k;i>=0;i--){
		while(true){
			if(k<=t)break;
			if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
			k--;

		}
			qs[k++]=ps[i];
	}
	qs.resize(k-1);
	return qs;
}

bool used[1000];
int main(){
	cin>>V>>R;
	for(int i=0;i<V;i++){
		cin>>table[i].x>>table[i].y;
		
	}

	for(int i=0;i<R;i++){
		int a,b;
		cin>>a>>b;
		
		edge[a-1][b-1]=dist(P(table[a-1]),P(table[b-1]));
		edge[b-1][a-1]=dist(P(table[a-1]),P(table[b-1]));

	}


	vector<P>a;
	a=convex_hull(table,V);
	//sort(table,table+V,cmp_x);





	for(int i=0;i<V;i++){
		for(int j=0;j<a.size();j++){
			if(table[i].x==a[j].x&&table[i].y==a[j].y){
			//cout<<a[j].x<<" "<<a[j].y<<" "<<i<<endl;
			used[i]=1;
			}
		}
	}	


	for(int i=0;i<V;i++){
		for(int j=0;j<V;j++){
			if(used[i]&&used[j]){
					edge[i][j]=dist(table[i],table[j]);
					edge[j][i]=dist(table[i],table[j]);
			}
		}
	}
	//for(int i=0;i<V;i++)cout<<used[i]<<" "<<table[i].x<<" "<<table[i].y<<endl;
	//for(int i=0;i<a.size();i++)cout<<a[i].x<<" "<<a[i].y<<" "<<"A"<<endl;
	double ans=0;

	for(int i=1;i<a.size();i++)ans+=dist(a[i],a[i-1]);
	ans+=dist(a[0],a[a.size()-1]);
	//cout<<ans<<endl;


//	for(int i=0;i<V;i++){
	//	for(int j=0;j<V;j++)cout<<edge[i][j]<<" ";
	//	cout<<endl;

//	}
	const int INF=100000;
	for(int i=0;i<V;i++){
		double min=INF;
		int num=0;
		if(used[i])continue;
		
		for(int j=0;j<V;j++){
			if(edge[i][j]<=EPS)continue;
			//?????????????????????????????¨???	
				if(min>edge[i][j]&&used[j]){
						min=edge[i][j];
						num=j;
				}
		}
		//cout<<i<<" "<<table[i].x<<" "<<table[i].y<<" "<<table[num].x<<" "<<table[num].y<<" "<<min<<endl;
		if(min==INF)continue;
		ans+=min;
		used[num]=true;
		
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'double dist(P, P)':
a.cc:45:16: error: 'sqrt' was not declared in this scope
   45 |         return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
      |                ^~~~