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

#include<iostream>
using namespace std ;

int main()
{
  int K,A,B ;
  cin>>K>>A>>B ;
  
  int num_b=1  ;  //初期のビスケットの数
  int check=0 ; //初期のお金
  for(int i=0;i<K;i++){
    if(B-A>2){
      if(check>0){
        check-- ;
        num_b+=B ;
      }else if(num_b<A||i==K-1) num_b++ :
      else{
        num_b -=A ;
        check++ ;
      }
    }else num_b++ ;  
  }
  
  cout<<num_b<<endl ;
    
  
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: expected ';' before ':' token
   16 |       }else if(num_b<A||i==K-1) num_b++ :
      |                                        ^~
      |                                        ;
Language: C++

#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e16;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


    ll K, A, B; cin >> K >> A >> B;
    if(B - A <= 2){
        cout << K+1 << endl; return 0;
    }
    if(K <= A){
        cout << K+1 << endl; return 0;
    }
    ll cnt = A-1 + 2*((K-(A-1))/2);
    ll ans = (K-(A-1))/2 * (B-A) + A;
    ll remcnt = K - cnt;
    cout << ans + remcnt << endl;
    return 0;
}


Compiler output:
a.cc:72:17: error: 'cin' does not name a type
   72 |     ll K, A, B; cin >> K >> A >> B;
      |                 ^~~
a.cc:73:5: error: expected unqualified-id before 'if'
   73 |     if(B - A <= 2){
      |     ^~
a.cc:76:5: error: expected unqualified-id before 'if'
   76 |     if(K <= A){
      |     ^~
a.cc:82:5: error: 'cout' does not name a type
   82 |     cout << ans + remcnt << endl;
      |     ^~~~
a.cc:83:5: error: expected unqualified-id before 'return'
   83 |     return 0;
      |     ^~~~~~
a.cc:84:1: error: expected declaration before '}' token
   84 | }
      | ^
Language: C++

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

int n, a, b;

int main() {
	cin >> n >> a >> b;
  	if (a + 2 >= b) cout << n + 1 << endl;
  	else {
      	if (n <= a - 1) cout << n + 1 << endl;
      	else {
          if ((n - a) % 2 == 0) (long long)(n + 1 - a) / 2 * (b - a) + a + 1 << endl;
          else cout << (long long)(n + 1 - a) / 2 * (b - a) + a << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:78: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |           if ((n - a) % 2 == 0) (long long)(n + 1 - a) / 2 * (b - a) + a + 1 << endl;
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long k, a, b;
  cin >> k >> a >> b;
  if (b <= a + 2) {
    cout << k + 1 << '\n'
  } else {
    cout << max(0LL, (k - a + 1) / 2) * (b - a) + ((k - a + 1) % 2) + a << '\n';
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before '}' token
   10 |     cout << k + 1 << '\n'
      |                          ^
      |                          ;
   11 |   } else {
      |   ~
Language: C++

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long k, a, b;
  cin >> k >> a >> b
  if (b <= a + 2) {
    cout << k + 1 << '\n';
  } else {
    cout << max(0LL, (k - a + 1) / 2) * (b - a) + ((k - a + 1) % 2) + a - 1 << '\n';
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: expected ';' before 'if'
    8 |   cin >> k >> a >> b
      |                     ^
      |                     ;
    9 |   if (b <= a + 2) {
      |   ~~                 
a.cc:11:5: error: 'else' without a previous 'if'
   11 |   } else {
      |     ^~~~
Language: C++

k,a,b = map(int,input().split())
count = 1
tataku = k-1
a_make = k//(a+1)# a+1 now_action_max  ->yen
b_make_num = k//(a+1+1)#
b_make = b*b_make_num
if b_make_num ==1:
    b_make+=tataku-2*b_make_num
else:
    b_make+=k-2*b_make_num
print(b_make)

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

k,a,b = map(int,input().split())
count = 1
tataku = k-1
a_make = k//(a+1)# a+1 now_action_max  ->yen
b_make_num = k//(a+1+1)#
b_make = b*b_make_num
#print(b_make,'bmake1')
if b_make_num ==1:
    b_make+=tataku-2*b_make_num
else:
    b_make+=k-2*b_make_num
print(b_make)#,'bmake2')
#print(b_make_num,'num')
#print(a_make,'amake')

Compiler output:
a.cc:7:2: error: invalid preprocessing directive #print
    7 | #print(b_make,'bmake1')
      |  ^~~~~
a.cc:12:14: error: stray '#' in program
   12 | print(b_make)#,'bmake2')
      |              ^
a.cc:12:16: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   12 | print(b_make)#,'bmake2')
      |                ^~~~~~~~
a.cc:13:2: error: invalid preprocessing directive #print
   13 | #print(b_make_num,'num')
      |  ^~~~~
a.cc:14:2: error: invalid preprocessing directive #print
   14 | #print(a_make,'amake')
      |  ^~~~~
a.cc:1:1: error: 'k' does not name a type
    1 | k,a,b = map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 301000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
ll INF = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};

int main(){
    ll K,A,B; cin >> K >> A >> B;
    if(K+1 <= A){
        cout << K + 1 << endl;
        return 0;
    }
    if(A+2 >= B){
        cout << K + 1 << endl;
        return 0;
    }
    for(int i = 0; i < K; i++){
        if(bisket < A) bisket++;
        else {
            if((K-i) == 1){
                bisket++;
                break;
            } else if((K-i)%2 == 0){
                bisket += ((K-i)/2)*(B-A);
                break;
            } else {
                bisket += ((K-i)/2)*(B-A) + 1;
                break;
            }
        }
    }
    cout << bisket << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'bisket' was not declared in this scope
   27 |         if(bisket < A) bisket++;
      |            ^~~~~~
a.cc:41:13: error: 'bisket' was not declared in this scope
   41 |     cout << bisket << endl;
      |             ^~~~~~
Language: C

#include<stdio.h>

double max(double x,double y){
    if(x>=y) return x;
    else return y;
}

int main(void){
    double K,A,B,x,y;
    double bis;
    scanf("%lf %lf %lf",&K,&A,&B);
    if(B-A<2){
        bis=1+K;
    }else if(K<=A){
        bis=1+K;
    }else{
        x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
        y=1+K;
        bis=max(x,y);
    }
    printf("%lf",bis);
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:17:39: error: invalid operands to binary % (have 'double' and 'int')
   17 |         x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
      |                                ~~~~~~~^
      |                                    |
      |                                    double
Language: C

#include<stdio.h>

double max(double x,double y){
    if(x>=y) return x;
    else return y;
}

int main(void){
    double K,A,B,x,y;
    double bis;
    scanf("%lf %lf %lf",&K,&A,&B);
    if(B-A<2){
        bis=1+K;
    }else if(K<=A){
        bis=1+K;
    }else{
        x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
        y=1+K;
        bis=max(x,y);
    }
    printf("%d",bis);
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:17:39: error: invalid operands to binary % (have 'double' and 'int')
   17 |         x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
      |                                ~~~~~~~^
      |                                    |
      |                                    double
Language: C

#include<stdio.h>

double max(double x,double y){
    if(x>=y) return x;
    else return y;
}

int main(void){
    double K,A,B,x,y;
    double bis;
    scanf("%d %d %d",&K,&A,&B);
    x=K/2;
    y=K%2;
    if(B-A<2){
        bis=1+K;
    }else if(K<=A){
        bis=1+K;
    }else{
        x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
        y=1+K;
        bis=max(x,y);
    }
    printf("%d",bis);
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:13:8: error: invalid operands to binary % (have 'double' and 'int')
   13 |     y=K%2;
      |        ^
main.c:19:39: error: invalid operands to binary % (have 'double' and 'int')
   19 |         x=A+((K-A+1)/2)*(B-A)+((K-A+1)%2);
      |                                ~~~~~~~^
      |                                    |
      |                                    double
Language: C++

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

int main()
{
    int K, A, B;
    cin >> K >> A >> B;
    
    if(A+2>=B)
    {
        cout << K+1;
    }
    else
    {
        if(K <= A)
        {
            cout << K+1;
        }
        else
        {
            int m = K+1-A;
            if(m%2 == 0)
            {
                cout << A + (B-A)*(m/2)
            }
            else
            {
                cout << A+1 + (B-A)*(m-1)/2
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:40: error: expected ';' before '}' token
   24 |                 cout << A + (B-A)*(m/2)
      |                                        ^
      |                                        ;
   25 |             }
      |             ~                           
a.cc:28:44: error: expected ';' before '}' token
   28 |                 cout << A+1 + (B-A)*(m-1)/2
      |                                            ^
      |                                            ;
   29 |             }
      |             ~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:9:56: error: expected ')' before ';' token
    9 |     printf("%d\n",a+(a-b)*(k-a+1)/2+(k-a+2)/2-(k-a+1/2);
      |           ~                                            ^
      |                                                        )
main.c:9:57: error: expected ';' before '}' token
    9 |     printf("%d\n",a+(a-b)*(k-a+1)/2+(k-a+2)/2-(k-a+1/2);
      |                                                         ^
      |                                                         ;
   10 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int K,A,B;
  long long ans = 0;
  long long anskari = 0;
  cin >>K>>A>>B;
  if(B<A+2){
    ans = 1+K;
  }
  else{
    if(K-A+1%2 == 0){
      anskari = ((K-(A-1))/2)*(B-A);
    }
    else{
      anskari = ((K-(A-1))/2)*(B-A)+1;
    }
    ans = max(1+K,anskari);
  }
  cout << ans << endl;
}
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: no matching function for call to 'max(int, long long int&)'
   18 |     ans = max(1+K,anskari);
      |           ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   18 |     ans = max(1+K,anskari);
      |           ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |     ans = max(1+K,anskari);
      |           ~~~^~~~~~~~~~~~~
Language: C++

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

typedef long long ll;

int main()
{
  ll K, A, B;
  cin >> K >> A >> B;
  if ( B - A <= 2 ) { cout << ans << endl; return 0; }
  ll zan = K-A+1;
  if ( zan <= 0 ) { cout << ans << endl; return 0; }
  ll ans = (zan/2) * (B-A);
  ans += A;
  if ( zan % 2 ) ans++;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   if ( B - A <= 2 ) { cout << ans << endl; return 0; }
      |                               ^~~
      |                               abs
a.cc:12:29: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   if ( zan <= 0 ) { cout << ans << endl; return 0; }
      |                             ^~~
      |                             abs
Language: Java

// When I hit my pocket
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt(); // number of operations
        int A = sc.nextInt(); // exchange A biscuits to 1 yen
        int B = sc.nextInt(); // exchange 1 yen to B biscuits
        long max = 0;

        if (B - A < 3) {
            max += (long) K + 1; 
        } else {
            if (K % (A + 2) = A + 1) {
                max += (K / (A + 2) + 1) * B;
            } else {
                max += (K / (A + 2) * B) + K % (A + 2) + 1;
            }
        }
        System.out.println(max);
    }
}

Compiler output:
Main.java:15: error: unexpected type
            if (K % (A + 2) = A + 1) {
                  ^
  required: variable
  found:    value
1 error
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iterator>
#include <utility>
#include <iomanip>
#include <cmath>
#include <climits>
#include <cassert>
#include <stdio.h>
#include <string.h>

using namespace std;

void solve() {
  long long k, a, b;
  cin >> k >> a >> b;
  
  long long ret = 0;
  if (b - a <= 2) {
    ret = k+1;
  } else {
    ret = ((k - a-1) /2) * b + ((k - a-1)%2)
  }

  std::cout << ret << std::endl;
}

int main(int argc, char *argv[])
{
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:45: error: expected ';' before '}' token
   31 |     ret = ((k - a-1) /2) * b + ((k - a-1)%2)
      |                                             ^
      |                                             ;
   32 |   }
      |   ~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iterator>
#include <utility>
#include <iomanip>
#include <cmath>
#include <climits>
#include <cassert>
#include <stdio.h>
#include <string.h>

using namespace std;

void solve() {
  long long k, a, b;
  cin >> k >> a >> b;
  
  long long ret = 0;
  if (b - a <= 2) {
    ret = k+1;
  } else {
    ret = ((k - a-1) /2 2) * b + ((k - a-1)%2)
  }

  std::cout << ret << std::endl;
}

int main(int argc, char *argv[])
{
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:24: error: expected ')' before numeric constant
   31 |     ret = ((k - a-1) /2 2) * b + ((k - a-1)%2)
      |           ~            ^~
      |                        )
a.cc:31:47: error: expected ';' before '}' token
   31 |     ret = ((k - a-1) /2 2) * b + ((k - a-1)%2)
      |                                               ^
      |                                               ;
   32 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  long long k,a,b;
  cin >> k >> a >> b;

  long long ans1;
  ans1 = (k-a+1) / 2;
  ans1 = (ans-1) * (b-a);
  ans1 = ans + b + (k-a+1)%2;

  long long ans2;
  ans2 = k+1;

  if(ans1 > ans2){
    cout << ans1 << endl;
  } else {
    cout << ans2 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'ans' was not declared in this scope; did you mean 'ans1'?
   10 |   ans1 = (ans-1) * (b-a);
      |           ^~~
      |           ans1
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  long long k,a,b;
  cin >> k >> a >> b;

  long long ans1;
  ans1 = (k-a+1) / 2;
  ans1 = (ans-1) * (c-b);
  ans1 = ans + b + (k-a+1)%2;

  long long ans2;
  ans2 = k+1;

  if(ans1 > ans2){
    cout << ans1 << endl;
  } else {
    cout << ans2 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'ans' was not declared in this scope; did you mean 'ans1'?
   10 |   ans1 = (ans-1) * (c-b);
      |           ^~~
      |           ans1
a.cc:10:21: error: 'c' was not declared in this scope
   10 |   ans1 = (ans-1) * (c-b);
      |                     ^
Language: Java

import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int out = 0;
		if(b - a <= 2 || a >= k) {
			out = 1 + k;
			System.out.println(out);
		}else {
			int firstless = a - 1;
			k -= firstless;
			int splitnum = k/2;
			int addnum = b - a;
			out = splitnum * addnum + a;
			if((k - (a + 1)) % 2 == 1) {
				out += 1;
			}
			System.out.println(out);
		}
	}

Compiler output:
Main.java:26: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

" Press ? for help

>----------Bookmarks----------

.. (up a dir)
</kyopro/minpro2019/
  [  ]c.cpp


Compiler output:
a.cc:1:1: warning: missing terminating " character
    1 | " Press ? for help
      | ^
a.cc:1:1: error: missing terminating " character
    1 | " Press ? for help
      | ^~~~~~~~~~~~~~~~~~
a.cc:7:4: error: extended character  is not valid in an identifier
    7 |   [  ]c.cpp
      |    ^
a.cc:7:4: error: extended character   is not valid in an identifier
a.cc:3:1: error: expected unqualified-id before '>' token
    3 | >----------Bookmarks----------
      | ^
Language: C++

#include <iostream>

typedef unsigned long int int64;
using namespace std ;

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

  if(K-A-1)<0){
    cout << K+1 << endl;
    return 0;
  }

  if(B-A<3){
    cout << K+1 << endl;
    return 0;
  }

  int64 ans = 1;
  ans += A-1;
  if((K-A+1))%2==0){
    ans += (B-A)*((K-A+1))/2);
  }else{
    ans += (B-A)*((K-A+1))/2)+1;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before '<' token
   10 |   if(K-A-1)<0){
      |            ^
a.cc:22:14: error: expected primary-expression before '%' token
   22 |   if((K-A+1))%2==0){
      |              ^
a.cc:25:29: error: expected ';' before ')' token
   25 |     ans += (B-A)*((K-A+1))/2)+1;
      |                             ^
      |                             ;
Language: C++

#include<iostream>
#include<cmath>

using namespace std;

int main()
{
	long long K,A,B;

	cin >> K >> A >> B;

	if( A+2 >= B)
	{
		cout << K+1 << endl;
		return 0;
	}

	//long long x = K - (A + 1);
	long long x = max(0,K - (A + 1));
	long long y = x/2;

	cout << B + (B - A)*y + x%2 << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: no matching function for call to 'max(int, long long int)'
   19 |         long long x = max(0,K - (A + 1));
      |                       ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:19:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   19 |         long long x = max(0,K - (A + 1));
      |                       ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main() {
   long long k,a,b;
   cin >> k >> a >> b;
   /*
   long long l=1;
   if(a+1>=b) cout << k+1 << endl;
   if(a+1<b&&k<=a ) cout << k+1 << endl;
   if(a+1<b && k>a){
		r=max(k+1,k+1+max(0,(k-(a-1))/2)*(b-a-2))
		
	}
	*/

    cout << max(k+1,k+1+max(0,(k-(a-1))/2)*(b-a-2)) << endl;
   	
  
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: no matching function for call to 'max(int, long long int)'
   17 |     cout << max(k+1,k+1+max(0,(k-(a-1))/2)*(b-a-2)) << endl;
      |                         ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:17:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   17 |     cout << max(k+1,k+1+max(0,(k-(a-1))/2)*(b-a-2)) << endl;
      |                         ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:17:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |     cout << max(k+1,k+1+max(0,(k-(a-1))/2)*(b-a-2)) << endl;
      |                         ~~~^~~~~~~~~~~~~~~
Language: C

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#define SIZE 100005
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
 
int main()
{
	ll K,A,B;
	scanf("%lld %lld %lld",&K,&A,&B);
	ll ret=1;
	if(A+2>=B)
	{
		ret+=K;
	}
	else
	{
		ll z=min(K,A-1);
		ret+=z;
		K-=z;
		ret+=(B-A)*(K/2);
		ret+=K%2;
	}
	printf("%lld\n",ret);
	return 0;


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

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#define SIZE 100005
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
 
int main()
{
	ll K,A,B;
	scanf("%lld %lld %lld",&K,&A,&B);
	ll ret=1;
	if(A+2>=B)
	{
		ret+=K;
	}
	else
	{
		ll z=min(K,A-1);
		ret+=z;
		K-=z;
		ret+=(B-A)*(K/2);
		ret+=K%2;
	}
	printf("%lld\n",ret);
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:37:18: error: expected '}' at end of input
   37 |         return 0;
      |                  ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
Language: C++

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

long trade( maisuu,long A,long B){
  return ((maisuu-maisuu%A)/A)*B+maisuu%A;
}

int main(){
  long K,A,B;
  cin >>K>>A>>B;
  if(B-A<2){
    cout << K+1;
  }
  else{
    long init = 0;
    long cukky = 1;
    K = K-(A-1);
    cukky = A;
    if(K%2==0){
        for(long i=0;i<K/2;i++){
          cukky = cukky-A+B;
        }
    }
    else{
      for(long i=0;i<(K-1)/2;i++){
          cukky = cukky-A+B;
        }
      cukky++;
    }
    cout  << cukky;
  }
  return 0;
}

Compiler output:
a.cc:5:13: error: 'maisuu' was not declared in this scope
    5 | long trade( maisuu,long A,long B){
      |             ^~~~~~
a.cc:5:20: error: expected primary-expression before 'long'
    5 | long trade( maisuu,long A,long B){
      |                    ^~~~
a.cc:5:27: error: expected primary-expression before 'long'
    5 | long trade( maisuu,long A,long B){
      |                           ^~~~
a.cc:5:33: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | long trade( maisuu,long A,long B){
      |                                 ^
Language: C++

#include<iostream>
using namespace std;
 
int main()
{
	long long k,a,b,biscuits,ichi;
	biscuits = 1;
	ichi = 0;
	cin>>k>>a>>b;
	if (abs(b-a) < 2) {
	    cout<<k+1<<endl;
	} else {
	    for (int i=0 ; i<k ; i++) {
	        //if (biscuits+k-i<b && biscuits>=a) {
	        if (ichi > 0) {
	            biscuits = biscuits + b;
	            ichi --;
	            //cout<<biscuits<<endl;
	        } else if (i<k-1 && biscuits>=a) {
	            ichi ++;
	            biscuits = biscuits - a;
	        } else {
	            biscuits ++;
	        }
	        //cout<<biscuits<<endl;
	    }
	    cout<<biscuits<<endl;
	    //cout<<ichi<<endl;
	}
}
#include<iostream>
using namespace std;
 
int main()
{
	long long k,a,b,biscuits,ichi;
	biscuits = 1;
	ichi = 0;
	cin>>k>>a>>b;
	if (abs(b-a) <= 2) {
	    cout<<k+1<<endl;
	} else {
	    for (int i=0 ; i<k ; i++) {
	        //if (biscuits+k-i<b && biscuits>=a) {
	        if (ichi > 0) {
	            biscuits = biscuits + b;
	            ichi --;
	            //cout<<biscuits<<endl;
	        } else if (i<k-1 && biscuits>=a) {
	            ichi ++;
	            biscuits = biscuits - a;
	        } else {
	            biscuits ++;
	        }
	        //cout<<biscuits<<endl;
	    }
	    cout<<biscuits<<endl;
	    //cout<<ichi<<endl;
	}
}
提出情報

Compiler output:
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
a.cc:61:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   61 | 提出情報
      | ^~~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdlib.h>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<stdbool.h>
#include<math.h>
typedef long long ll;
#define N (1000000000+7)
using namespace std;
typedef pair<int, int> P;

int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

ll prime[100010];
ll kaijo[200010];
void init() {
	kaijo[0] = 1;
	for (ll i = 1;i <= 200000;i++)kaijo[i] = (kaijo[i - 1] * i) % N;
}

ll inv(ll x) {
	ll res = 1;
	ll k = N - 2;
	ll y = x;
	while (k) {
		if (k & 1)res = (res*y) % N;
		y = (y%N*y%N) % N;
		k /= 2;
	}
	return res;
}

ll Comb(ll n, ll k) {
	ll b = kaijo[n];
	ll c = kaijo[n - k];
	ll d = kaijo[k];
	ll cd = (c*d) % N;
	return ((b%N)*(inv(cd)%N) + N) % N;
}


int main(void) {
	ll k, a, b, ans = 0, ans1 = 0;
	cin >> k >> a >> b;
	if (a >= b) {
		cout << k + 1 << endl;
		return 0;
	}
	ll num = k + 1 - 2;
	ans = (num / a)*b + num%a;
	num = k - (a - 1);
	if (num <= 0) {
		cout << k + 1 << endl;
		return 0;
	}
	if (num % 2 == 0) {
		ans1 = (num / 2)*(b - a) + a;
	}
	else {
		ans1 = (num / 2)*(b - a) + a + 1;
	}
	
	cout << max(ans2, max(ans, ans1)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:21: error: 'ans2' was not declared in this scope; did you mean 'ans1'?
   72 |         cout << max(ans2, max(ans, ans1)) << endl;
      |                     ^~~~
      |                     ans1
Language: C

#include <stdio.h>
int main(void){
 
long k,a,b;
scanf("%ld %ld %ld",&k,&a,&b);

if(k + 1< a +2){
printf("%ld",1+k);

else if(b -a  <= 2){
printf("%ld",1+k);

else if(b - a > 2)
printf("%ld",b - a + k - 2 + 1);
}
}
return 0;
 
}


Compiler output:
main.c: In function 'main':
main.c:10:1: error: expected '}' before 'else'
   10 | else if(b -a  <= 2){
      | ^~~~
main.c:13:1: error: expected '}' before 'else'
   13 | else if(b - a > 2)
      | ^~~~
main.c: At top level:
main.c:16:1: error: expected identifier or '(' before '}' token
   16 | }
      | ^
main.c:17:1: error: expected identifier or '(' before 'return'
   17 | return 0;
      | ^~~~~~
main.c:19:1: error: expected identifier or '(' before '}' token
   19 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(void) {
    
    int K,A,B,T,ans; 
    cin>>K>>A>>B;
    if(A+2>=B){
        ans=K+1;
       
    }
    T=K+1
    while(A>T-2){
        if(A>T-2){
            ans=T;
        }else{
            ans=T-2-A+B;
            T=T-A-2;
        }
    }
    cout<<ans<<endl;

    
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected ';' before 'while'
   12 |     T=K+1
      |          ^
      |          ;
   13 |     while(A>T-2){
      |     ~~~~~
Language: C

#include<stdio.h>

main(){
  int K,A,B,i;
  int count=0,sum=1,a=0;
  scanf("%d %d %d",&K,&A,&B);
  if(A>=B)printf("%d\n",K+1);
  else if((B-A)>=3){
  	for(i=1;i<A;++i){
    	++count;
    }
    sum+=(B-A)/2;
    a+=2;
    while((B-A)>2*A){for(i=0;i<A;++i)++count;
    sum+=(K-count)*(B-A)/2;
                    a+=2;}
    if((B-A)<=2*A) {sum+=K-count-a;
                   break;}
    if((K-count)%2!=0)sum+=1;
    printf("%d\n",sum);
  }
  else printf("%d\n",K+1);
  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:20: error: break statement not within loop or switch
   18 |                    break;}
      |                    ^~~~~
Language: C++

#include <iostream>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

int main(void){
	int k,a,b;
	cin >> k >> a >> b;
	
	unsigned long long ans = k+1;
	namespace mp = boost::multiprecision;
	using Bint = mp::cpp_int;
	Bint ans = k+1;
	if( b > 2 * a && k >= a + 1 ){ // 割に合う交換ができる時
		unsigned long long offset = a - 1; //元本用意のために必要なターン数
		unsigned long long remain_turn = k - offset; // 元本用意後のターン数
		ans = a + (b - a) * (unsigned long long)(remain_turn / 2); // 交換
		if( remain_turn % 2 ){
			ans += 1; // 余剰ターンは叩いて増やす
		}
	}
	else{
		ans = k + 1;
	}
	
	cout << ans << endl;
	
	// 1回叩けば1枚増加
	// 2回掛けて交換操作をするとA枚→B枚
	// B/A>2なら交換操作に費やした方が良い
	// ただし交換の元本は必要
	// K < A-1+2(1:最初は1枚持っているので)だと交換自体ができない
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

main(){
  int K,A,B,i;
  int count=0,sum=1,a=0;
  scanf("%d %d %d",&K,&A,&B);
  if(A>=B)printf("%d\n",K+1);
  else if((B-A)>=3){
  	for(i=1;i<A;++i){
    	++count;
    }
    sum+=(B-A)/2;
    a2+;
    while((B-A)>2*A){for(i=0;i<A;++i)++count;
    sum+=(K-count)*(B-A)/2;
                    a2+;}
    if((B-A)<=2*A) {sum+=K-count-a;
                   break;}
    if((K-count)%2!=0)sum+=1;
    printf("%d\n",sum);
  }
  else printf("%d\n",K+1);
  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:5: error: 'a2' undeclared (first use in this function); did you mean 'a'?
   13 |     a2+;
      |     ^~
      |     a
main.c:13:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: expected expression before ';' token
   13 |     a2+;
      |        ^
main.c:16:24: error: expected expression before ';' token
   16 |                     a2+;}
      |                        ^
main.c:18:20: error: break statement not within loop or switch
   18 |                    break;}
      |                    ^~~~~
Language: C++

#include <iostream>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

int main(void){
	int k,a,b;
	cin >> k >> a >> b;
	
	unsigned long long ans = k+1;
	namespace mp = boost::multiprecision;
	using Bint = mp::cpp_int;
	Bint_int ans = k+1;
	if( b > 2 * a && k >= a + 1 ){ // 割に合う交換ができる時
		unsigned long long offset = a - 1; //元本用意のために必要なターン数
		unsigned long long remain_turn = k - offset; // 元本用意後のターン数
		ans = a + (b - a) * (unsigned long long)(remain_turn / 2); // 交換
		if( remain_turn % 2 ){
			ans += 1; // 余剰ターンは叩いて増やす
		}
	}
	else{
		ans = k + 1;
	}
	
	cout << ans << endl;
	
	// 1回叩けば1枚増加
	// 2回掛けて交換操作をするとA枚→B枚
	// B/A>2なら交換操作に費やした方が良い
	// ただし交換の元本は必要
	// K < A-1+2(1:最初は1枚持っているので)だと交換自体ができない
	return 0;
}

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

#include <iostream>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

int main(void){
	int k,a,b;
	cin >> k >> a >> b;
	
	unsigned long long ans = k+1;
	namespace mp = boost::multiprecision;
	mp::cpp_int ans = k+1;
	if( b > 2 * a && k >= a + 1 ){ // 割に合う交換ができる時
		unsigned long long offset = a - 1; //元本用意のために必要なターン数
		unsigned long long remain_turn = k - offset; // 元本用意後のターン数
		ans = a + (b - a) * (unsigned long long)(remain_turn / 2); // 交換
		if( remain_turn % 2 ){
			ans += 1; // 余剰ターンは叩いて増やす
		}
	}
	else{
		ans = k + 1;
	}
	
	cout << ans << endl;
	
	// 1回叩けば1枚増加
	// 2回掛けて交換操作をするとA枚→B枚
	// B/A>2なら交換操作に費やした方が良い
	// ただし交換の元本は必要
	// K < A-1+2(1:最初は1枚持っているので)だと交換自体ができない
	return 0;
}

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

#include <iostream>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

int main(void){
	int k,a,b;
	cin >> k >> a >> b;
	
	unsigned long long ans = k+1;
	boost::multiprecision::cpp_int ans = k+1;
	if( b > 2 * a && k >= a + 1 ){ // 割に合う交換ができる時
		unsigned long long offset = a - 1; //元本用意のために必要なターン数
		unsigned long long remain_turn = k - offset; // 元本用意後のターン数
		ans = a + (b - a) * (unsigned long long)(remain_turn / 2); // 交換
		if( remain_turn % 2 ){
			ans += 1; // 余剰ターンは叩いて増やす
		}
	}
	else{
		ans = k + 1;
	}
	
	cout << ans << endl;
	
	// 1回叩けば1枚増加
	// 2回掛けて交換操作をするとA枚→B枚
	// B/A>2なら交換操作に費やした方が良い
	// ただし交換の元本は必要
	// K < A-1+2(1:最初は1枚持っているので)だと交換自体ができない
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(int argc, char const *argv[])
{
	long long k,a,b;
	long long j;
	scanf("%lld%lld%lld",&k,&a,&b);
	if(a + 1 < b){
		printf("%lld\n", (1 + k / 2) + (b - a) * (k - k / 2)):
	}
	else{
		printf("%lld\n", k + 1);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:70: error: expected ';' before ':' token
    9 |                 printf("%lld\n", (1 + k / 2) + (b - a) * (k - k / 2)):
      |                                                                      ^
      |                                                                      ;
Language: C++

#include <bits/stdc++.h>
2.using namespace std;
3. 
4. 
5.int main()
6.{
7.	unsigned long long int K, A, B;
8.	cin >> K >> A >> B; //数字の読み込み
9.	unsigned long long int answer;
10.	if (K<A || A>=B-2){
11.		cout << K+1 <<endl;
12.		return 0;
13.	}
14.	if ((K-A)%2==0)answer = (B-A)*(K-A)/2+1;
15.	if ((K-A)%2==1)answer = B*(K-A+1)/2-A*(K-A-1)/2;
16.	cout << max(answer, K+1) << endl;
17.	return 0;
18.}


Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.using namespace std;
      | ^~~~~~~
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3.
      | ^~
Language: C++

#include <iostream>

int main()
{
	double K,A,B;
	std::cin >> K >> A >> B;

	double bis = 1;//ビスケット枚数
	int yen = 0;

	double guchoku = 1+K;
	double ans;


	if (A >= B) {//損するパターン
		ans = guchoku;
	}
	else {
		std::cout << "スタート " << std::endl;
		std::cout << "bis " << bis << std::endl;
		std::cout << "K   " << K << std::endl;
			
		bis = bis + A - 1;
		K = K - A + 1;

		if (std::fmod(K, 2) == 0) {//偶数
			double val = K / 2;
			bis = bis + val * (B - A);
			K = 0;
		}
		else {//奇数
			double val = K / 2;
			bis = bis + val * (B - A);
			K = 1;
			bis += 1;
			K -= 1;
			std::cout << "増やす " << std::endl;
			std::cout << "bis " << bis << std::endl;
			std::cout << "K   " << K << std::endl;
		}



		}
//	}

	ans = bis > guchoku ? bis : guchoku;

	std::cout << ans << std::endl;
//		std::cout << bis;

Last:
	int hoge;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: 'fmod' is not a member of 'std'
   26 |                 if (std::fmod(K, 2) == 0) {//偶数
      |                          ^~~~
Language: C

#include<stdio.h>

int main()
{

int i,j;
int K,A,B,k=1;

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

if((B-A)>2){
K = K - (A-1);
if((K%2)==0){
k = A + ((K)/2 * (B-A));
}
else{
k = A + ((K)/2 * (B-A))
k+=1;
}
}
else
k = k+ K;

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

return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:17:24: error: expected ';' before 'k'
   17 | k = A + ((K)/2 * (B-A))
      |                        ^
      |                        ;
   18 | k+=1;
      | ~
Language: C++

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

int main(){
    long long K,A,B,ans=1;
    cin>>K>>A>>B;
    if(B-A<=1)ans+=K;
    else if(B-A>=2){
        if(K<=A)ans=K;
        else if(A<K){
           ans+=A-1;
           ans+=(B-A)*((K-A+1)/2);
           if(K-(A-1+(K-A+1)/2))ans++;
        }
    cout<<ans<<endl;
    return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  long long int K, A, B;
  cin >> K >> A >> B;
  if(A+2<=B){
    cout << 1+K << endl;
  }else{
    cout << {(K-1)/2}*(B-A)+(K-1)%2+1 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before '{' token
    9 |     cout << {(K-1)/2}*(B-A)+(K-1)%2+1 << endl;
      |             ^
a.cc:9:22: error: invalid type argument of unary '*' (have 'long long int')
    9 |     cout << {(K-1)/2}*(B-A)+(K-1)%2+1 << endl;
      |                      ^~~~~~
Language: C++

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

int main() {
  int K,A,B,S;
  cin>>K>>A>>B;
  if(A<=B){
    cout << 1+K << endl;
  }
  else{
    if(K<=A+1){
      cout<<1+K<<endl;
    }
    else{
      S=B*(1+(K-2*A+2)/A)+(K-A+1)%A
      cout<< S <<end;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: expected ';' before 'cout'
   15 |       S=B*(1+(K-2*A+2)/A)+(K-A+1)%A
      |                                    ^
      |                                    ;
   16 |       cout<< S <<end;
      |       ~~~~
Language: C++

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


int main() {
    int K;
    int A
    int B;
    int biscuit = 0;

    cin >> K >> A >> B;

    if (B-A > 2){
        int nokori = K - (A - 1);
        biscuit += A;
        biscuit += pow((B-A), (nokori/2));
        biscuit += (nokori%2);
        
    }else{
        biscuit = 1 + K;
    }

    cout << biscuit << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'int'
    9 |     int B;
      |     ^~~
a.cc:12:17: error: 'A' was not declared in this scope
   12 |     cin >> K >> A >> B;
      |                 ^
a.cc:12:22: error: 'B' was not declared in this scope
   12 |     cin >> K >> A >> B;
      |                      ^
Language: C++

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

int main(){
    int k, a, b, bisket, coin;
    cin >> k >> a >> b;
    bisket = 1;
    coin = 0;
    while(k > 0){
        if(coin == 0){
            if(bisket < a || k < 2) {
                bisket++;
                k--;
            } else {
                coin++;
                bisket -= a;
                k--;
            }
        } else {
            bisket += b;
            coin--;
            k--
        }
    }
    cout << bisket << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
   22 |             k--
      |                ^
      |                ;
   23 |         }
      |         ~
Language: C

#include<stdio.h>

int main()
{

int i,j;
int K,A,B,k=1;

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

if(A >B){
K -= (A-1);
if((K%=2)==0){
k = A + (K -(A-1))/2 * (A-B);
}
else{
k = A + (K-(A-1)/2 * (A - B) +1;
}
}
else
k = k+= K;

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

return 0;
} 


Compiler output:
main.c: In function 'main':
main.c:17:32: error: expected ')' before ';' token
   17 | k = A + (K-(A-1)/2 * (A - B) +1;
      |         ~                      ^
      |                                )
main.c:17:33: error: expected ';' before '}' token
   17 | k = A + (K-(A-1)/2 * (A - B) +1;
      |                                 ^
      |                                 ;
   18 | }
      | ~
Language: C

#include<stdio.h>

int main()
{

int i,j,k;
int K,A,B,k=1;

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

if(A >B){
K -= (A-1);
if((K%=2)==0){
k = A + (K -(A-1))/2 * (A-B);
}
else{
k = A + (K-(A-1)/2 * (A - B) +1;
}
}
else
k = k+= K;

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

return 0;
} 


Compiler output:
main.c: In function 'main':
main.c:7:11: error: redeclaration of 'k' with no linkage
    7 | int K,A,B,k=1;
      |           ^
main.c:6:9: note: previous declaration of 'k' with type 'int'
    6 | int i,j,k;
      |         ^
main.c:17:32: error: expected ')' before ';' token
   17 | k = A + (K-(A-1)/2 * (A - B) +1;
      |         ~                      ^
      |                                )
main.c:17:33: error: expected ';' before '}' token
   17 | k = A + (K-(A-1)/2 * (A - B) +1;
      |                                 ^
      |                                 ;
   18 | }
      | ~
Language: C++

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

struct num {
	char c[100];
	
	operator +=(const num a) {
		for(int i=0;i<100;i++) {
			c[i]+=a.c[i];
			while(c[i]>=10) {
				c[i]-=10;
				c[(i+1)]+=1;
			}
		}
	}
	
	num operator *(num a) const{
		num ans;
		memset(&ans,0,sizeof(ans));
		int l=99,la=99;
		while(c[l]==0) l--;
		while(a.c[la]==0) la--;
		for(int i=0;i<=l;i++)
			for(int j=0;j<=la;j++) {
				int now=c[i]*a.c[j];
				ans.c[i+j]+=now%10;
				while(ans.c[i+j]>10) {
					ans.c[i+j]-=10;ans.c[i+j+1]++;
				}
				ans.c[i+j+1]+=now/10;
				while(ans.c[i+j+1]>10) {
					ans.c[i+j+1]-=10;
					ans.c[i+j+2]+=1;
				}
			}
		return ans;
	}
};

num change(long long n) {
	num ans;
	memset(&ans,0,sizeof(ans));
	int m=0;
	
	while(n) {
		ans.c[m]+=(n%10);
		n/=10;
		m++;
	}
	return ans;
}

int main() {
	int k,a,b;
	cin>>k>>a>>b;
	
	if(a-k<=(-1) && b-a>2) {
		int c=b-a;
		num cc=change(c);
		num now=change(a);
		int i=k-(a-1);
		num mul1=change(i/2);
		num mul=mul1*cc;
		now+=mul;
		if(i%2==1) {
			num one=change(1);
			now+=one;
		}
		int m=99;
		while(now.c[m]==0) m--;
		while(m>=0) {
			cout<<(int)now.c[m];
			m--;
		}
		cout<<endl;
	}
	else cout<<(k+1)<<endl;

	return 0;
}


Compiler output:
a.cc:8:9: error: ISO C++ forbids declaration of 'operator+=' with no type [-fpermissive]
    8 |         operator +=(const num a) {
      |         ^~~~~~~~
a.cc: In member function 'int num::operator+=(num)':
a.cc:16:9: warning: no return statement in function returning non-void [-Wreturn-type]
   16 |         }
      |         ^
Language: C++

#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;


int main ()
{
    ll k, a, b;
    cin >> k >> a >> b;
    if (b -a <= 2) {
        cout << k+1; return 0;
    }
    else {
        else if ((k - a + 1)%2==0) cout << (a  + (k - a + 1)/2*(b-a));
        else cout << (a + (k-a)/2*(b-a) +1);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'else' without a previous 'if'
   15 |         else if ((k - a + 1)%2==0) cout << (a  + (k - a + 1)/2*(b-a));
      |         ^~~~