akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
long long int int_sort(const void * a, const void * b)
{
    if(*(long long int*)a<*(long long int*)b)
    {
        return -1;
    }
    else if(*(long long int*)a==*(long long int*)b)
    {
        return 0;
    }
    return 1;
}

int main(void)
{
    int n;
    scanf("%d",&n);
    long long int a[100000]={};
    for(int p=0;p<n;p++)
      scanf("%lld",&a[p]);
    qsort(a,n,sizeof(a[1]),int_sort);
    int po=0;
    int count=1;
    int ans=0;
    while(po<n)
    {
        if(a[po]==a[po+1])
        {
            po++;
            count++;
        }
        if(count%2==1)
          ans++;
        po++;
        count=1;
    }
    printf("%d",ans);
}

Measured memory_bytes: 1788
#include<iostream>
using namespace std;
int main(int argc, char const *argv[]) {
  char a,b;
  cin>>a>>b;
  if((a=='H'&&b=='H')||(a=='D'&&b=='D')){
    cout<<"H"<<endl;
  }else{
    cout<<"D"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<string.h>

#define RtD(radian) ((radian)*(180.0f/M_PI))
#define DtR(degrees) ((degrees)*(M_PI/180.0f))

void moveXY( double *x, double *y, double mx, double my, double si, double co )
{
    double xy[3][1] = { {*x},
                        {*y},
                        {1}, };
    double r[3][3] = { { co, -si, 0 },
                    { si, co, 0 },
                    { 0, 0, 1 } };
    double m[3][3] = { { 1, 0, mx },
                    { 0, 1, my },
                    { 0, 0, 1 } };    
    int i,j,k;
    double a[3][3] = { {0} };
    for( i=0; i<3; i++ ) {
        for( j=0; j<3; j++ ) {
            for( k=0; k<3; k++ ) {
                a[i][j] += m[i][k]*r[k][j];
            }
        }
    }

    double b[3][1] = { {0} };          
    for( i=0; i<3; i++ ) {
        for( j=0; j<3; j++ ) {
            b[i][0] += a[i][j]*xy[j][0];
        }
    }

    *x = b[0][0];
    *y = b[1][0];
    return;
}

void kochCurve( int n, double px, double py, double px2, double py2 )
{

    double sx, sy;
    double ux, uy;
    double tx, ty;
    double d = sqrt( pow( px2-px, 2 ) + pow( py2-py, 2 ) );
    
    sx = d/3;
    ux = d/2;
    tx = sx*2;
    sy = ty = 0;
    uy = sin( DtR(60) )*sx;
    
    double si=0;
    double co=0;
    char str[50];
    char str2[50];
    sprintf( str, "%.8f", py );
    sprintf( str2, "%.8f", py2 );
    if( px < px2 ) {
        if( 0 == strcmp( str, str2 ) ) {
            si = sin( DtR(0) );
            co = cos( DtR(0) );            
        } else if( py < py2 ) {
            si = sin( DtR(60) );
            co = cos( DtR(60) );            
        } else if( py2 < py ) {
            si = sin( DtR(-60) );
            co = cos( DtR(-60) );
        }
    } else if( px2 < px ) {
        if( 0 == strcmp( str, str2 ) ) {
            si = sin( DtR(-180) );
            co = cos( DtR(-180) );                 
        } else if( py2 < py ) {
            si = sin( DtR(-120) );
            co = cos( DtR(-120) );
        } else if( py < py2 ) {
            si = sin( DtR(-240) );
            co = cos( DtR(-240) );            
        }
    }

    moveXY( &sx, &sy, px, py, si, co );
    if( 1 < n ) {
        kochCurve( n-1, px, py, sx, sy );
    }
    printf( "%.8f %.8f\n", sx, sy );

    moveXY( &ux, &uy, px, py, si, co );
    if( 1 < n ) {
        kochCurve( n-1, sx, sy, ux, uy );
    }
    printf( "%.8f %.8f\n", ux, uy );

    moveXY( &tx, &ty, px, py, si, co );
    if( 1 < n ) {
        kochCurve( n-1, ux, uy, tx, ty );
    }
    printf( "%.8f %.8f\n", tx, ty );

    if( 1 < n ) {
        kochCurve( n-1, tx, ty, px2, py2 );
    }

	return;
}

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

    printf( "%.8f %.8f\n", 0.0, 0.0 );
    if( 1 <= n ) {
	   kochCurve( n, 0, 0, 100.0, 0.0 );
    }
    printf( "%.8f %.8f\n", 100.0, 0.0 );

	return 0;
}

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

// const long long int MOD = 1000000007;
const int MOD = 1000000007;


int main() {
    int N,M;
    cin >> N >> M;
    vector<vector<int>> s(M, vector<int>(0));
    vector<int> k(M), p(M);
    for (int i = 0; i < M; i++) {
        cin >> k[i];
        vector<int> empty(k[i]);
        s[i]=(empty);
        for (int j = 0; j < k[i]; j++) {
            cin >> s[i][j];
            s[i][j]--;
        }
    }
    for (int i = 0; i < M; i++) {
        cin >> p[i];
    }
    int ans = 0;
    for (int tmp = 0; tmp < (1 << N); tmp++) {
        bitset<10> b(tmp);
        int a = 1;
        for (int i = 0; i < M; i++) {
            int judge = 0;
            for (int j = 0; j < k[i]; j++) {
                if (b.test(s[i][j])) {
                    judge++;
                }
            }
            if (judge%2 != p[i]) {
                a *= 0;
            }
        }
        if (a == 1) {
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3572
#解説解法
n = int(input())
xp = []
xm = []
yp = []
ym = []
for _ in range(n):
  x,y = map(int,input().split())
  if x == 0:
    if y == 0:
      n -= 1
    elif y > 0:
      yp.append([0,x,y])
    else:
      ym.append([0,x,y])
  elif x > 0:
    xp.append([y/x,x,y])
  else:
    xm.append([y/x,x,y])
xp.sort()
xm.sort()
xy = xp + yp + xm + ym
can = []
for i in range(-n,0):
  for j in range(i+1,i+n+1):
    X = 0
    Y = 0
    for k in range(i,j):
      x,y = xy[k][1],xy[k][2]
      X += x
      Y += y
    can.append(X**2+Y**2)
if n == 0:
  print(0)
else:
  print(max(can)**.5)

Measured memory_bytes: 3444
N=int(input())
A=[]
A=input().split()
A=[int(u) for u in A]
for i in range (0,N):
    v=A[i]
    j=i-1
    while j>=0 and A[j]>v:
        A[j+1]=A[j]
        j=j-1
        A[j+1]=v
    for u in range(0,N-1):
        print(A[u],end=" ")
    print(A[N-1])


Measured memory_bytes: 5976
#https://atcoder.jp/contests/abc104/tasks/abc104_c

d,g=map(int,input().split())
l=[]
for i in range(d):
    l.append(list(map(int,input().split())))

set_all=set()
for i in range(d):
    set_all.add(i)


count=1001
for i in range(2**d):
    score=0
    count_buf=0
    set1=set()
    for j in range(d):
        if (i>>j)&1:
            score+=100*(j+1)*l[j][0]+l[j][1]
            count_buf+=l[j][0]
            set1.add(j)
    if score>=g:
        count=min(count,count_buf)
    else:
        set2=set_all-set1
        list_set2=list(set2)
        if len(list_set2)>0:
            list_set2.sort(reverse=True)
            for k in range(l[list_set2[0]][0]):
                score+=100*(list_set2[0]+1)
                count_buf+=1
                if score>=g:
                    count=min(count,count_buf)
                    break
    #print(score)
print(count)

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


int main(){
  int h,w;
  cin >> h >> w;
  while (true){
    
    if (h == 0 && w == 0) break;

    //1行目出力
    for (int j = 0; j < w;j++) cout << '#';
    cout << endl;
    //1行目から最後の行の一個前まで出力
    for (int i = 1; i < h -1;i++){
      cout << '#';
      for (int j = 1; j < w - 1; j++) cout << '.';
      cout << '#';
      cout << endl;
    }

    
    //最後の行を出力
    if (h > 1){
      for (int i = 0; i < w; i++)
        cout << '#';
    }
    cout << endl;
    cout << endl;
    cin >> h >> w;
  }
}


Measured memory_bytes: 3060
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef long long ll;
typedef int keytype;

int gcd(int a, int b){ return (a % b) ? gcd(b, a % b) : b;}
int lcm(int a, int b){ return (a / gcd(a, b)) * b;}

/* a[0], ..., a[n-1] の数の最大公約数 */
int ngcd(int n, int a[])
{
    int i, d;

    d = a[0];
    for (i = 1; i < n && d != 1; i++)
        d = gcd(a[i], d);
    return d;
}

void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int is_prime(int x){
    if(x <= 1) return 0;
    for(int i = 2; i * i <= x; i++){
        if(x % i == 0) return 0;
    }
    return 1;
}

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }
    return flag;
}

// factor list, number of factors, natural number
void factorize(int ftr[], int *num, int n){
    int a = 2, cnt = 0;

    while(n >= a){
        if(n % a == 0){
            n = n / a;
            ftr[cnt++] = a;
        }else{
            a++;
        }
    }
    *num = cnt;
}

//#define N 5
//int p[N + 1];
// list, end_index
int nextperm(int p[], int end)  /* 辞書式順序で次の順列 */
{
    int i, j, t;

    i = end - 1;
    p[0] = 0;  /* 番人 */
    while (p[i] >= p[i + 1]) i--;
    if (i == 0) return 0;  /* 完了 */
    j = end;
    while (p[i] >= p[j]) j--;
    t = p[i];  p[i] = p[j];  p[j] = t;
    i++;  j = end;
    while (i < j) {
        t = p[i];  p[i] = p[j];  p[j] = t;  i++;  j--;
    }
    return 1;  /* 未了 */
}

void comb(int size1, int size2, int v[size1][size2]){
  for(int i = 0; i < size1; i++){
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for(int k = 1; k < size1; k++){
    for(int j = 1; j < k; j++){
      v[k][j] = (v[k-1][j-1] + v[k-1][j]);
    }
  }
}

int abs_val(int a, int b){
    if(a > b) return a - b;
    else return b - a;
}

const int inf = 1012345678;
int main(){
    ll a, b;

    scanf("%lld %lld", &a, &b);

    if((a * b) <= 0){
        puts("Zero");
    }else if(a > 0 && b> 0){
        puts("Positive");
    }else if((b - a + 1) % 2 == 1){
        puts("Negative");
    }else{
        puts("Positive");
    }

    return 0;
}


Measured memory_bytes: 1616
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const int MAX = 510000;

int main() {
  string S;
  cin >> S;
  vector<int> memo(S.size());
  if (S[0]=='B') memo[0] = 1;
  else memo[0] = 0;
  for (int i=1; i<S.size(); i++) {
    // S[0]~S[i]にある黒いマスの個数
    if (S[i]=='B') memo[i] = memo[i-1]+1;
    else memo[i] = memo[i-1];
  }
  ll ans = 0;
  for (int i=0; i<S.size(); i++) {
    if (S[i]=='W') ans += memo[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 1412
N, D = map(int, input().split())
X = [0] * N
Y = [0] * N
num = 0
for i in range(N):
    X[i], Y[i] = map(int, input().split())
    
    if (X[i]**2+Y[i]**2)**0.5 <= D:
        num += 1

print(num)

Measured memory_bytes: 73512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
#include <deque>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){
    int n;
    cin >> n;
    deque<int> dq;
    int tmp;
    REP(i,n){
        cin >> tmp;
        if(i%2){
            dq.push_back(tmp);
        }else{
            dq.push_front(tmp);
        }
    }
    if(n%2){
        REP(i,n-1){
            cout << dq.front() << " ";
            dq.pop_front();
        }

        cout << dq.front() << endl;
    }else{
        REP(i,n-1){
            cout << dq.back() << " ";
            dq.pop_back();
        }

        cout << dq.back() << endl;
        
    }

    return 0;
}


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

int main(void) {
	int n, step[100001], min_step;
	
	cin >> n;
	
	for (int i = 0; i <= n; i++) {
		min_step = i;
		for (int j = 1; pow(6, j) <= i; j++)
			min_step = min(step[i - (int)pow(6, j)] + 1, min_step);
		for (int j = 1; pow(9, j) <= i; j++)
			min_step = min(step[i - (int)pow(9, j)] + 1, min_step);
		step[i] = min_step;
	}
	
	cout << step[n] << endl;
	
	return 0;
}

Measured memory_bytes: 640
n = int(input())
a,b, = map(int,input().split())
p = list(map(int,input().split()))
cnt = [0]*3
for i in range(n):
    if p[i] <= a:
        cnt[0] += 1
    elif p[i] <= b:
        cnt[1] += 1
    else:
        cnt[2] += 1
print(min(cnt))

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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	string s;
	t = 1;
	while(t--) {
	 cin >> s;
	 if((s[0] == s[1] && s[1] == s[2]) || (s[1] == s[2] && s[2] == s[3]))
	  cout << "Yes" << endl;
	 else
	  cout << "No" << endl;
	}
	return 0;
}



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

class Contest{
public:
    Contest(){
        last=0;
    }
    int s[366];
    int c;
    int last;
};

int main(){
    int d;
    cin>>d;
    Contest contest[27];
    for(int i=1;i<=26;++i){
        int t;
        cin>>t;
        contest[i].c=t;
    }
    for(int day=1;day<=d;++day){
        for(int type=1;type<=26;++type){
            int t;
            cin>>t;
            contest[type].s[day]=t;
        }
    }
    
    int v[365];
    v[0]=0;
    for(int day=1;day<=d;++day){
        v[day]=0;
        int type;
        cin>>type;
        v[day]+=contest[type].s[day];
        contest[type].last=day;
        for(int t=1;t<=26;++t){
            v[day]-=contest[t].c*(day-contest[t].last);
        }
        v[day]+=v[day-1];
    }

    for(int i=1;i<=d;++i) cout<<v[i]<<endl;
}

Measured memory_bytes: 3604
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <vector>

using namespace std;

#define int long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(), (x).end()
#define capi(x) int x;cin>>x

#define P (1'000'000'007)

inline int fast_pow(int x, int n, int mod) {
    long long signed res = 1;
    long long accumulation = x;
    for (int i = 0; n >> i > 0; ++ i) {
        if ((n >> i) % 2) {
            res *= accumulation;
            res %= mod;
        }
        accumulation *= accumulation;
        accumulation %= mod;
    }

    return res;
}

inline int fast_comb(int n, int r, int mod) {
    long long a = 1;
    long long b = 1;
    for (int i = 0; i < r; ++i) {
        a = a * (n - i) % mod;
        b = b * (i + 1) % mod;
    }

    b = fast_pow(b, mod - 2, mod);
    return a * b % mod;
}

template<int MOD=P>
struct Mod {
public:
    long long signed value;

    Mod(long long signed val): value(val % MOD) {
        if (value < 0) value += MOD;
    }

    constexpr Mod& operator+=(const Mod& other) noexcept { 
        value += other.value;
        value %= MOD;
        return *this;
    }
    constexpr Mod& operator-=(const Mod& other) noexcept {
        value -= other.value;
        if (value < 0) value += MOD;
        return *this;
    }
    constexpr Mod& operator*=(const Mod& other) noexcept {
        value *= other.value;
        value %= MOD;
        return *this;
    }

    constexpr Mod operator-() noexcept {
         return value == 0 ? 0 : MOD - value;
    }

    constexpr Mod operator+(const Mod& other) const noexcept { return Mod(*this) += other; }
    constexpr Mod operator-(const Mod& other) const noexcept { return Mod(*this) -= other; }
    constexpr Mod operator*(const Mod& other) const noexcept { return Mod(*this) *= other; }
    constexpr bool operator==(const Mod& other) const noexcept { return this->value == other.value; }
    constexpr bool operator!=(const Mod& other) const noexcept { return this->value != other.value; }
};

signed main() {
    int n, a, b;
    cin >> n >> a >> b;

    auto ans = Mod(fast_pow(2, n, P) - 1);
    ans -= fast_comb(n, a, P);
    ans -= fast_comb(n, b, P);
    cout << ans.value;

    return 0;
}

Measured memory_bytes: 3052
#include <algorithm>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int N;
  while (cin >> N) {
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
      cin >> A[i];
    }
    int sum = accumulate(A.begin(), A.end(), 0);
    bitset<4000010> dp;
    dp.set(0);
    for (int x : A) {
      dp |= dp << x;
    }
    int ans;
    for (int x = (sum + 1) / 2; x <= sum; x++) {
      if (dp[x]) {
        ans = x;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 1664
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
using namespace std;
int H,R,U,M,S;
double hx[100],hy[100],dU,dM,dS,ux[100],uy[100],mx[100],my[100],sx[100],sy[100],W[100],A[100];
bool f(double x,double y,double tx,double ty,double w,double a,double d)
{
	double theta=atan2(y-ty,x-tx);
	double A=abs(theta-w);
	A=min(A,2*M_PI-A);
	return hypot(x-tx,y-ty)<a&&A<d;
}
main()
{
	while(cin>>H>>R,H)
	{
		for(int i=0;i<H;i++)cin>>hx[i]>>hy[i];
		cin>>U>>M>>S;
		cin>>dU>>dM>>dS;
		dU=dU/2/180*M_PI;
		dM=dM/2/180*M_PI;
		dS=dS/2/180*M_PI;
		for(int i=0;i<U;i++)cin>>ux[i]>>uy[i];
		for(int i=0;i<M;i++)cin>>mx[i]>>my[i];
		for(int i=0;i<S;i++)cin>>sx[i]>>sy[i];
		for(int i=0;i<R;i++)
		{
			cin>>W[i]>>A[i];
			W[i]=W[i]>180?(W[i]-360)/180*M_PI:W[i]/180*M_PI;
		}
		vector<pair<int,int> >ans;
		for(int i=0;i<H;i++)
		{
			double x=hx[i],y=hy[i];
			int cnt=0;
			for(int k=0;k<R;k++)
			{
				if(!f(x,y,0,0,W[k],A[k],dU))continue;
				bool flag=1;
				for(int j=0;j<U;j++)flag&=!f(x,y,ux[j],uy[j],W[k],A[k],dU);
				for(int j=0;j<M;j++)flag&=!f(x,y,mx[j],my[j],W[k],A[k],dM);
				for(int j=0;j<S;j++)flag&=!f(x,y,sx[j],sy[j],W[k],A[k],dS);
				if(flag)cnt++;
			}
			ans.push_back(make_pair(-cnt,i+1));
		}
		sort(ans.begin(),ans.end());
		if(ans[0].first==0)cout<<"NA"<<endl;
		else
		{
			cout<<ans[0].second;
			for(int i=1;i<H;i++)
			{
				if(ans[i].first==ans[0].first)cout<<" "<<ans[i].second;
			}
			cout<<endl;
		}
	}
}



Measured memory_bytes: 3484
s = str(input())
t = str(input())
n = len(s)
m = len(t)
ans = 10000
for i in range(n-m+1):
    ans_temp = 0
    for j in range(m):
        if s[i+j] != t[j]:
            ans_temp += 1
    ans = min(ans, ans_temp)
print(ans)


Measured memory_bytes: 9048
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}



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

    ll A, B, C;
    cin >> A >> B >> C;

    vector<ll> ans1, ans2;

    rep(i, 101){
        if(i == 0 ) continue;
        if(A%i == 0) ans1.pb(i);
    }

    rep(i, ans1.size()){
        if(B%ans1[i] == 0) ans2.pb(ans1[i]);
    }

    sort(rall(ans2));
    cout << ans2[C-1] << endl;

	//cout << fixed << setprecision(16) << ans << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        String S = sc.next();

        char[] chars = S.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            int newCharInt = chars[i] + N;
            if (newCharInt >= (int)'Z' + 1) {
                newCharInt -= 'Z' - 'A' + 1;
            }
            System.out.print((char) newCharInt);
        }
    }
}


Measured memory_bytes: 24152
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
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; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}





int ord(const vector<int> &v) {
    int N = v.size();
    vector<int> x(N);
    for (int i = 0; i < N; ++i) x[i] = i;

    int iter = 0;
    do {
        if (v == x) break;
        ++iter;
    } while (next_permutation(x.begin(), x.end()));

    return iter;
}

int N;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    while (cin >> N) {
        vector<int> p(N), q(N);
        for (int i = 0; i < N; ++i) cin >> p[i], --p[i];
        for (int i = 0; i < N; ++i) cin >> q[i], --q[i];

        cout << abs(ord(p) - ord(q)) << endl;
    }
}


















Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			//			solveA();
			solveB();
			//			 solveC();
			//			 solveD();
			//			 solveE();
			//			 solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numR = nextInt();
		int numG = nextInt();

		out.println(numG * 2 - numR);
	}

	private void solveB() {
		final int numN = nextInt();
		final int numK = nextInt();

		int res = IntStream.range(0, numN).reduce(1, (sum, i) -> {
			if (sum * 2 > sum + numK) {
				sum += numK;
			} else {
				sum *= 2;
			}
			return sum;
		});

		out.println(res);
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 26708
#include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template<typename T> void swap(T *t1, T *t2){ T* tmp=t1; t1=t2; t2=tmp;}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if(s == "Sunny") {
        cout << "Cloudy" << endl;
    }
    if(s == "Cloudy") {
        cout << "Rainy" << endl;
    }
    if(s == "Rainy"){
        cout << "Sunny" << endl;
    }
    return 0;
}

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

int main(){
	int N,K;
	cin >> N >> K;
	vector<bool> flag(N,true);
	for(int i=0;i<K;i++){
		int d;
		cin >> d;
		for(int j=0;j<d;j++){
			int A;
			cin >> A;
			A--;
			flag[A]=false;
		}
	}
	
	int ans=0;
	for(int i=0;i<N;i++)if(flag[i])ans++;
	cout << ans << endl;
	return 0;
}

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


void solve(long long A, long long B, long long T){
    cout << T/A * B << endl;
}

// Generated by 1.1.4 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 A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long T;
    scanf("%lld",&T);
    solve(A, B, T);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdint>
using namespace std;

int main() {
    int n, k; cin >> n >> k;
    vector<int> p(n), c(n);
    for (auto &e : p) cin >> e;
    for (auto &e : c) cin >> e;

    int64_t ans = -1e18;

    for (int i = 0; i < n; ++i) {
        vector<int> cycle;
        int cpos = i;
        int64_t csum = 0;

        do {
            cpos = p[cpos] - 1;
            cycle.push_back(c[cpos]);
            csum += c[cpos];
        } while (cpos != i);

        int64_t ians = 0;

        if (0 < csum) {
            /* AC
            int64_t pmax = -1e18, psum = 0;
            // j < cycle.size() && j < k
            //  = j < min(cycle.size(), k)
            for (int j = 0; j < cycle.size() && j < k; ++j) {
                psum += cycle[j];
                pmax = max(pmax, (int64_t)(psum + csum * ((k - (j + 1)) / cycle.size())));
            }
            ians += pmax;
            */

            ians += csum * ((k - 1) / cycle.size());
            int64_t pmax = 0, psum = 0;
            for (int j = 0; j < (k - (k - 1) / cycle.size() * cycle.size()) && j < k; ++j) {
                psum += cycle[j];
                pmax = max(pmax, psum);
            }
            ians += pmax;

            // プラス側のコードが間違っている？
            /*ians += csum * (k / cycle.size());
            int64_t pmax = 0, psum = 0;
            for (int j = 0; j < k % cycle.size(); ++j) {
                psum += cycle[j];
                pmax = max(pmax, psum);
            }
            ians += pmax;*/
        }
        else {
            int64_t mmax = cycle[0], msum = cycle[0];
            for (int j = 1; j < min((size_t)k, cycle.size()); ++j) {
                msum += cycle[j];
                mmax = max(mmax, msum);
            }
            ians += mmax;
        }

        ans = max(ans, ians);

        /*
        int64_t ians = 0;
        int rest = k;

        if (0 < csum && cycle.size() < rest) {
            ians = csum * (rest / cycle.size());
            rest %= cycle.size();
        }

        int j = 0;
        int64_t pans = 0;
        int64_t psum = 0;
        if (csum <= 0) {
            j = 1;
            pans = cycle[0];
            psum = cycle[0];
        }

        while (j < min((size_t)rest, cycle.size())) {
            psum += cycle[j];
            pans = max(pans, psum);
            ++j;
        }

        ians += pans;

        ans = max(ans, ians);
        */
    }

    cout << ans << endl;
}



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

#define endl '\n'
#define Int long long
#define Double long double
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define CLR(a, b) memset(a, b, sizeof a)
#define debug(x) cerr << #x << " " << x << endl;
#define MOD 1000000007
#define MAXN 11

using namespace std;

int n, k;
int a[MAXN];

bool is_ok(int i) {
    while(i) {
        for(int l = 0; l < k; ++l)
            if(a[l] == i%10)
                return false;
        i /= 10;
    }
    return true;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    cin >> n >> k;
    for(int i = 0; i < k; ++i)
        cin >> a[i];

    for(int i = n; ; ++i) {
        if(is_ok(i)) {
            cout << i << endl;
            return 0;
        }
    }

    return 0;
}


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

string s;
int k, l;

int count(int i, bool equal, int nzero) {
	if (nzero > k)
		return 0;
	if (nzero == k)
		return 1;
	if (i == l)
		return 0;

	int ans = 0;
	for (int d = 0; d < 10; ++d) {
		if (equal) {
			if (d > s[i] - '0')
				continue;
			if (d < s[i] - '0')
				ans += count(i + 1, false, nzero + (d > 0));
			else
				ans += count(i + 1, true, nzero + (d > 0));
		} else
			ans += count(i + 1, false, nzero + (d > 0));
	}
	return ans;
}

int main() {
	cin >> s >> k;
	l = s.length();

	cout << count(0, 1, 0) << '\n';

	return 0;
}


Measured memory_bytes: 256
import java.util.*
import kotlin.math.*
import java.io.*

var ans:Long = 0

fun main() {
    val A  = readLine()!!.split(" ").map{ it.toLong() }
    val N:Long  = A[0]
    val D:Long  = A[1]
    for(i in 1..N){
        var B  = readLine()!!.split(" ").map { it.toLong() }
        var x1:Long  = B[0]
        var y1:Long  = B[1]
        var rr = (x1*x1)+(y1*y1)
        if(rr<=D*D){
            ans++
        }
    }
    println(ans)
}

Measured memory_bytes: 63256
/*
 *  Created on: 24-October-2019
 *      Author: ankur314
 */
#include <bits/stdc++.h>
#define lli long long int
#define li long int
#define db double
#define ldb long double
#define vr vector
#define it iterator
#define fi(i,a,n) for(int i=a;i<n;i++)
#define fli(i,a,n) for(long int i=a;i<n;i++)
#define flli(i,a,n) for(long long int i=a;i<n;i++)
#define pb(n) push_back(n)
#define ppf() pop_front()
#define pii pair<int,int>
#define MOD 1000000007
#define INF 1000000005
 
#define debug1(x) cout<<x<<"\n"
#define debug2(x,y) cout<<x<<" "<<y<<"\n"
#define debug3(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define debug4(x,y,z,w) cout<<x<<" "<<y<<" "<<z<<" "<<w<<"\n"
 
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);*/
    string s, t;
    cin>>s>>t;
    int n = s.length();
    int m = t.length();
    int dp[n+1][m+1];
    fi(i,0,n+1)
    {
    	fi(j,0,m+1)
    	{
    		if(i==0 || j==0) dp[i][j] = 0;
    		else if(s[i-1] == t[j-1])
    		{
    			dp[i][j] = 1 + dp[i-1][j-1];
    		}
    		else
    		{
    			dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
    		}
    	}
    }
    string ans="";
    int L = dp[n][m];
    int i=n, j=m;
    while(i>0 && j>0)
    {
    	if(dp[i][j] == 1 + dp[i-1][j-1] && dp[i][j] > max(dp[i-1][j], dp[i][j-1]))
    	{
    		ans += t[j-1];
    		i--;
    		j--;
    	}
    	else
    	{
    		if(dp[i-1][j] > dp[i][j-1])
    		{
    			i--;
    		}
    		else
    		{
    			j--;
    		}
    	}
    }
    reverse(ans.begin(), ans.end());
    cout<<ans;
    return 0;
}

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

int l ;

vector < pair < pair < int , int > , int > > Edge ; 

vector < pair < int , int > > Wait ;

int main(){
	#define NAME "arc102_b"
	//freopen( NAME".inp" , "r" , stdin ) ; freopen( NAME".out" , "w" , stdout ) ;

	ios_base :: sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0) ;

	cin >> l ;

	int nNode = 1 ;

	l -- ;

	while(l){
		nNode ++ ;
		if(l <= 2) {
			for (int i = 0; i <= l; ++ i) Edge.push_back(make_pair(make_pair(nNode - 1, nNode), i)) ;
			break ;
		}
		if(l % 2 == 0) Wait.push_back(make_pair(nNode - 1, l)), l -- ;
		l /= 2 ;
		Edge.push_back(make_pair(make_pair(nNode - 1, nNode), 0)) ;
		Edge.push_back(make_pair(make_pair(nNode - 1, nNode), l + 1)) ;
	}

	for (auto v : Wait) Edge.push_back(make_pair(make_pair(v.first, nNode), v.second)) ;

	cout << nNode << " " << (int)Edge.size() << endl ;

	for (auto v : Edge) cout << v.first.first << " " << v.first.second << " " << v.second << endl ; 

	return 0 ;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int N;
  int x;
  int i, j, k;
  int buf;

  scanf("%d", &N);

  for(i = 1; i <= 9; i++){
    buf = 100*i + 10*i + i;
    if(buf >= N){
      printf("%d\n", buf);
      break;
    }
  }
  
  return 0;
}


Measured memory_bytes: 128
#include<stdio.h>

int main() {

	int A, B, C, X;
	scanf("%d %d %d %d", &A, &B, &C, &X);

	int x, y, z, flag = 0;

	for (x = 0; x <= X/500 ; x++) {

		for (y = 0; y <= (X-500*x)/100; y++) {

			z = (X - 500 * x - 100 * y) / 50;

			if (x <= A&&y <= B&&z <= C) {

				flag++;

			}

		}

	}

	printf("%d", flag);

}

Measured memory_bytes: 128
#include<stdio.h>
 #include<vector>
 #include<algorithm>
 using namespace std;
 typedef long long ll;
 int main()
 {
	int a, b, x, y;
	 scanf("%d%d%d%d", &a, &b, &x, &y);
	printf("%lf %d\n", double(a)*double(b) / 2, x + x == a && y + y == b);
	return 0;
 }

Measured memory_bytes: 128
n,a =map(int,input().split())
X=list(map(int,input().split()))
X=list(map(lambda x:x-a, X))
dp={0:1}
for i in X:
  for k,v in list(dp.items()):
    dp[i+k]=dp.get(i+k,0)+v
print(dp[0]-1)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string,int>;
const double PI = acos(-1);

int main() {
  int n,m;
  cin >> n >> m;
  vector<vector<int>> x(m,vector<int>(2));
  rep(i,m)rep(j,2) cin >> x.at(i).at(j);
  bool ans = false;
  map<int,int> mp;
  rep(i,m){
    if(x.at(i).at(0) == 1) mp[x.at(i).at(1)]++;
    else if(x.at(i).at(1) == n) mp[x.at(i).at(0)]++;
  }
  for(auto itr = mp.begin(); itr != mp.end(); itr++){
    if(itr->second == 2) ans = true;
  }
  cout << (ans?"POSSIBLE":"IMPOSSIBLE") << endl;
}

Measured memory_bytes: 23500
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final long N = sc.nextLong();
			final long K = sc.nextLong();
			
			if(N % K == 0) {
				System.out.println(0);
			}else {
				System.out.println(Math.min(N % K, K - (N % K)));
			}
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 21076
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
PM = [stdin.readline().rstrip().split() for _ in range(M)]
AC = set()
WA = {}
wa = 0
for pm in PM:
    if pm[0] in AC:
        continue
    if pm[1] == "AC":
        AC.add(pm[0])
        if pm[0] in WA:
            wa += WA[pm[0]]
    elif pm[1] == "WA":
        if pm[0] not in WA:
            WA[pm[0]] = 0
        WA[pm[0]] += 1  
print(len(AC), wa)

Measured memory_bytes: 38284
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void)
{
long N, M;
  
  scanf("%ld %ld", &N, &M);
  printf("%ld\n", (N+M)*(N+M-1)/2-(N*M));
  
  return 0;
}


Measured memory_bytes: 128
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

int  n,k; 
int a[52];
int dp[5005][52];

int fun(int idx,int sum){
    if (idx>n ) return (sum%2==k); 
    if (dp[sum][idx] != -1) return dp[sum][idx];
    return  dp[sum][idx] = fun(idx+1,sum)+fun(idx+1,sum+a[idx]);
}


inline void solve(){
    memset(dp,-1,sizeof(dp));
    cin>>n>>k;
    for (int i=1;i<=n;i++) cin>>a[i];
    cout << fun(1,0) << endl;
}

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


Measured memory_bytes: 5668
#include <bits/stdc++.h>
#define SIZE 10
using namespace std;
typedef long long ll;

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

	string S;
	int i,j;
	int tmp;
	string answer;
	int counter=0;
	bool flag=true;
	double ave;
	vector<int> given;

	cin >> S;

	for(i=0;i<S.length();i++){
		if((i+1)%2){
			//odd
			if(S[i]=='L'){
				flag=false;
				break;
			}
		}else{
			//even
			if(S[i]=='R'){
				flag=false;
				break;
			}
		
		}
	}
	
	if(flag){
		answer="Yes";
	}else{
		answer="No";
	}

	cout << answer << endl;

	return 0;
}



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

using namespace std;

#define ll long long
#define ini(arr, val) memset(arr, (val), sizeof(arr))
#define loop(i,n)  for(ll i=0; i<n; i++)
#define loop1(i,n)  for(ll i=1; i<=n; i++)

#define all(a)      (a).begin(),(a).end()
#define dupli(a)     unique(all(a)),(a).end()
#define exist(s,e)  (s.find(e)!=s.end())
#define dbg(x)  cout << #x << " is " << x << endl;
#define pt(x) cout<<x<<"\n"
#define pts(x) cout<<x<<" "

#define mp make_pair
#define pb push_back
#define f first
#define s second


#define inf (int)1e9
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define mod 1000000007


#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test   int t; cin>>t; while(t--)

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef set<int> si;

typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<pll> vpll;
typedef vector<vl> vvl;
typedef map<ll,ll> mll;
typedef set<ll> sl;


//////////////////////////////////////////////////////////////////////////////////////////
//                      main starts
//////////////////////////////////////////////////////////////////////////////////////////
int const lmt=1e5+5;



int main(){

 //    #ifndef ONLINE_JUDGE
 //    freopen("../input.txt", "r", stdin);
 //    freopen("../output.txt", "w", stdout);
	// #endif
 //    fast
    
  	string s,p;
  	cin>>s>>p;
  	ll n=s.size();
  	ll c=0;
  	loop(i,n){
  		if(s[i]!=p[i]) c++;
  	}
  	pt(c);
    

    

}


/*

// 

*/

Measured memory_bytes: 3912
#include <iostream>

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

  int N;
  std::cin >> N;
  int d[101];
  for (int i = 0; i < N; i++) std::cin >> d[i];
  int num[101] = {0};
  for (int i = 0; i < N; i++) num[d[i]] += 1;
  int res = 0;
  for (int i = 0; i < 101; i++) {
    if (num[i]) res += 1;
  }
  std::cout << res << '\n';
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

template<class T>
using vector2d=vector<vector<T>>;

template<class T>
bool UpdateMax(T &a, const T &b){
  if(a<b){
    a=b;
    return true;
  }else{
    return false;
  }
}

template<class T>
bool UpdateMin(T &a, const T &b){
  if(a>b){
    a=b;
    return true;
  }else{
    return false;
  }
}

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

bool IsEqual(lint a,lint b,lint c){
  return (a*b-c)*(a+b-c)==4*a*b;
}

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  lint a,b,c;
  cin>>a>>b>>c;
  if(c<a+b){
    cout<<"No"<<endl;
  }else
  cout<<((c-a-b)*(c-a-b)>4*a*b?"Yes":"No")<<endl;




  return 0;
}




Measured memory_bytes: 256
import numpy as np
N = int(input())
num = 0
for i in range(1, N+1):
  num += i * (N+1-i)
for _ in range(N-1):
  u, v = map(int, input().split())
  x, y = min(u, v), max(u, v)
  num -= (N+1-y) * x
print(num)

Measured memory_bytes: 27112
#include <stdio.h>

int main() {
    // freopen ("in.txt", "r", stdin);
    int N,D;
    scanf ("%d %d",&N, &D);
    int indexI, indexJ, indexK;
    double coordinates[N][D];

    for (indexI = 0; indexI < N; indexI++)
        for (indexJ = 0; indexJ < D; indexJ++)
            scanf ("%lf", &coordinates[indexI][indexJ]);

    double sum=0;
    int sumI, count = 0;

    for (indexI = 0; indexI < N; indexI++) {
        for (indexJ = indexI+1; indexJ < N; indexJ++) {
            sum = 0;

            for (int indexK = 0; indexK < D; indexK++)
                sum += (coordinates[indexI][indexK] - coordinates[indexJ][indexK]) * (coordinates[indexI][indexK] - coordinates[indexJ][indexK]);

            sum = sqrt (sum);
            sumI =  sum;

            if (sum == (double) sumI && sum!=0)
                count++;
        }
    }

    printf ("%d\n",count);
    return 0;
}


Measured memory_bytes: 128
from sys import stdin
import heapq
N,M = [int(x) for x in stdin.readline().rstrip().split()]
A = [-int(x) for x in stdin.readline().rstrip().split()]
heapq.heapify(A)
for _ in range(M):
    v = -heapq.heappop(A)
    v //= 2
    heapq.heappush(A,-v)
ans = -sum(A)
print(ans)

Measured memory_bytes: 14180
// {{{
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
// }}}

using ll = long long;

int main() {
    int N, D[101010];
    cin >> N; for (int j = 0; j < N; ++j) cin >> D[j];
    sort(D, D+N); reverse(D, D+N);
    int count = 1, v = D[0];
    for (int j = 1; j < N; ++j) {
        if (v > D[j]) {
            ++count;
            v = D[j];
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
S = [1 if i =='1' else 0 for i in input()]
l=len(S)
if l%2==1:
    t=l//2
    a = S[t]
    for i in range(1,t+1):
        if S[t-i]!=a or S[t+i]!=a:
            print(t+i)
            sys.exit()
    print(l)
    sys.exit()
if l%2==0:
    t=l//2
    a = S[t-1]
    b=S[t]
    if a!=b:
        print(t)
        sys.exit()
    for i in range(1,t):
        if S[t-1-i]!=a or S[t+i]!=a:
            print(t+i)
            sys.exit()
    print(l)
    sys.exit()

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

signed main(void)
{
	map<string, int> m;
	int n; cin >> n;
	int maxi;

	maxi = 0;	
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		m[s]++;
		if (m[s] > maxi)
			maxi = m[s];
	}
	for (auto p : m)
	{
		auto key = p.first;
		auto value = p.second;
		if (maxi == value)
			cout << key << endl;
	}
	return 0;
}


Measured memory_bytes: 25216
import fractions

def lgcd(l):
    if len(l)==1:
        return l[0]
    res = l[0]
    for i in range(1,len(l)):
        res = fractions.gcd(res,l[i])
    return res

def main():
    n = int(input())
    a= list(map(int,input().split()))
    b = a[:]
    b.reverse()
    l = [0]
    r = [0]
    for i in range(n):
        l.append(fractions.gcd(l[i],a[i]))
        r.append(fractions.gcd(r[i],b[i]))
    m=[]
    for i in range(n):
        m.append(fractions.gcd(l[i],r[n-1-i]))
    return max(m)


print(main())

Measured memory_bytes: 100192
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<ii> vii;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fr(be, en) for(int i = be; i <= en; i++) 
ll mod = LLONG_MAX;
ll power(ll a, ll b)
{
	if(b == 0) return 1;
	ll ans = power(a, b/2);
	ans = (ans*ans)%mod;
	if(b%2) ans*=a;
	return ans%mod;
}
ll mul(ll a,ll n, ll mod)
{
	ll ret;
	if(n==0) return 0;
	ret = mul(a,n/2, mod);
	ret = (ret+ret)%mod;
	if(n%2)	ret=(ret+a)%mod;
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cout.tie(NULL);
	cin.tie(NULL);
	int a;
	cin >> a;
	cout << power(a, 1) + power(a, 2) + power(a, 3);
}

Measured memory_bytes: 3600