akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <iomanip>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(){
    double N;
    cin >> N;
    
    double ans;
    
    if((int)N%2 == 0){
        ans = N/2/N;
    }
    
    if((int)N%2 == 1){
        ans = (N+1)/2/N;
    }
    
    cout << ans << endl;
    
    return 0;
}
    

Measured memory_bytes: 256
<?php
$L=trim(fgets(STDIN));

$p0=0;
$p1=0;

for($i=0;$i<$L;$i++){
  $C=explode(' ',trim(fgets(STDIN)));
  $c=strcmp($C[0],$C[1]);

  if($c<0) $p1+=3;
  elseif($c>0) $p0+=3;
  else{
    ++$p0;
    ++$p1;
  }
}

echo $p0,' ',$p1;
?>

Measured memory_bytes: 15292
#include <iostream>
using namespace std;

int main() {
int n;
while(cin>>n){
	if(n==0){
		break;
	}
	int sum=0,max=0,min=1000,score;
	for(int k=0;k<n;k++){
		cin>>score;
		sum=sum+score;
		if(score>max){
			max=score;
		}
		if(score<min){
			min=score;
		}
	}
	cout<<(sum-max-min)/(n-2)<<endl;
}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll) x.size()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define MAX(x, y, z) max(x, max(y, z))
#define MIN(x, y, z) min(x, min(y, z))
#define ANS cout << ans << "\n"
#define RETURN(x)    \
  cout << x << "\n"; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << "\n"
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  string s;
  cin >> s;

  map<char, ll> m;
  rep(i, s.size()) {
    m[s[i]]++;
  }

  for (auto mm : m) {
    if (mm.second % 2 == 1) {
      COUT("No");
      return 0;
    }
  }
  COUT("Yes");
  return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int n,k;
int f[100005];
int  a[105];
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;++i) 
	    scanf("%d",&a[i]);
	for(int i=1;i<=k;++i)
		for(int j=1;j<=n;++j)
			if(i >= a[j]&& !f[i-a[j]]) f[i]=1; 
	if(f[k]) printf("First\n");
	else printf("Second\n");
    return 0;
}

Measured memory_bytes: 4144
#include <iostream>
#include <cstdio>
#include <bitset>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>

using namespace std;
using ll=long long;
using vint=vector<int>;
using pint=pair<int,int>;

const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();

#define rep(i,n) for(int i=0;i<int(n);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,i,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

void solve(){
	int n;
	pint p1[105], p2[105];
	bool used[105] = {};
	cin >> n;
	rep(i,n){
		cin >> p1[i].first >> p1[i].second;
	}
	rep(i,n){
		cin >> p2[i].first >> p2[i].second;
	}

	sort(p2, p2+n);

	int ans = 0;
	rep(i,n){
		int x = p2[i].first, y = p2[i].second;
		int index = -1, mm = -1;

		rep(j,n){
			if(p1[j].first < x && p1[j].second < y && !used[j]){
				if(p1[j].second > mm){
					index = j;
					mm = p1[j].second;
				}
			}
		}

		if(index != -1){
				ans++;
				used[index] = true;
		}
	}
	cout << ans << endl;
}

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

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int p=1<<15, s, t;
	bool a[(1<<15)+1], f;
	
	fill(a, a+(p+1), false);
	a[2] = true;
	
	for(int i = 3; i <= p; i+=2){
		f = true;
		for(int j = 3; j*j <= i; j+=2){
			if(i%j == 0){
				f = false;
				break;
			}
		}
		a[i] = f;
	}
	
	while(1){
		cin >> s;
		if(s == 0){
			break;
		}
		t = 0;
		if(a[s-2]){
			t++;
		}
		for(int i = 3; i <= s/2; i+=2){
			if(a[i] && a[s-i]){
				t++;
			}
		}
		cout << t << endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;

int main()
{
    int n, b, f, r, v;
    int house[4][3][10] = {0};

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> b >> f >> r >> v;

        house[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 10; k++) {
                cout << " " << house[i][j][k];
            }

            cout << endl;
        }

        if (i != 3) {
            cout << "####################" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <vector>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main()
{
	string s;
	int n;
	cin >> s >> n;
	
	rep(i,n)
	{
		string s2,s3;
		int x,y;

		cin >> s2;
		if(s2 == "print")
		{
			cin >> x >> y;
			REP(j,x,y+1)
			{
				cout << s[j];
			}
			cout << endl;
		}
		else if(s2 == "reverse")
		{
			cin >> x >> y;
			vector<char> v;
			REP(i,x,y+1)
			{
				v.push_back(s[i]);
			}

			REP(i,x,y+1)
			{
				s[i] = v[v.size()-1 - (i-x)];
			}
		}
		else if(s2 == "replace")
		{
			cin >> x >> y >> s3;
			REP(i,x,y+1)
			{
				s[i] = s3[i-x];
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

vector<int>E[100000];
int d1[100000], d2[100000];
signed main() {
	int n; scanf("%d", &n);
	rep(i, n - 1) {
		int a, b; scanf("%d%d", &a, &b); a--; b--;
		E[a].push_back(b); E[b].push_back(a);
	}
	queue<P>que;
	memset(d1, -1, sizeof(d1));
	d1[0] = 0; que.push(P(0, 0));
	while (!que.empty()) {
		P p = que.front(); que.pop();
		for (int v : E[p.second]) {
			if (d1[v] == -1) {
				d1[v] = p.first + 1; que.push(P(d1[v], v));
			}
		}
	}
	memset(d2, -1, sizeof(d2));
	d2[n - 1] = 0; que.push(P(0, n - 1));
	while (!que.empty()) {
		P p = que.front(); que.pop();
		for (int v : E[p.second]) {
			if (d2[v] == -1) {
				d2[v] = p.first + 1; que.push(P(d2[v], v));
			}
		}
	}
	int a = 0, b = 0;
	rep(i, n) {
		if (d1[i] <= d2[i])a++;
		else b++;
	}
	puts(a > b ? "Fennec" : "Snuke");
}

Measured memory_bytes: 6784
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define T(a, b, c) make_pair(a, make_pair(b, c))
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;
//using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int a[501][501];
int main()
{
    int n, m, q;
    cin >> n >> m >> q;
    for(int i = 1; i <= m; i ++)
    {
        int l, r;
        cin >> l >> r;
        a[l][r] ++;
    }
    for(int i = 1; i <= n; i ++)
    for(int j = 1; j <= n; j ++)
    	a[i][j] += a[i][j - 1];
    for(int i = 1; i <= q; i ++)
    {
        int l, r;
        cin >> l >> r;
        int s = 0, mx = 0;
        for(int j = l; j <= r; j ++)
        {
        	s += a[j][r] - a[j][l - 1];
        }
//        deb(mx);
//        deb(s);?
        cout << s << '\n';
    }










    getchar();
    getchar();
    return 0;
    //ios::sync_with_stdio(false);
    //cin.tie(0);
}


Measured memory_bytes: 1920
// Aizu Vol0 0065: Trading
// 2017.7.29

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

char *gets(char *);
char buf[100], *p;

#define MAX 1000

int main()
{
	int i;
	int trade[MAX + 5], two[MAX + 5];

	for (i = 1; i <= MAX; i++) trade[i] = two[i] = 0;
	while (1) {
		gets(p = buf);
		while (isspace(*p)) p++;
		if (*p == 0) break;
		i = atoi(p);
		trade[i]++, two[i] = 1;
	}

	while (gets(buf) != NULL) {
		i = atoi(buf);
		if (two[i]) two[i] = 2, trade[i]++;
	}

	for (i = 1; i <= MAX; i++)
		if (two[i] == 2) printf("%d %d\n", i, trade[i]);

	return 0;
}

Measured memory_bytes: 532
#include <iostream>
#include <stack>
#include <string>
using namespace std;
int main(){
  stack<char> stack;
  string s;
  int len,i,flag;
  while(1){
    flag=0;
    getline(cin,s);
    if(s==".") break;
    len=s.size();
    for(i=0;i<len;i++){
      if(s[i]=='('||s[i]=='[') stack.push(s[i]);
      else if(s[i]==')'){
	if(stack.empty()!=true&&stack.top()=='('){
	  stack.pop();
	}
        else{
	  flag=1;
	  break;
	}
      }
      else if(s[i]==']'){
	if(stack.empty()!=true&&stack.top()=='['){
	  stack.pop();
	}
        else{
	  flag=1;
	  break;
	}
      }
    }
    if(flag==0&&stack.empty()==true){
      cout << "yes" << endl;
    }
    else{
      if(stack.empty()!=true){
	while(1){
	  stack.pop();
	  if(stack.empty()==true) break;
	}
      }
      cout << "no" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1176
n = int(input())
A = list(map(int, input().split(" ")))
B = list(map(int, input().split(" ")))
C = list(map(int, input().split(" ")))

r = 0
j = -1
for i in A:
  r += B[i-1]
  #print(B[i-1])
  if i - j == 1:
    r += C[i-2]
    #print(C[i-2])
  j = i
  
print(r)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(a == b)
  {
    if( b == c)
    {
      cout << "Yes";
    }
    else
      cout << "No";
  }
  else
    cout << "No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main () {
  string s;
  int sum;
  cin >> s;
  for (int i = 0; i < 3; i++) {
    if(s[i] == '1') {
      sum += 1;
    }
  }
  std::cout << sum << '\n';
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, M = map(int, input().split())
# 0段目からN段目まである
N += 1
broken_stairs = [int(input()) for _ in range(M)]

# dp[i] = i段目に辿り着くまでの経路本数
dp = [1 for _ in range(N)]

# 初期化する
for b in broken_stairs:
    dp[b] = 0

# MOD用
MOD = 10 ** 9 + 7

for i in range(2, N):
    """TLEだったやつ
    # 1段上が範囲内で使用可能なら現在の段の経路数を足す
    if i + 1 < N and i + 1 not in broken_stairs:
        # MODを取って更新
        dp[i + 1] += dp[i] % MOD
    # 2段上が範囲内で使用可能なら現在の段の経路数を足す
    if i + 2 < N and i + 2 not in broken_stairs:
        # MODを取って更新
        dp[i + 2] += dp[i] % MOD
    """
    # i段目が使用可能なら1段前と2段前の経路数を足した値を入れる
    if dp[i]:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD


print(dp[-1])


Measured memory_bytes: 7860
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {
  	int N;
  	cin >> N;
  	cout << setprecision(8) << (N - N / 2) * 1.0 / (N * 1.0) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)

void solve()
{
    int n;cin>>n;
    int a[n];REP(i,n)cin>>a[i];
    int xr=0;set<int>ava;
    REP(i,n)xr^=a[i],ava.insert(a[i]^(a[i]-1));
    int ans=0;
    for(int i=30;i>=0;i--){
        if(xr>>i&1){
            if(!ava.count((1<<i+1)-1)){cout<<-1<<endl;return;}
            xr^=(1<<i+1)-1;
            ans++;
        }
    }
    cout<<ans<<endl;
}

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

Measured memory_bytes: 4040
K=int(input())
ans=[0]*K
rem=7
for i in range(K):
    rem=rem%K
    if rem == 0:
        print(i+1)
        exit()
    else :
        if ans[rem]==1:
            print(-1)
            exit()
        else:ans[rem]=1
        rem=10*rem+7

Measured memory_bytes: 16628
#include <stdio.h>
#define MIN(x, y) ((x<=y) ? (x) : (y))

int main() {
  int N, ans = 0;
  scanf("%d", &N);
  int B[N+2];
  B[0] = B[N] = 100000;
  for (int i = 1; i <= N-1; ++i) {
    scanf("%d", &B[i]);
  }
  for (int i = 0; i < N; ++i) {
    ans += MIN(B[i], B[i+1]);
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

const int INF = 1e9;
const long long LINF = 1e18;

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

    for (int x = 0; x <= 2000; ++x) {
        for (int y = 0; y <= 2000; ++y) {
            int z = N - x - y;
            if (z < 0 || N < z) {
                continue;
            }

            if (10000 * x + 5000 * y + 1000 * z == Y) {
                cout << x << ' ' << y << ' ' << z << endl;
                return 0;
            }
        }
    }

    cout << -1 << ' ' << -1 << ' ' << -1 << endl;
    return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

typedef long long ll;

using namespace std;


void solve(long long N, long long A, long long B, long long C, long long D, long long E){
    vector<ll> ABCDE = {A, B, C, D, E};
    ll m = *min_element(ALL(ABCDE));
    ll ans = (N+m-1)/m+4;
    cout << ans << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long D;
    scanf("%lld",&D);
    long long E;
    scanf("%lld",&E);
    solve(N, A, B, C, D, E);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> A(n);
    bool ok = true;
    for(int i = 0; i < n; i++)
    {
        cin >> A[i];
        if(A[i] % 2 == 0)
        {
            if(A[i] % 3 == 0 or A[i] % 5 == 0) continue;
            ok = false;
        }
    }
    cout << (ok ? "APPROVED" : "DENIED") << endl;
    return 0;
}

Measured memory_bytes: 256
/*input

*/

#include<bits/stdc++.h>
using namespace std;
//#define int 					ll
#define ios	    				ios_base::sync_with_stdio(false); cin.tie(0)
#define hell 					1000000007
#define inf 					9e18

// Data Structures //
#define ull 					unsigned long long
#define ll 						long long
#define p_q 					priority_queue
#define pii         			pair<ll,ll>
#define vi          			vector<ll>
#define vii         			vector<pii>
#define mi          			map<ll,ll>
#define mii         			map<pii,ll>
// Functions //
#define pb 						push_back
#define ppb						pop_back
#define all(a)      			(a).begin(),(a).end()
#define gcd(a,b)    			__gcd((a),(b))
#define lcm(a,b)    			((a)*(b)) / gcd((a),(b))
#define mp 						make_pair
#define bs						binary_search
#define lb 						lower_bound
#define ub						upper_bound
#define F						first
#define S						second
#define take(a,n)				for(ll i=0;i<n;i++) cin>>a[i];
#define dbg(x) 					cout << #x << " = " << x << '\n'
#define endl					"\n"
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n"; std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());

#define N  1000005



void solve()
{
	ll n,k;
	cin>>n>>k;
	vi v(n);
	ll dp[n+1];
	memset(dp,hell,sizeof(dp));
	dp[0]=0;
	for(int i=0;i<n;i++) cin>>v[i];
	
	for(ll i=1;i<=n;i++)
	{
		for(ll j=1;j<=min(k,i);j++)
		{
			dp[i] = min(dp[i],abs(v[i]-v[i-j])+dp[i-j]);
			
		}
	}
	cout<<dp[n-1]<<endl;
	
}


signed main()
{
	ios;
	ll n,tests=1,prev=0,i=0;

	//cin>>tests;
	while(tests--)
	{
		solve();
	}
	time
	return 0;
}

Measured memory_bytes: 4724
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<utility>

using namespace std;
typedef long long ll;
int gcd(int a, int b) {
	if (b == 0) {
		return a;			
	}
	return gcd(b, a % b);
}
int main(){
ll n;
  cin>>n;
  string w[n];
  for(ll i=0;i<n;i++){
  cin>>w[i];
  }
  int flag=1;
  for(ll i=1;i<n;i++){
    string a=w[i];
    string b=w[i-1];
    if(a[0]!=b[b.size()-1]){
    flag=0;
      break;
    }
  }
  sort(w,w+n);
  for(ll i=1;i<n;i++){
        string a=w[i];
    string b=w[i-1];
  if(a==b){
  flag=0;
    break;
  }
  }
  if(flag==0)
    cout<<"No";
  else
    cout<<"Yes";
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,k,ans=1;
int main()
{
     cin>>n>>k;
     for(int i=1;i<=n;i++)
    {
        if(ans>k)ans+=k;
        else ans+=ans;;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int f(int x)
{
    int res = 0;
    while (x > 0)
    {
        x = x % __builtin_popcount(x);
        res++;
    }
    return res;
}

void solve(int N, string X)
{
    int pcX = 0;
    for (int i = 0; i < N; i++)
    {
        if (X.at(i) == '1')
            pcX++;
    }
    vector<int> pow2p(N);
    int tp = 1;
    int xp = 0;
    for (int i = 0; i < N; i++)
    {
        pow2p.at(N - 1 - i) = tp;
        tp = (tp << 1) % (pcX + 1);
        xp = (xp << 1) % (pcX + 1);
        xp = (xp + (X.at(i) - '0')) % (pcX + 1);
    }
    vector<int> pow2n(N);
    int tn = 1;
    int xn = 0;
    if (pcX > 1)
    {
        for (int i = 0; i < N; i++)
        {
            pow2n.at(N - 1 - i) = tn;
            tn = (tn << 1) % (pcX - 1);
            xn = (xn << 1) % (pcX - 1);
            xn = (xn + (X.at(i) - '0')) % (pcX - 1);
        }
    }

    for (int i = 0; i < N; i++)
    {
        int x;
        if (X.at(i) == '0')
        {
            x = (xp + pow2p.at(i)) % (pcX + 1);
        }
        else
        {
            if (pcX > 1)
            {
                x = ((pcX - 1) + xn - pow2n.at(i)) % (pcX - 1);
            }
            else
            {
                cout << 0 << endl;
                continue;
            }
        }
        cout << f(x) + 1 << endl;
    }
}

int main()
{
    int N;
    cin >> N;
    string X;
    cin >> X;
    solve(N, X);
    return 0;
}


Measured memory_bytes: 5252
let n = Scanf.scanf " %d" @@ (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0
let bits = ref 0
let r = ref 0
let ans = ref 0
let _ =
  for l = 0 to n - 1 do
    while !r < n && !bits land a_s.(!r) = 0 do bits := !bits + a_s.(!r); incr r done;
    if l = !r then incr r
    else (ans := !ans + !r - l; bits := !bits - a_s.(l)) done;
  Printf.printf "%d\n" !ans

Measured memory_bytes: 6144
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::collections::HashMap;
use std::cmp::{max,min};
fn main(){
    input!{
        n:usize,
        mut hn:[i64;n],
    }
    for i in (0..n-1).rev() {
        if hn[i] > hn[i + 1] {
            hn[i] -= 1;
        }
        if hn[i] > hn[i + 1] {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


fn is_prime(x:i64) -> bool {
    if x == 2 {return true;}
    if x < 2 || x % 2 == 0 {return false;}
    let mut j = 3;
    while j <= (x as f64).sqrt() as i64 {
        if x % j == 0 {
            return false;
        }
        j += 2;
    }
    true
}


Measured memory_bytes: 4352
/*
    Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
using namespace std;

#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define LOG_MAX 20
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
#define MSV(A,a) memset(A, a, sizeof(A))
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define finish(x) {cout<<x<<'\n'; return;}
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';

void solve() {
	int n;
	in(n);
	n = 1000 - (n%1000);
	if(n == 1000) n = 0;
	cout<<n<<en;
}

int main() {
	int t = 1;
	
	//~cin>>t;
	while(t--) {
		solve();
	}
    return 0;
}


Measured memory_bytes: 3764
#include<cstdio>
#include<iostream>
#include<algorithm>
#include <stdlib.h>
#include <vector>
using namespace std;


int main(){
    int n,tmp;
    cin >> n;
    vector<int> a;


    for(int i = 0;i < n;i++){
        cin >> tmp;
        a.push_back(tmp);
    }

    sort(a.begin(), a.end());
    for(int i = 0;i < n-1;i++){
        if(a[i] == a[i+1]){
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";
    
    return 0;
}

Measured memory_bytes: 1400
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;
int main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  string c;
  cin>>c;
  if(c[0]=='a' || c[0]=='e' ||c[0]=='i' || c[0]=='o' || c[0]=='u' ){
    cout<<"vowel"<<"\n";
  }
  else{
    cout<<"consonant"<<"\n";
  }
  
  return 0;
}

Measured memory_bytes: 3632
#include<cstdio>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#include<fstream>

#define rep(i,a,N) for(int i=0+a;i<N;i++)
#define lint long long int
#define SIZE 100005
#define pb push_back
#define MP make_pair

using namespace std;

int main(){
	lint i,o,t,j,l,s,z,ans=0,ii=0,jj=0,ll=0,ans2=0;
	cin>>i>>o>>t>>j>>l>>s>>z;
	if(i%2==1){i--;ii++;}
	if(j%2==1){j--;jj++;}
	if(l%2==1){l--;ll++;}
	ans=i+o+j+l;
	if(ii==1&&jj==1&&ll==1)ans+=3;
	if(i>0&&j>0&&l>0){
		if(ii==0)i-=2;
		if(jj==0)j-=2;
		if(ll==0)l-=2;
		ans2=i+o+j+l+3;
	}
	ans=max(ans,ans2);

	cout<<ans;
return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int a = sc.nextInt();
   String b = sc.next();
   int c = sc.nextInt();
 
   if(b.equals("+"))System.out.println(a+c);
   else System.out.println(a-c);
 }
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
#define li          long
#define ll          long long
#define ull         unsigned long long
#define ff          first
#define ss          second
#define pii         pair<int,int>
#define pli         pair<li,li>
#define pll         pair<ll,ll>
#define pb          push_back
#define fo(i,k,n)   for(int i = k;i<n; i++)
#define ro(i,k,n)   for(int i = k; i>=n; i--)
#define tc          int t;cin>>t;while(t--)
#define all(v)      v.begin(),v.end()
#define inf         INT_MAX
#define ninf        INT_MIN
#define v(x)        vector<x>
#define int         long long
#define ar(x,y)     array<x,y>
#define p(x,y)      pair<x,y>
const ll mod1 = 99844353;
const ll mod2 = 1e9+7;
/* template <class T>
using oset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; */

template<typename T>
T gcd(T a,T b){
    return b ? gcd(b, a%b) : a;
}

void fastio()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

int power(int x,int y){
    int res = 1;
    while(y > 0){
         if(y & 1) res *= x;
         y >>= 1;
         x *= x;
    }
    return res;
}

int power(int x,int y,int mod){
     int res = 1;
     x %= mod;
     while(y > 0){
          if(y & 1) res = (res * x) % mod;
          y >>= 1;
          x = (x * x) % mod;
     }
     return res;
}

class Template {
    int* readArray(int n){
        int *res = new int[n];
        for(int i = 0; i<n; i++){
            cin >> res[i];
        }
        return res;
    }
    void destroy(int *x){
        delete[] x;
    }
    v(int) readVector(int n){
        v(int) res(n);
        for(int i = 0; i<n; i++){
            cin >> res[i];
        }
        return res;
    }
    public:
    void solveOne(istream &in, ostream &out) {
        int n;
        in >> n;
        int ans = 0;
        v(int)fact(n+1,1);
        fo(i,2,n+1){
            for(int j = i; j<=n; j+=i)fact[j]++;
        }
        for(int i = 1; i<n; i++)ans += fact[i];
        out << ans << "\n";
    }
    
    void solve(istream &in, ostream &out) {
        int nt = 1;
       // in >> nt;
        for (int it = 0; it < nt; ++it) {
            solveOne(in, out);
        }
    }
};
 
signed main() {
  fastio();
  Template solver;
  istream& in(cin);
  ostream& out(cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 11020
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;

int main(){
  string s;
  cin >> s;
  ll K;
  cin >> K;

  set<string> subs;

  rep(i, s.size()){
    ll max_len = min((ll)5, (ll)(s.size() - i));

    rep2(j, 1, max_len + 1) subs.insert(s.substr(i, j));
  }

  auto it = subs.begin();
  rep(i, K - 1) it++;

  cout << (*it) << endl;
  
  return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;

int main() {
    string ABCD;
    cin >> ABCD;
    int a, b, c, d;
    a = (int)ABCD.at(0) - 48;
    b = (int)ABCD.at(1) - 48;
    c = (int)ABCD.at(2) - 48;
    d = (int)ABCD.at(3) - 48;
    int n = 3;
    vector<int> answerCal(3);
    for (int bit = 0; bit < (1 << n); bit++) {
        int total = 0;
        vector<int> cal(3);
        if (bit & 1) {
            cal.at(0) = 1;
            total += a + b;
        } else {
            total += a - b;
        }
        // cout << total << endl;
        if (bit & 2) {
            cal.at(1) = 1;
            total += c;
        } else {
            total -= c;
        }
        // cout << total << endl;
        if (bit & 4) {
            cal.at(2) = 1;
            total += d;
        } else {
            total -= d;
        }
        // cout << total << endl;
        if (total == 7) {
            answerCal = cal;
            break;
        }
    }
    string answer = "";
    answer += to_string(a);
    answerCal.at(0) == 1 ? answer += "+" : answer += "-";
    answer += to_string(b);
    answerCal.at(1) == 1 ? answer += "+" : answer += "-";
    answer += to_string(c);
    answerCal.at(2) == 1 ? answer += "+" : answer += "-";
    answer += to_string(d);
    answer += "=7";

    cout << answer << endl; 
    return 0;
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int a, b, c; cin >> a >> b >> c;
	int ans = inf;
	rep(i, 51){
		auto f = [&](int x){
			if(i <= x) return x - i;
			return (i - x) / 2 + (i - x & 1 ? 2 : 0);
		};
		int s = f(a) + f(b) + f(c);
		ans = min(ans, s);
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> v1;
typedef vector<vector<ll>> graph;

const ll INF = 1ll << 50;

ll m1,d1;
ll m2,d2;

int main(){
    cin >> m1 >> d1;
    cin >> m2 >> d2;
    if(m1 < m2){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

static int intsort(const void *x, const void *y)
{
  if (*(int *)x < *(int *)y)
    return -1;
  else if (*(int *)x == *(int *)y)
    return 0;
  else
    return 1;
}

int main(void)
{
  int n;
  int d[100000];
  
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%d", &d[i]);
  
  qsort(d, n, sizeof(int), intsort);
  
  printf("%d\n", d[n/2] - d[n/2-1]);

  return 0;
}


Measured memory_bytes: 892
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <climits>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <bitset>
using namespace std;

int main() {
    int a, b;
    cin>>a>>b;
    cout<<(a+b)%24<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


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

  N %= 500;
  if(N<=A) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 256
def input_n
  gets.to_i               # 単一整数
end

def input_s
  gets.chomp              # 文字列。chompを付けないと改行文字がついてくる
end

def input_a
  gets.split.map(&:to_i)  # スペースで区切られた複数の整数
end

def input_o(num)
  num.times.map { gets.to_i }  # 縦に並んだ複数の整数。たまにある
end

def output_f(num)
  puts sprintf("%.12f", num)
end

n = input_n
a = input_a
q = input_n
count = Array.new(10 ** 5 + 1, 0)
sum = 0
a.each do |num|
  count[num] += 1
  sum += num
end

q.times do
  b, c = input_a
  if b > c
    # 置き換える前の数字のほうが大きかった場合
    cnt = count[b]
    sum -= cnt * b
    sum += cnt * c
    count[b] = 0
    count[c] += cnt
  else
    # 置き換えた後の
    cnt = count[b]
    sum -= cnt * b
    sum += cnt * c
    count[b] = 0
    count[c] += cnt
  end
  puts sum
end


Measured memory_bytes: 22020
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin>>n;
  int64_t ans=0;
  
  for(int i=1; i<=n; i++){
    if(i<10){
      if(i<=n) ans++;
      if(11*i<=n) ans=ans+2;
      if(101*i<=n){
        for(int j=0; 101*i+10*j<=n && j<10; j++) ans=ans+2;
      }
      if(1001*i<=n){
        for(int j=0; 1001*i+10*j<=n && j<100; j++) ans=ans+2;
      }
      if(10001*i<=n){
        for(int j=0; 10001*i+10*j<=n && j<1000; j++) ans=ans+2;
      }
      if(100001*i<=n){
        for(int j=0; 100001*i+10*j<=n && j<10000; j++) ans=ans+2;
      }
    }
    
    else{
      int x,y;
      if(i%10==0) continue;
      else x=i%10;
      for(int k=i; k>0; k/=10) y=k;
      
      if(x*10+y<=n) ans++;
      if(x*100+y<=n){
        for(int j=0; x*100+y+10*j<=n && j<10; j++) ans++;
      }
      if(x*1000+y<=n){
        for(int j=0; x*1000+y+10*j<=n && j<100; j++) ans++;
      }
      if(x*10000+y<=n){
        for(int j=0; x*10000+y+10*j<=n && j<1000; j++) ans++;
      }
      if(x*100000+y<=n){
        for(int j=0; x*100000+y+10*j<=n && j<10000; j++) ans++;
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

#define REP(i,n) for (int i=0;i<(n);++i)
#define MOD 1000000007

using namespace std;

using ll = long long;

template <class T, T M>
class modulo {
public:
    T data;

    modulo(T data = 0) : data(data % M) {
    }

    modulo operator+(const modulo &x) const {
        return modulo(data + x.data);
    }

    modulo operator-(const modulo &x) const {
        return modulo(data + (M - x.data));
    }

    modulo operator*(const modulo &x) const {
        return modulo(data * x.data);
    }

    modulo operator/(const modulo &x) const {
        return modulo(data * x.inv().data);
    }

    modulo operator+=(const modulo &x) {
        return data = (data + x.data) % M;
    }

    modulo operator-=(const modulo &x) {
        return data = (data + (M - x.data)) % M;
    }

    modulo operator*=(const modulo &x) {
        return data = (data * x.data) % M;
    }

    modulo operator/=(const modulo &x) {
        return data = (data * x.inv().data) % M;
    }

    modulo inv() const {
        return _pow(M - 2);
    }

    template <class Integer>
    modulo operator^(Integer n) const {
        if (n >= 0) {
            return _pow(n);
        } else {
            return _pow(M - 1 - (-n) % (M - 1));
        }
    }

    friend std::ostream& operator<<(std::ostream &os, const modulo &x) {
        os << x.data;
        return os;
    }

private:
    template <class NonNegativeInteger>
    modulo _pow(NonNegativeInteger n) const {
        modulo result(1);
        modulo x(*this);
        while (n) {
            if (n & 1) {
                result *= x;
            }
            x *= x;
            n >>= 1;
        }
        return result;
    }
};

template <class T, T M>
struct combinatorics {

    using Mod = modulo<T, M>;

    T N;
    std::vector<Mod> factorial;
    std::vector<Mod> inv_factorial;

    combinatorics(T N) : N(N), factorial(N + 1), inv_factorial(N + 1) {
        factorial[0] = 1;
        for (T i = 1; i <= N; ++i) {
            factorial[i] = factorial[i - 1] * i;
        }
        inv_factorial[N] = factorial[N].inv();
        for (T i = N; i >= 1; --i) {
            inv_factorial[i - 1] = inv_factorial[i] * i;
        }
    }

    Mod P(T n, T k) {
        if (0 <= k && k <= n) {
            return factorial[n] * inv_factorial[k];
        } else {
            return 0;
        }
    }

    Mod C(T n, T k) {
        if (0 <= k && k <= n) {
            return factorial[n] * inv_factorial[k] * inv_factorial[n - k];
        } else {
            return 0;
        }
    }

    Mod H(T n, T k) {
        if (n == 0 && k == 0) {
            return 1;
        } else {
            return C(n + k - 1, k);
        }
    }
};

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);

    using Mod = modulo<ll, MOD>;

    int K;
    string S;
    cin >> K >> S;

    int N = S.size();

    combinatorics<ll, MOD> C(N + K + 1);

    Mod result = 0;
    REP(i, N + K) {
        result += C.C(i, N - 1) * (Mod(25) ^ (K - (N + K - i - 1))) * (Mod(26) ^ ((N + K - i - 1)));
    }

    cout << result << endl;

    return 0;
}


Measured memory_bytes: 35672
n, m = map(int, input().split())
li_in = list()
s = ['x'] * n
for i in range(m):
    li_in.append(list(map(int, input().split())))

for l in li_in:
    idx = l[0]
    val = str(l[1])
    target_idx = idx - 1
    if s[target_idx] == 'x':
        s[target_idx] = val
    elif s[target_idx] == val:
        pass
    else:
        print(-1)
        exit(0)
if n > 1:
    if s[0] == '0':
        print(-1)
        exit(0)
    elif s[0] == 'x':
        s[0] = '1'

print(int(''.join(s).replace('x', '0')))




Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
}

int ans = 0;
bool check = 0;
string s, t;
int N = 3;
vector<int> v(N);
int a, b;
int x, y;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  cin >> a;
  pr(a * 2 * 3.14);
}

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

const int My_Inf = 2147483647;
const long long int My_LInf = 9223372036854775807;

int main() {
	int N, M; cin >> N >> M;
	vector<pair<long long int, long long int>>itos;
	for (int i = 0; i < N; ++i) {
		long long int s, t; cin >> s >> t;
		itos.push_back(make_pair(s, t));
	}
	vector<long long int >ps;
	for (int i = 0; i < M; ++i) {
		int p; cin >> p;
		ps.push_back(p);
	}
	sort(ps.begin(), ps.end());
	vector<long long int>sum;
	long long int from = 0;
	sum.push_back(0);
	for (int i = 0; i < ps.size(); ++i) {
		long long int len = ps[i] - from;
		sum.push_back(from - sum[i] + len);
		from = ps[i];
	}
	long long int ans = 0;
	for (int i = 0; i < N; ++i) {
		const int sid = lower_bound(ps.begin(), ps.end(), itos[i].first) - ps.begin();
		const int fid = lower_bound(ps.begin(), ps.end(), itos[i].second) - ps.begin();
		if (sid == fid) {
			ans += abs(itos[i].first - itos[i].second);
		}
		else if (sid > fid) {
			if ((sid - fid) % 2) {
				const long long int plus = (ps[sid-1 ] - ps[fid]) - (sum[sid] - sum[fid+1]) + (itos[i].first - ps[sid-1]);
				ans += plus;
			}
			else {
				const long long int plus = (ps[sid-1] - ps[fid + 1]) - (sum[sid] - sum[fid + 2]) + (itos[i].first - ps[sid-1]) + (ps[fid] - itos[i].second);
				ans += plus;
			}
		}
		else {
			assert(sid < fid);
			if ((fid - sid) % 2) {
				const long long int plus =  ((sum[fid] - sum[sid+1]) + (ps[sid]-itos[i].first));
				ans += plus;
			}
			else {
				const long long int plus = (ps[fid-1] - ps[sid + 1]) - (sum[fid] - sum[sid + 2]) + (itos[i].second - ps[fid - 1]) + (ps[sid] - itos[i].first);
				ans += plus;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7088
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

int main(){
	int k, s;
	scanf("%d%d", &k, &s);
	int ans = 0;
	for(int i = 0; i <= k; i++) {
		for(int j = 0; j <= k; j++) {
			int z = s - i - j;
			if(z >= 0 && z <= k) ans++;
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long int
#define INF 0x3f3f3f3f
#define pb push_back
#define pii pair<int, int>

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, t = 100005;
    int a[t], b[t], c[t];
    int aa[t], bb[t], cc[t];
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i] >> c[i];
    }
    memset(aa, -INF, sizeof aa);
    memset(bb, -INF, sizeof bb);
    memset(cc, -INF, sizeof cc);
    aa[0] = a[0];
    bb[0] = b[0];
    cc[0] = c[0];
    for (int i = 1; i < n; i++) {
        aa[i] = max(bb[i - 1], cc[i - 1]) + a[i];
        bb[i] = max(aa[i - 1], cc[i - 1]) + b[i];
        cc[i] = max(aa[i - 1], bb[i - 1]) + c[i];
    }
    cout << max(aa[n - 1], max(bb[n - 1], cc[n - 1])) << "\n";
    
    //cerr << "\n" << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <cmath>

inline double calcDistance(double x, double y){
	return hypot(x, y);
}

int main(){
	int num;
	std::cin >> num;
	
	for(int i = 0; i < num; ++i){
		double xa, xb, ya, yb, ra, rb;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = calcDistance(xa - xb, ya - yb);
		
		int answer = 1;
		if(ra + rb < d){
			answer = 0;
		}
		else if(ra - rb > d){
			answer = 2;
		}
		else if(rb - ra > d){
			answer = -2;
		}
		std::cout << answer << std::endl;
	}
}

Measured memory_bytes: 1244
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

struct edge{int to,cap,rev;};

const int INF = 1000000000;

vector<edge> G[100];
bool used[100];

void add_edge(int from,int to,int cap){
	G[from].push_back((edge){to,cap,G[to].size()});
	G[to].push_back((edge){from,0,G[from].size()-1});
}

int dfs(int v,int t,int f){
	if(v==t) return f;
	used[v] = true;
	for(int i=0;i<G[v].size();i++){
		edge &e = G[v][i];
		if(!used[e.to]&&e.cap>0){
			int d = dfs(e.to,t,min(f,e.cap));
			if(d>0){
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

int main(){
	int V,E;
	int ans = 0;
	scanf("%d %d",&V,&E);
	for(int i=0;i<E;i++){
		int s,t,c;
		scanf("%d %d %d",&s,&t,&c);
		add_edge(s,t,c);
	}
	while(true){
		fill(used,used+V,false);
		int f = dfs(0,V-1,INF);
		if(f==0) break;
		else ans += f;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2844
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_N 100000

int par[MAX_N]; // 親
int depth[MAX_N]; // 木の深さ
ll N, M;

// n要素で初期化
void init(int n) {
	rep(i, 0, n) {
		par[i] = -1;
	}
}

// 木の根を求める
int find(int x) {
    if(par[x] < 0) return x;
    else return par[x] = find(par[x]);
}

// xとyの属する集合を併合
void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if(x == y) return;

    if(par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;
}

int size(int x) {
    return -par[find(x)];
}

// xとyが同じ集合に属するか否か
bool same(int x, int y) {
	return find(x) == find(y);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    cin >> N >> M;
    init(N);
    vector<pair<int, int> > vp;
    rep(i, 0, M) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        vp.push_back(make_pair(a, b));
    }

    reverse(vp.begin(), vp.end());
    vector<ll> rsl;
    ll cur = N * (N - 1) / 2;

    rep(i, 0, M) {
        rsl.push_back(cur);
        int a = vp[i].first, b = vp[i].second;
        if(same(a, b)) continue;

        ll sa = size(a), sb = size(b);
        cur -= sa * sb;
        unite(a, b);
    }

    reverse(rsl.begin(), rsl.end());
    rep(i, 0, M) cout << rsl[i] << endl;
}


Measured memory_bytes: 3444