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

a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b = map(int, input().split())
      | ^
Language: C

#include <stdio.h>
int main (void)
{
  int a,b,num;
  scanf("%d %d",&a,&b);
  //scanf("%d",&b);
  
  printf("%d %d\n",a,b);
  
  if(a>b) num=a+a-1;
  if(b>a) num=b+b-1;
  if(a==b) num=a+b;
  
  printf("%d",num);
  
  return 0;
  

Compiler output:
main.c: In function 'main':
main.c:16:3: error: expected declaration or statement at end of input
   16 |   return 0;
      |   ^~~~~~
Language: C++

#include<stdio.h>
int main(void){
  int a,b;
  scanf("%d &d",&a,&b);
  
  int i;
  int sum=0;
  
  for(i=0;i<2;i++){
  if(a>=b){
    sum=sum+a;
    a=a-1;
  }
  
  else{
    sum=sum+b;
    b=b-1;
  }
  }
  
  pruntf("%d",sum);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'pruntf' was not declared in this scope; did you mean 'printf'?
   21 |   pruntf("%d",sum);
      |   ^~~~~~
      |   printf
Language: C

#include<stdio.h>
int main(void){
  int a,b;
  int sum=0;
  scanf("%d %d",&a,&b);
  for(i=0;i<2;i++){
    if(a>=b){
      sum=sum+a;
      a=a-1;
    }
    else{
      sum=sum+b;
      b=b-1;
    }
  }
  printf("%d",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<2;i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

{
  int a,b,x=0;
  
  scanf("%d %d",&a,&b);
  

    if(a>b){
      x+=a;
      a--;
    }else{
      x+=b;
      b--;
    }
  
      if(a>b){
      x+=a;
      a--;
    }else{
      x+=b;
      b--;
    }
  printf("%d\n",x);
}

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

#include <bit/stdc++.h>

using namespace std;

int main()
{
	int a,b;
	cin >> a >> b;
	cout << max(a + a - 1 , b + b - 1) ;
}

Compiler output:
a.cc:1:10: fatal error: bit/stdc++.h: No such file or directory
    1 | #include <bit/stdc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main(void){
  int A,B,ANS;
  scanf("%d%d",&A,&B);
  if(A>B){
  ANS = 2*A-1;
  }else if(A=B){
    ANS = A+B;
  }else{
    ANS = 2*B-1;
  printf("%d",ANS);
  
}


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

#include<stdio.h>

int main(void){
  int A,B,ANS;
  scanf("%d%d",&A,&B);
  if(A>B){
  ANS = 2*A-1;
  }else if(A=B){
    ANS = A+B;
  }else{
    ANS = 2*B-1;
  printf("%d",ANS);
  
}

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

#include<stdio.h>

int main(void){
  int A,B;
  scanf("%d%d",&A,&B);
  
  if(A>B){
  ANS = 2*A-1;
  }else if(A=B){
    ANS = A+B;
  }else{
    ANS = 2*A-1;
  printf("%d",ANS);
  
  
}


Compiler output:
main.c: In function 'main':
main.c:8:3: error: 'ANS' undeclared (first use in this function)
    8 |   ANS = 2*A-1;
      |   ^~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C

#include<stdio.h>

int main(void){
  int A,B
  scanf("%d%d",&A,&B);
  
  if(A>B){
  ANS = 2*A-1;
  }else if(A=B){
    ANS = A+B;
  }else{
    ANS = 2*A-1;
  printf("%d",ANS);
  
  
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    5 |   scanf("%d%d",&A,&B);
      |   ^~~~~
main.c:7:8: error: 'B' undeclared (first use in this function)
    7 |   if(A>B){
      |        ^
main.c:7:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:3: error: 'ANS' undeclared (first use in this function)
    8 |   ANS = 2*A-1;
      |   ^~~
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
	//入力
	int a,b,t,ans;
	cin >> a >> b;
  	t = max(a,b);
	//処理
	ans = max(2t-1,a+b);
	//出力
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: unable to find numeric literal operator 'operator""t'
   10 |         ans = max(2t-1,a+b);
      |                   ^~
Language: C++

s=input()
n=len(s)
count=0
count2=0
for i in range(n):
	if i % 2 == 0:
		x="0"
	else:
		x="1"
	if s[i] == x:
		count2 += 1
		#print(i,s[i],x,"OK")
	else:
		count += 1
		#print(i,s[i],x)
print(min(count,count2))

Compiler output:
a.cc:12:18: error: invalid preprocessing directive #print
   12 |                 #print(i,s[i],x,"OK")
      |                  ^~~~~
a.cc:15:18: error: invalid preprocessing directive #print
   15 |                 #print(i,s[i],x)
      |                  ^~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s=input()
      | ^
Language: C++

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

int main(){
    int A, B;
    cin >> A >> B;

    if(A > B){
        cout << (2*A-1) << endl;
    }else if(A == B){
        cout << (2*A)
    }else{
        cout << (2*B-1) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '}' token
   11 |         cout << (2*A)
      |                      ^
      |                      ;
   12 |     }else{
      |     ~
Language: C++

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

int main(){
    int A, B;
    cin >> A >> B;

    if(A > B){
        cout << (2A-1) << endl;
    }else{
        cout << (2B-1) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: unable to find numeric literal operator 'operator""A'
    9 |         cout << (2A-1) << endl;
      |                  ^~
a.cc:11:18: error: unable to find numeric literal operator 'operator""B'
   11 |         cout << (2B-1) << endl;
      |                  ^~
Language: Java

import java.util.Scanner;
import javafx.util.Pair;

public class Main {

    private static int AMOUNT = 0;

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String[] abt = sc.nextLine().split(" ");
        int A = Integer.parseInt(abt[0]);
        int B = Integer.parseInt(abt[1]);

        Pair<Integer, Integer> pair = new Pair<>(A, B);
        for (int i = 0; i < 2; i++) {
            pair = pick(pair);
        }

        System.out.println(AMOUNT);
    }

    private static Pair<Integer, Integer> pick(Pair<Integer, Integer> pair) {
        if (pair.getKey() == pair.getValue()) {
            AMOUNT += pair.getKey();
            return new Pair<Integer, Integer>(pair.getKey() - 1, pair.getValue());
        } else if (pair.getKey() > pair.getValue()) {
            AMOUNT += pair.getKey();
            return new Pair<Integer, Integer>(pair.getKey() - 1, pair.getValue());
        } else {
            AMOUNT += pair.getValue();
            return new Pair<Integer, Integer>(pair.getKey(), pair.getValue() - 1);
        }
    }
}


Compiler output:
Main.java:2: error: package javafx.util does not exist
import javafx.util.Pair;
                  ^
Main.java:23: error: cannot find symbol
    private static Pair<Integer, Integer> pick(Pair<Integer, Integer> pair) {
                                               ^
  symbol:   class Pair
  location: class Main
Main.java:23: error: cannot find symbol
    private static Pair<Integer, Integer> pick(Pair<Integer, Integer> pair) {
                   ^
  symbol:   class Pair
  location: class Main
Main.java:15: error: cannot find symbol
        Pair<Integer, Integer> pair = new Pair<>(A, B);
        ^
  symbol:   class Pair
  location: class Main
Main.java:15: error: cannot find symbol
        Pair<Integer, Integer> pair = new Pair<>(A, B);
                                          ^
  symbol:   class Pair
  location: class Main
Main.java:26: error: cannot find symbol
            return new Pair<Integer, Integer>(pair.getKey() - 1, pair.getValue());
                       ^
  symbol:   class Pair
  location: class Main
Main.java:29: error: cannot find symbol
            return new Pair<Integer, Integer>(pair.getKey() - 1, pair.getValue());
                       ^
  symbol:   class Pair
  location: class Main
Main.java:32: error: cannot find symbol
            return new Pair<Integer, Integer>(pair.getKey(), pair.getValue() - 1);
                       ^
  symbol:   class Pair
  location: class Main
8 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {
	public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	String str = br.readLine();
    	int A = Integer.parseInt(str.split(" ")[0]);
    	int B = Integer.parseInt(str.split(" ")[1]);
    	
    	int total = 0;
    	if (A >= B) {
    		total += A;
    		A--;
    	} else {
    		total += B;
    		B--;
    	}
    	
    	if (A >= B) {
    		total += A;
    	} else {
    		total += B;
    	}
    	
    	System.out.println(total);
    }	
}


Compiler output:
Main.java:5: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A {
	public static void main(String[] args) throws IOException {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	String str = br.readLine();
    	final int A = Integer.parseInt(str.split(" ")[0]);
    	final int B = Integer.parseInt(str.split(" ")[1]);
    	
    	int total = 0;
    	if (A >= B) {
    		total += A;
    	} else {
    		total += B;
    	}
    	
    	if (A >= B) {
    		total += A;
    	} else {
    		total += B;
    	}
    	
    	System.out.println(total);
    }	
}


Compiler output:
Main.java:5: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        if (a>b) {
            result += a;
            a--;
        }
        else {
            result += b;
            b--;
        }
      
        if (a>b) {
            result += a;
            a--;
        }
        else {
            result += b;
            b--;
        }
        System.out.println(result);
        sc.close();
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  int A,B,C,D,E
  cin>>A>>B;
  C=A+A-1;
  D=A+B-1;
  E=B+B-1;
  if(C>D&&C>E){
    cout<<C;
  }
  else if(D>E&&D>C){
    cout<<D;
  }
  else if(E>C&&E>D){
    cout<<E;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
    5 |   cin>>A>>B;
      |   ^~~
a.cc:8:3: error: 'E' was not declared in this scope
    8 |   E=B+B-1;
      |   ^
Language: C++

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

int main(){
  int A,B;
  cin >> A >> B;
  if(A==B){
    cout << A+B << endl;
  }
  else{
    int x;
    x=max{A,B};
    cout << x*x-1 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
   12 |     x=max{A,B};
      |       ^~~
Language: C++

#include<iostream>
using namespace std ;

int main()
{
  int A,B ;
  cin>>A>>B ;
  
  int coin=0 ;
  for(int i=0;i<2;i++){
    if(A>B){
      coin+=A ;
      A-- ;
    }else{
      coin+=b ;
      B-- ;
    }
  }
  
  cout<<coin ;
  
  return 0 ;
}

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

#include <iostream>
using namespace std;
int main(){
  int A, B, coin;
  cin >> A >> B;
  coin = 0;
  for(int i=0,i < 2,i++;){
    if(A >= B){
      coin += A;
      A--;
    }else{
      coin += B;
      B--;
    }
  }
  cout << coin << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before '<' token
    7 |   for(int i=0,i < 2,i++;){
      |                ^~
      |                ;
a.cc:7:17: error: expected primary-expression before '<' token
    7 |   for(int i=0,i < 2,i++;){
      |                 ^
Language: C++

#include <iostream>

using namespace std;
 
int main()
{
	int q,w,
	cin>>q>>w;
	cout<<max(q+w,max(q+q-1,w+w-1));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected initializer before '>>' token
    8 |         cin>>q>>w;
      |            ^~
Language: C++

// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include "pch.h"
#include <iostream>

using namespace std;

int main()
{
	int A, B;
	cin >> A >> B;
	if (A < B) {
		int hold = A;
		A = B;
		B = hold;
	}

	int ans;
	if (A-B>0)
	{
		ans = 2 * A - 1;
	}
	else
	{
		ans = A + B;
	}
    cout << ans << endl; 
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

#include <stdio.h>
int main(){
  int sum=1,n,h[20];
  scanf("%d",&n);
  for(int i=0,i<n;i++){
    scanf("%d",h[i]);
  }
  for(int i=n-1,0<i;i--){
    for(int s=i-1;0<=s;s--){
    if(h[i]<h[s]){
      break;
    }
      sum++;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 |   for(int i=0,i<n;i++){
      |                ^
main.c:5:22: error: expected ';' before ')' token
    5 |   for(int i=0,i<n;i++){
      |                      ^
      |                      ;
main.c:8:17: error: expected identifier or '(' before numeric constant
    8 |   for(int i=n-1,0<i;i--){
      |                 ^
main.c:8:24: error: expected ';' before ')' token
    8 |   for(int i=n-1,0<i;i--){
      |                        ^
      |                        ;
Language: C

#include <stdio.h>
int main(){
  int a,b,c;
  scanf("%d%d",&a,&b);
  if(a<b){
    c=2*b-1
    return c;
  }else if(b<a){
    c=2*a-1;
  }  else{
    c=a+b;
    return c;
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: expected ';' before 'return'
    6 |     c=2*b-1
      |            ^
      |            ;
    7 |     return c;
      |     ~~~~~~
Language: C++

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

int main() {
  int A,B;
  cin >>A>>B;
  int ans=0;
  if(A>B){
    ans+=A;
    A-=1;
  }
  else{
    ans+=B;
    B-=1;
  }
  ans+=max(A,B)
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: expected ';' before 'cout'
   16 |   ans+=max(A,B)
      |                ^
      |                ;
   17 |   cout<<ans<<endl;
      |   ~~~~
Language: C++

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

int main()
{
  int A,B,c;
  cin>>A>>B;
	c=max(A,B);
  cout<<2c-1<<endl;
  
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: unable to find numeric literal operator 'operator""c'
   10 |   cout<<2c-1<<endl;
      |         ^~
Language: C++

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

int main()
{
  int A,B;
  cin>>A>>B;
  int c=max(A,B);
  cout<<2c-1<<endl;
  
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: unable to find numeric literal operator 'operator""c'
   10 |   cout<<2c-1<<endl;
      |         ^~
Language: C++

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

int main()
{
  int A,B;
  cin>>A>>B;
  int c=max(A,B);
  cout<<2c-1<<endl;
  
}
  
  

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

#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,n) for(Int i=0;i<n;++i)
using namespace std;

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

    int A, B;
    cin >> A >> B;

    int res = 0;
    for (int i = 0; i < 2; ++i) {
       res = max(A, B);
       if (A >= B) —A;
       else —B;
    }

    cout << res << "\n";
}


Compiler output:
a.cc:17:20: error: extended character — is not valid in an identifier
   17 |        if (A >= B) —A;
      |                    ^
a.cc:18:13: error: extended character — is not valid in an identifier
   18 |        else —B;
      |             ^
a.cc: In function 'int main()':
a.cc:17:20: error: '\U00002014A' was not declared in this scope
   17 |        if (A >= B) —A;
      |                    ^~
a.cc:18:13: error: '\U00002014B' was not declared in this scope
   18 |        else —B;
      |             ^~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int A=0,B=0;
	cin>>A>>B;
	if(a>b){
		cout<<a+a-1<<endl;
	}else if(a<b){
		cout<<b+b-1<<endl;
	}else if(a=b){
		cout<<a+b<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'a' was not declared in this scope
    6 |         if(a>b){
      |            ^
a.cc:6:14: error: 'b' was not declared in this scope
    6 |         if(a>b){
      |              ^
Language: C

#include<stdio.h>

	int main()
	{
		int a, b,ans;
		scanf_s("%d %d", &a, &b);
		if (a > b)
		{
			ans = a + (a - 1);
		}
		else if(b >a)
		{
			ans = b + (b - 1);
		}
		else if (a == b)
		{
			ans = a + b;
		}
		printf("%d", ans);

		return 0;
	}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |                 scanf_s("%d %d", &a, &b);
      |                 ^~~~~~~
      |                 scanf
Language: C++

A,B = list(map(int,input().split()))
if A != B:
    ans = 2 * max(A,B) - 1
else:
    ans = 2 * A
print(ans)

Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A,B = list(map(int,input().split()))
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

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

    string S;
    cin >> S;

    vector<int> cum_sum;
    cum_sum.push_back(0);

    int counter = 0;
    char tmp_char = S[0];
    if (tmp_char == '0') cum_sum.push_back(0);

    for (int i = 0; i < N; i++) {
        if (tmp_char == S[i]) {
            counter++;
            if (i == (N-1)) cum_sum.push_back(cum_sum.back()+counter);
        } else {
            cum_sum.push_back(cum_sum.back() + counter);
            counter = 1;
            tmp_char = S[i];
            if (i == (N-1)) cum_sum.push_back(cum_sum.back()+1);

            //cout << S[i] << endl;
        }
        //cout << cum_sum.back() << endl;
    }

    if (S[N-1] == '0') cum_sum.push_back(cum_sum.back());

    //for (int i = 0; i != cum_sum.size(); ++i) {
    //    cout << cum_sum[i] << endl;
    //}
    int max_1 = 0; 
    counter = 0;
  
      int max_1 = 0; 
    counter = 0;
    
    if (K==0) {
        for (int i = 0; i < N; i++) {
            if (S[i]=='1') counter++;
            else {
                max_1 = max(max_1, counter);
                counter = 0;
            }
        }
        max_1 = max(max_1, counter);
        cout << max_1 << endl;
        return 0;
    }
    
    int ans = 1;
    for (int i = 0; i + (2*K+1) < cum_sum.size(); i = (i+2)) {
        ans = max(ans, cum_sum[(2*K+1) + i] - cum_sum[i]);
    }
    for (int i = cum_sum.size() - 1; i - (2*K+1) > 0; i = (i-2)) {
        //cout << i << (i - (2 * K + 1)) << endl;
        ans = max(ans, cum_sum[i] - cum_sum[i - (2*K+1)]);
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:11: error: redeclaration of 'int max_1'
   44 |       int max_1 = 0;
      |           ^~~~~
a.cc:41:9: note: 'int max_1' previously declared here
   41 |     int max_1 = 0;
      |         ^~~~~
Language: C++

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

int main() {
  int A, B
  cin >> A, B
  if (A==B){
    cout << A*A << endl;
  } else {
    cout << 2 * max(A, B) -1 << endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> A, B
      |   ^~~
a.cc:9:5: error: 'else' without a previous 'if'
    9 |   } else {
      |     ^~~~
a.cc:10:24: error: 'B' was not declared in this scope
   10 |     cout << 2 * max(A, B) -1 << endl;
      |                        ^
Language: C++

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

using namespace std;

int main () {
  int a, b;
  cin >> a >> b;
  if(a == b) cout << a+b;
  else if (a > b) cout << a+a-1;
  else cout << 2b-1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: unable to find numeric literal operator 'operator""b'
   13 |   else cout << 2b-1;
      |                ^~
Language: C++

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

int main(){
  int size_a, size_b;
  int ans = 0;
  cin >> size_a >> size_b;
  
  for(int i=0; i<2 i++){
	if(size_a > size_b){
      ans += size_a;
      size_a--;
    }else{
      ans += size_b;
      size_b--;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before 'i'
    9 |   for(int i=0; i<2 i++){
      |                   ^~
      |                   ;
Language: C++

#include <iostream>

using namespace std;

int main() {

  int a, b;
  int ans = 0;
  cin >> a >> b;
  ans += a>b?a--:b--;
  ans += a>b?a--:b--;
  ans << count;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'count' was not declared in this scope
   12 |   ans << count;
      |          ^~~~~
Language: C++

include <iostream>

using namespace std;

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

int main(){

  int A, B;
  cin >> A >> B;

  int ans[3];
  ans[0] = 2*A -1;
  ans[1] = A + B;
  ans[2] = 2*B -1;

  cout << max(ans[0], max(ans[1], ans[2])) << endl;

  return 0;

}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> A >> B;
      |   ^~~
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout << max(ans[0], max(ans[1], ans[2])) << endl;
      |   ^~~~
a.cc:19:47: error: 'endl' was not declared in this scope
   19 |   cout << max(ans[0], max(ans[1], ans[2])) << endl;
      |                                               ^~~~
Language: C++

#include <iostream>

int main()
{
  int a, b;
  cin >> a >> b;
  int sum = 0;
  for (int i = 0; i < 2; ++i) {
    if (a > b) {
      sum += a;
      a--;
    }
    else {
      sum += b;
      b--;
    }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> a >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << sum << 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:18:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<iostream>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if (a-1>b){
    cout<<a*2-1<<endl;
  }else if (b-1>a){
    cout<<b*2-1<<endl;
  }else{
    cout<<a*2<<endl;
  }
  return 0;
}
     


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

#include<iostream>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  if (a-1>b){
    cout<<a*2-1<<endl;
  }else if (b-1>a){
    cout<<b*2-1<<endl;
  }else{
    cout<<a*2<<endl;
  return 0;
}
     

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

A,B = map(int,input().split())
count = 0
if A>=B:
  count += A
  A -= 1
else:
  count += B
  B -= 1
if A>=B:
  count += A
  A -= 1
else:
  count += B
  B -= 1

print(count)


Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A,B = map(int,input().split())
      | ^
Language: C

#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	if(a<b)swap(a,b);
	b+=a,a=a*2-1;
	cout<<(a>b?a:b)<<endl;
}




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

#include<iostream>
int main(){
  int a,b,c=0;
  cin<<a<<b;
  for(int i=0;i<2;i++){
  if(a<b){
    c+=b;
    b--;
    }else c+=a; a--;
  }cout>>c;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin<<a<<b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   }cout>>c;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
int main(){
  int a,b,c=0;
  cin<<a<<b;
  for(int i=0;i<2;i++){
  if(a<b){
    c+=b;
    b--;
    }else c+=a; a--;
  }cout>>c;

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin<<a<<b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   }cout>>c;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:10:12: error: expected '}' at end of input
   10 |   }cout>>c;
      |            ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

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



void solve(){
  int a,b;
  int c; 
  cin >> a >> b;
  if(a==b) {c=2*a-1;}
  else { c=max(a,b)*2-1 }
  cout << c << endl;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:14:24: error: expected ';' before '}' token
   14 |   else { c=max(a,b)*2-1 }
      |                        ^~
      |                        ;
Language: C

#include <stdio.h>

int main(void){

	int A,B,coin;
	
	scnaf("%d",&A);
	scnaf("%d",&B);
	
	coin=0;
	
	if(A>=B){
		coin+=A;
		A--;
	}else{
		coin+=B;
		B--;
	}
	
	if(A>=B){
		coin+=A;
		A--;
	}else{
		coin+=B;
		B--;
	}

	printf("%d",coin);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scnaf("%d",&A);
      |         ^~~~~
      |         scanf
Language: Java

mport java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a>b) {
			System.out.println(2 * a -1);
		}else if(b>a) {
			System.out.println(2 * b -1);
		}else {
			System.out.println(a + b);
		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

#include<iostream>
using namespace std;

int main(){
  int A,B;
  int ans = 0;
  cin >> A>> B;
  
  if(A>B){
    ans+=A;
    A--;
  }else{
    ans+=B;
    B--;
  }
  
  if(A>B){
    ans+=A;
    A--;
  }else{
    ans+=B;
    B--;
  }
  
  cout << ans << endl:
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before ':' token
   25 |   cout << ans << endl:
      |                      ^
      |                      ;
Language: C++

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


int main() {
    int a, b;
    cin >> a >> b;
    int max;
    maxx = max(a + (a - 1), b + (b - 1));
    maxx = max(maxx, a + b);
    cout >> maxx >> endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'maxx' was not declared in this scope; did you mean 'max'?
   11 |     maxx = max(a + (a - 1), b + (b - 1));
      |     ^~~~
      |     max
a.cc:11:15: error: 'max' cannot be used as a function
   11 |     maxx = max(a + (a - 1), b + (b - 1));
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:15: error: 'max' cannot be used as a function
   12 |     maxx = max(maxx, a + b);
      |            ~~~^~~~~~~~~~~~~
Language: C++

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


int main() {
    int a, b
    cin >> a >> b;
    int max;
    maxx = max(a + (a - 1), b + (b - 1));
    maxx = max(maxx, a + b);
    cout >> maxx >> endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'cin'
    9 |     cin >> a >> b;
      |     ^~~
a.cc:11:5: error: 'maxx' was not declared in this scope; did you mean 'max'?
   11 |     maxx = max(a + (a - 1), b + (b - 1));
      |     ^~~~
      |     max
a.cc:11:29: error: 'b' was not declared in this scope
   11 |     maxx = max(a + (a - 1), b + (b - 1));
      |                             ^
a.cc:11:40: error: 'max' cannot be used as a function
   11 |     maxx = max(a + (a - 1), b + (b - 1));
      |                                        ^
a.cc:12:27: error: 'max' cannot be used as a function
   12 |     maxx = max(maxx, a + b);
      |                           ^
Language: C++

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

int main(){
	int a,b;
  cin >> a >> b;
  if(a<b)
    	swap(a,b);
  cout<<(a+(max(a-1,b));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ')' before ';' token
    9 |   cout<<(a+(max(a-1,b));
      |         ~              ^
      |                        )
Language: Java


import java.util.Scanner;

public class Solution {

    public static String process(int A, int B) {
        int aTwice = A + A - 1;
        int bTwice = B + B - 1;
        int both = A + B;
        return String.valueOf(Math.max(aTwice, Math.max(bTwice, both)));
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        final String result = process(A, B);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
}


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

import java.util.*;

public class Test {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int coins = 0;
		for (int i = 0; i < 2; i++) {
			if (a > b) {
				coins += a;
				a--;
			} else {
				coins += b;
				b--;
			}
		}
		System.out.println(coins);
	}
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  cin >> A >> B ;
  if(A > B){
    cout << 2A-1 << endl;
  }else if(A < B){
    cout << 2B-1 <<endl;
  }else{
  cout << A+B << endl;
  }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: unable to find numeric literal operator 'operator""A'
    8 |     cout << 2A-1 << endl;
      |             ^~
a.cc:10:13: error: unable to find numeric literal operator 'operator""B'
   10 |     cout << 2B-1 <<endl;
      |             ^~
Language: C++

#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int main()
{
	long long int a,b,x;
	cin>>a>>b;
	cout<<a+b;
	return 0;
}

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

#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
int main()
{
	long long int a,b,x;
	cin>>a>>b;
	x=a+b;
	cout<<x;
	return 0;
}

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

#include<stdio.h>{
2.	int A;
3.	int B;
4.	int i;
5.	int sum = 0;
6. 
7.	scanf("%d", &A);
8.	scanf("%d", &B);
9. 
10.	for (i = 0; i < 2; i++){
11.      if(A >= B){
12.        sum += A;
13.        A--;
14.      }
15.      else{
16.        sum += B;
17.        B--;
18.      }
19.    }
20. 
21.	printf("%d\n", sum);
22.}


Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>{
      |                  ^
main.c:2:1: error: expected identifier or '(' before numeric constant
    2 | 2.      int A;
      | ^~
main.c:3:1: error: expected identifier or '(' before numeric constant
    3 | 3.      int B;
      | ^~
main.c:4:1: error: expected identifier or '(' before numeric constant
    4 | 4.      int i;
      | ^~
main.c:5:1: error: expected identifier or '(' before numeric constant
    5 | 5.      int sum = 0;
      | ^~
main.c:6:1: error: expected identifier or '(' before numeric constant
    6 | 6.
      | ^~
main.c:8:1: error: expected identifier or '(' before numeric constant
    8 | 8.      scanf("%d", &B);
      | ^~
main.c:9:1: error: expected identifier or '(' before numeric constant
    9 | 9.
      | ^~
main.c:10:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   10 | 10.     for (i = 0; i < 2; i++){
      |                       ^
main.c:10:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   10 | 10.     for (i = 0; i < 2; i++){
      |                             ^~
main.c:20:1: error: expected identifier or '(' before numeric constant
   20 | 20.
      | ^~~
main.c:22:1: error: expected identifier or '(' before numeric constant
   22 | 22.}
      | ^~~
Language: C

#include<stdio.h>{
	int A;
	int B;
	int i;
	int sum = 0;

	scanf("%d", &A);
	scanf("%d", &B);

	for (i = 0; i < 2; i++){
      if(A >= B){
        sum += A;
        A--;
      }
      else{
        sum += B;
        B--;
      }
    }

	printf("%d\n", sum);
}


Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>{
      |                  ^
main.c:7:15: error: expected declaration specifiers or '...' before string constant
    7 |         scanf("%d", &A);
      |               ^~~~
main.c:7:21: error: expected declaration specifiers or '...' before '&' token
    7 |         scanf("%d", &A);
      |                     ^
main.c:8:15: error: expected declaration specifiers or '...' before string constant
    8 |         scanf("%d", &B);
      |               ^~~~
main.c:8:21: error: expected declaration specifiers or '...' before '&' token
    8 |         scanf("%d", &B);
      |                     ^
main.c:10:9: error: expected identifier or '(' before 'for'
   10 |         for (i = 0; i < 2; i++){
      |         ^~~
main.c:10:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   10 |         for (i = 0; i < 2; i++){
      |                       ^
main.c:10:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   10 |         for (i = 0; i < 2; i++){
      |                             ^~
main.c:21:16: error: expected declaration specifiers or '...' before string constant
   21 |         printf("%d\n", sum);
      |                ^~~~~~
main.c:21:24: error: expected declaration specifiers or '...' before 'sum'
   21 |         printf("%d\n", sum);
      |                        ^~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int a,b,x;
	scanf("%d %d",&a,&b);
	if(a>b){
		printf("%d",2*a-1);
	}
	else if{
		printf("%d",2*b-1);
	}
	else{
		printf("%d",2*a);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected '(' before '{' token
    9 |         else if{
      |                ^
      |                (
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else{
      |         ^~~~
Language: C

#include<stdio.h>
int main(void){
  
  int A;
  int B;
  int c;
  int i;
  int k=0;
  if(scanf("%d",&A)==1
    scanf("%d",&B)==1){
  for(i=0;i<2;i++){
if(  scanf("%d",&c)==1){
 if(c==A){
  k+=A;
    A=A-1;
 }
  if(c==B){
  k+=B;
    B=B-1;
}
  }
  }}
  printf("%d",k);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:23: error: expected ')' before 'scanf'
    9 |   if(scanf("%d",&A)==1
      |     ~                 ^
      |                       )
   10 |     scanf("%d",&B)==1){
      |     ~~~~~
Language: C

#include<stdio.h>
int main(void){
  
  int A;
  int B;
  int c;
int i;
  int k=0;
  scanf("%d",&A)==1
    scanf("%d",&B)==1
  for(i=0;i<2;i++){
if(  scanf("%d",&c)==1){
 if(c==A){
  k+=A;
    A=A-1;}
  if(c==B){
  k+=B;
    B=B-1;}
  }
  }
  printf("%d",k);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:20: error: expected ';' before 'scanf'
    9 |   scanf("%d",&A)==1
      |                    ^
      |                    ;
   10 |     scanf("%d",&B)==1
      |     ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int a,b
 cin>>a>>b;
 
 if(a>=b){
  cout<<a+(a-1)<<endl;
 }
 else{
  cout<<b+(b-1)<<endl;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: expected initializer before 'cin'
    5 |  cin>>a>>b;
      |  ^~~
a.cc:7:8: error: 'b' was not declared in this scope
    7 |  if(a>=b){
      |        ^
Language: C++

#include<bits/stdc++.h>;
using namespace std;
int main(){
 int a,b
 cin>>a>>b;
 
 if(a>=b){
  cout<<a+(a-1)<<endl;
 }
 else{
  cout<<b+(b-1)<<endl;
 }
}

Compiler output:
a.cc:1:24: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h>;
      |                        ^
a.cc: In function 'int main()':
a.cc:5:2: error: expected initializer before 'cin'
    5 |  cin>>a>>b;
      |  ^~~
a.cc:7:8: error: 'b' was not declared in this scope
    7 |  if(a>=b){
      |        ^
Language: C

#include<stdio.h>

int main(){
int A,B,C;
C=0;

scanf("%d %d",&A,&B);
if( A>=B ){ C+=A ; A-- ;}else{ C+=B;B--; }
if( A>=B ){ C+=A ; A-- ;}else{ C+=B;B--; }
printf("%d\n",C);
return ;
}


Compiler output:
main.c: In function 'main':
main.c:11:1: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   11 | return ;
      | ^~~~~~
main.c:3:5: note: declared here
    3 | int main(){
      |     ^~~~
Language: C

#include<stdio.h>
int main(){
int a,b,x=0,i;
scanf("d%",&a);
scanf("d%",&b);

for(i=0;i<2;i++){
if(a〉b){
x=x+a;
a=a-1;
}else if(b〈a){
x=x+b;
b=b-1;
}
}


printf("d%¥n",x);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: stray '\343' in program
    8 | if(a<U+3009>b){
      |     ^~~~~~~~
main.c:8:5: error: expected ')' before 'b'
    8 | if(a〉b){
      |   ~ ^ ~
      |     )
main.c:11:11: error: stray '\343' in program
   11 | }else if(b<U+3008>a){
      |           ^~~~~~~~
main.c:11:11: error: expected ')' before 'a'
   11 | }else if(b〈a){
      |         ~ ^ ~
      |           )
Language: C

#include<stdio.h>
int main(){
  int a,b,x=0;
  scanf("%d",&a);
  scanf("%d",&b);
  if(a>b){
    x=x+a;
    a=a-1;
  }else if(a=<b){
    x=x+b;
    b=b-1;
  }
  if(a>b){
    x=x+a;
    a=a-1;
  }else if(a=<b){
    x=x+b;
    b=b-1;
  }
  printf("%d\n",x);
  return 0;
}
  
  

Compiler output:
main.c: In function 'main':
main.c:9:14: error: expected expression before '<' token
    9 |   }else if(a=<b){
      |              ^
main.c:16:14: error: expected expression before '<' token
   16 |   }else if(a=<b){
      |              ^
Language: C

#include<stdio.h>

int main()
{
	int A, B,C,i;
	scanf_s("%d", &A);
	scanf_s("%d", &B);
	for (i = 0; i <= 2; i++) {
		if (A >= B) {
			C = A + C;
			A--;
		}
		else {
			C = B + C;
			B--;
		}
	}
	printf("%d", C);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d", &A);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdin.h>

int main(){
  int a, b;
  int i;
  int ans;
  scanf("%d %d", &a, &b);
  for(i=0; i<2; i++){
    if(a > b) ans += a--;
    else ans += b--;
  }
  return 0;
}

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

#include <stdio.h>
#include <cstdio>

int main() {
  int a[2];
  int n = 2;
  
  for (int i = 0; i < n; ++i) {
  	scanf("%d", &a[i]);
  }
  
  int A = a[0];
  int B = a[1];
  
  if(A - B > 0){ 
    printf(A + A - 1)
  }else if(A - B < 0){
    printf(B + B - 1)
  }else{
    printf(2 * A)
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   16 |     printf(A + A - 1)
      |            ~~~~~~^~~
      |                  |
      |                  int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:16:22: error: expected ';' before '}' token
   16 |     printf(A + A - 1)
      |                      ^
      |                      ;
   17 |   }else if(A - B < 0){
      |   ~                   
a.cc:18:18: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   18 |     printf(B + B - 1)
      |            ~~~~~~^~~
      |                  |
      |                  int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:18:22: error: expected ';' before '}' token
   18 |     printf(B + B - 1)
      |                      ^
      |                      ;
   19 |   }else{
      |   ~                   
a.cc:20:14: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   20 |     printf(2 * A)
      |            ~~^~~
      |              |
      |              int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:20:18: error: expected ';' before '}' token
   20 |     printf(2 * A)
      |                  ^
      |                  ;
   21 |   }
      |   ~
Language: C

#include〈studio.h〉
int main()｛
int a,b,x=0;
scanf("d%",&a);
scanf("d%",&b);

if(a〉b)｛
x=x+a;
a=a-1;
｝else if(b〈a)｛
x=x+b;
b=b-1;
｝

if(a〉b)｛
x=x+a;
a=a-1;
｝else if(b〈a)｛
x=x+b;
b=b-1;
｝

printf("d%¥n",x);
return 0;
｝

Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include〈studio.h〉
      |         ^~
main.c: In function 'main':
main.c:2:11: error: expected declaration specifiers before '\U0000ff5b'
    2 | int main()｛
      |           ^~
main.c:4:1: error: expected declaration specifiers before 'scanf'
    4 | scanf("d%",&a);
      | ^~~~~
main.c:5:1: error: expected declaration specifiers before 'scanf'
    5 | scanf("d%",&b);
      | ^~~~~
main.c:7:1: error: expected declaration specifiers before 'if'
    7 | if(a〉b)｛
      | ^~
main.c:7:5: error: stray '\343' in program
    7 | if(a<U+3009>b)<U+FF5B>
      |     ^~~~~~~~
main.c:9:1: error: expected declaration specifiers before 'a'
    9 | a=a-1;
      | ^
main.c:10:1: error: expected declaration specifiers before '\U0000ff5delse'
   10 | ｝else if(b〈a)｛
      | ^~~~~~
main.c:10:12: error: stray '\343' in program
   10 | <U+FF5D>else if(b<U+3008>a)<U+FF5B>
      |                  ^~~~~~~~
main.c:12:1: error: expected declaration specifiers before 'b'
   12 | b=b-1;
      | ^
main.c:13:1: error: expected declaration specifiers before '\U0000ff5d'
   13 | ｝
      | ^~
main.c:15:5: error: stray '\343' in program
   15 | if(a<U+3009>b)<U+FF5B>
      |     ^~~~~~~~
main.c:17:1: error: expected declaration specifiers before 'a'
   17 | a=a-1;
      | ^
main.c:18:1: error: expected declaration specifiers before '\U0000ff5delse'
   18 | ｝else if(b〈a)｛
      | ^~~~~~
main.c:18:12: error: stray '\343' in program
   18 | <U+FF5D>else if(b<U+3008>a)<U+FF5B>
      |                  ^~~~~~~~
main.c:20:1: error: expected declaration specifiers before 'b'
   20 | b=b-1;
      | ^
main.c:21:1: error: unknown type name '\U0000ff5d'
   21 | ｝
      | ^~
main.c:23:8: error: expected declaration specifiers or '...' before string constant
   23 | printf("d%¥n",x);
      |        ^~~~~~
main.c:23:15: error: unknown type name 'x'
   23 | printf("d%¥n",x);
      |               ^
main.c:24:1: error: expected declaration specifiers before 'return'
   24 | return 0;
      | ^~~~~~
main.c:25:1: error: expected declaration specifiers before '\U0000ff5d'
   25 | ｝
      | ^~
Language: C++

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

int main() {
  int a;
  int b;
  int c;
  int d; 
  cin >> a >> b;

  if(a>b){
  c = a+(a-1);
  }
  else if(a=b){
    c=a+b
  }
  else{
  c = b+(b-1);
  }
  
  cout << c ;
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before '}' token
   15 |     c=a+b
      |          ^
      |          ;
   16 |   }
      |   ~
Language: C

#include <stdio.h>

int main(void){
  int a1, a2, score;
  scanf("%d %d",&a1, &a2);
  if (a1-a2>=2){
    score = a1*2-1;
    printf("%d",score);
  }else if (a2-a1>=2){
    score = a2*2-1;
    printf("%d",score);
  }else{
    score = a1+a2
    printf("%d",score);
  }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:18: error: expected ';' before 'printf'
   13 |     score = a1+a2
      |                  ^
      |                  ;
   14 |     printf("%d",score);
      |     ~~~~~~