Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
//---------------------------------------------------------------------------------------------------
typedef pair<int,int> P;

int main(void){
    // Your code here!
    ll a,b,c; cin >> a >> b >> c;
    ll c_poi = min(a+b+1,c);
    cout << c_poi + b << endl;
}
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
//---------------------------------------------------------------------------------------------------
typedef pair<int,int> P;

int main(void){
    // Your code here!
    ll a,b,c; cin >> a >> b >> c;
    ll c_poi = min(a+b+1,c);
    cout << c_poi + b << endl;
}


Compiler output:
a.cc:34:11: error: redefinition of 'const int INF'
   34 | const int INF = 1001001001;
      |           ^~~
a.cc:4:11: note: 'const int INF' previously defined here
    4 | const int INF = 1001001001;
      |           ^~~
a.cc:40:10: error: redefinition of 'const ll MOD'
   40 | const ll MOD=1000000007;
      |          ^~~
a.cc:10:10: note: 'const ll MOD' previously defined here
   10 | const ll MOD=1000000007;
      |          ^~~
a.cc:42:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   42 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:12:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   12 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:43:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   43 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:13:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
   13 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:44:23: error: redefinition of 'template<class T> auto MAX(const T&)'
   44 | template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
      |                       ^~~
a.cc:14:23: note: 'template<class T> auto MAX(const T&)' previously declared here
   14 | template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
      |                       ^~~
a.cc:45:23: error: redefinition of 'template<class T> auto MIN(const T&)'
   45 | template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
      |                       ^~~
a.cc:15:23: note: 'template<class T> auto MIN(const T&)' previously declared here
   15 | template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
      |                       ^~~
a.cc:46:29: error: redefinition of 'template<class T, class U> U SUM(const T&, const U&)'
   46 | template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
      |                             ^~~
a.cc:16:29: note: 'template<class T, class U> U SUM(const T&, const U&)' previously declared here
   16 | template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
      |                             ^~~
a.cc:47:29: error: redefinition of 'template<class T, class U> U COUNT(const T&, const U&)'
   47 | template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
      |                             ^~~~~
a.cc:17:29: note: 'template<class T, class U> U COUNT(const T&, const U&)' previously declared here
   17 | template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
      |                             ^~~~~
a.cc:48:31: error: redefinition of 'template<class T, class U> int LOWER(const T&, const U&)'
   48 | template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
      |                               ^~~~~
a.cc:18:31: note: 'template<class T, class U> int LOWER(const T&, const U&)' previously declared here
   18 | template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
      |                               ^~~~~
a.cc:49:31: error: redefinition of 'template<class T, class U> int UPPER(const T&, const U&)'
   49 | template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
      |                               ^~~~~
a.cc:19:31: note: 'template<class T, class U> int UPPER(const T&, const U&)' previously declared here
   19 | template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
      |                               ^~~~~
a.cc:50:5: error: redefinition of 'int GCD(int, int)'
   50 | int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
      |     ^~~
a.cc:20:5: note: 'int GCD(int, int)' previously defined here
   20 | int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
      |     ^~~
a.cc:51:5: error: redefinition of 'int LCM(int, int)'
   51 | int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
      |     ^~~
a.cc:21:5: note: 'int LCM(int, int)' previously defined here
   21 | int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
      |     ^~~
a.cc:55:5: error: redefinition of 'int main()'
   55 | int main(void){
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main(void){
      |     ^~~~