akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;

int main(void)
{
    int N, M, X;
    cin >> N >> M >> X;

    vector<int> A(M);
    for (int i = 0; i < M; i++)
    {
        cin >> A[i];
    }

    vector<int> map(N + 1, 0);
    for (int i = 0; i < M; i++)
    {
        map[A[i]]++;
    }
    // for (int i = 0; i < N + 1; i++)
    // {
    //     printf("%d ", map[i]);
    // }
    // printf("\n");

    int left = 0;
    int right = 0;

    // Going to left side
    for (int i = X; i >= 0; i--)
    {
        left += map[i];
    }
    // printf("left = %d\n", left);

    // Goint to right side
    for (int i = X; i <= N; i++)
    {
        right += map[i];
    }
    // printf("right = %d\n", right);
    cout << min(left, right) << endl;
    return (0);
}

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;

int main() {
  string str = chomp(readln);
  int val = to!(int)(str);
  int h = val/3600; val %= 3600;
  int m = val/60; val %= 60;
  int s = val;
  writeln(h, ":", m, ":", s);
  return 0;
}

Measured memory_bytes: 1044
#include<bits/stdc++.h>
 
#define ll long long int 
#define endl '\n'
#define PI  3.14159265358979323846
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define MAX 1000
using namespace std;
 
//ll gcd(ll n,ll m){
//	if(m==0)
//	return n;
//	if(n<m)
//	swap(n,m);
//	while(n%m!=0)
//	{
//		ll temp=n;
//		n=m;
//		m=temp%m;
//	}
//	return m;
//}

//bool sortbysec(pair<int,int> &a,pair<int,int> &b) 
//{ 
//    return (a.second < b.second); 
//} 


int main() {
    ll n,i,j;
    cin>>n;
    ll h[n];
    for(i=0;i<n;i++)
    cin>>h[i];
    ll dp[n];
    dp[0]=0;
    dp[1]=abs(h[1]-h[0]);
    for(i=2;i<n;i++)
    {
    	dp[i]=INT_MAX;
    	for(j=i-1;j>=i-2;j--)
    	{
    		dp[i]=min(dp[i],abs(h[i]-h[j])+dp[j]);
		}
	}
	cout<<dp[n-1];
}






Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <set>
#include <cmath>
#include <cstring>
#include <map>
#include <queue>
#include <bits/stdc++.h>


using namespace std;

map<int,int>mp;
set<int>st;
int main()
{
    int n;
    cin>>n;

    int arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        mp[arr[i]]++;
        st.insert(arr[i]);
    }
    long long cnt=0;
    for(auto u : st)
    {
        if(u > mp[u])
        {
            cnt+=mp[u];
        }
        else if(u < mp[u])
        {
            cnt+=mp[u] - u;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 9600
import sys
sys.setrecursionlimit(10**6)

n = int(input())
h = list(map(int, input().split()))

fixed = [False]*n

for i in range(n-1):
    if h[i] < h[i+1]:
        h[i] -= 1
        h[i+1] -= 1
        fixed[i+1] = True
        continue
    elif h[i] == h[i+1]:
        fixed[i+1] = True
        continue
    else:
        print('No')
        break
    break
else:
    print('Yes')

Measured memory_bytes: 14396
import sys
from math import log2,floor,ceil,sqrt
# import bisect
sys.setrecursionlimit(10**5)
# from collections import deque

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
 
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

def backtrack(arr,cur,ans):
    if cur == n:
        alg = [0]*m
        cost  = 0
        for i in range(len(arr)):
            if arr[i] == 1:
                cost+=c[i]
                for j in range(m):
                    alg[j] += lis[i][j]
        flag = True
        for i in range(m):
            if alg[i] < k:
                flag = False
                break
        if flag :
            ans[0] = min(ans[0],cost)
        return
    arr[cur] = 0
    backtrack(arr,cur+1,ans)
    arr[cur] = 1
    backtrack(arr,cur+1,ans)
    arr[cur] = 0

n,m,k  = Ri()
c = [0]*n
lis = []
for i in range(n):
    temp = Ri()
    c[i] = temp[0]
    lis.append(temp[1:])

arr = [0]*n
ans = [INF]
backtrack(arr,0,ans)
if ans[0] == INF:
    print(-1)
else:
    print(ans[0])

Measured memory_bytes: 70608
#include<bits/stdc++.h>
using namespace std;
namespace io{
    const int l=1<<20;
    char buf[l],*s,*t,c;
    inline void gc(){
        if(s==t){
            t=(s=buf)+fread(buf,1,l,stdin);
            c=s==t?EOF:*s++;
        }else c=*s++;
    }
    template<class IT>inline void gi(IT &x){
        x=0;gc();while(c<'0'||c>'9')gc();
        while('0'<=c&&c<='9'){x=(x<<1)+(x<<3)+(c^48);gc();}
    }
    char buf0[20];int a;
    template<class IT>inline void pi(IT x){
        if(x<0){putchar('-');x=-x;}
        do buf0[++a]=x%10+48;while(x/=10);
        while(a)putchar(buf0[a--]);
        putchar('\n');
    }
};
using io::gi;
using io::pi;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,ll > pil;
typedef pair<ll ,int> pli;
typedef pair<ll ,ll > pll;
typedef vector<int> vi;
typedef vector<ll > vl;
#define pque priority_queue
#define rep(i,l,r) for(i=(l);i<=(r);++i)
#define per(i,l,r) for(i=(l);i>=(r);--i)
#define REP(i,l,r) for(i=(l);i< (r);++i)
#define PER(i,l,r) for(i=(l);i> (r);--i)
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define fi first
#define se second
template<class IT>inline void cmax(IT &a,IT b){if(a<b)a=b;}
template<class IT>inline void cmin(IT &a,IT b){if(b<a)a=b;}
const int N=200005;

int main(){
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
	int a,b;
	scanf("%d",&a);
	b+=1000*(a/500);a%=500;
	printf("%d",b+(a/5)*5);
    return 0;
}

Measured memory_bytes: 256
n = gets.to_i
w = []
n.times do |i|
  w[i] = gets.to_s.chomp!
end
unless n == w.uniq.size
  puts 'No'
  exit 0
end

w.each_with_index do |word, index|
  next if index == 0
  unless w[index - 1][-1] == word[0]
    puts 'No'
    exit 0
  end
end

puts 'Yes'

Measured memory_bytes: 1788
#include <iostream>
#include <sstream>
#include <regex>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
#define itn ll
#define int ll
//const int INF = 100100100;
const int INF = (1LL << 32);
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;

int digitsSum(int n) {
	int res = 0;
	while (n > 0) {
		res += n % 10;
		n /= 10;
	}
	return res;
}

signed main() {
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int ans = INF;
	FOR(i,1, n) {
		int s = digitsSum(i) + digitsSum(n - i);
		ans = min(ans, s);
	}
	cout << ans << '\n';
	return 0;
}



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

int N;

signed main() {
  cin >> N;
  int ans = N-1;
  int S = (int)ceil(sqrt(N));

  for(int i=2; i<=S; i++) {
    if(N%i) continue;
    int count = (i-1) + (N/i - 1);
    ans = min(ans, count);
  }
  cout << ans << endl;

}


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

using namespace std;


int main() {
  int n; cin >> n;
  vector<int> ns(n, 0);
  vector<int> vis(n, -1);
  for (int i = 0; i < n; i++) { cin >> ns[i]; ns[i]--; }

  int cnt = 0;
  int pos = 0;
  while(true) {
    if (pos == 1) {
      break;
    }
    if (vis[pos] >= 0) {
      cnt = -1;
      break;
    }
    vis[pos] = cnt;
    pos = ns[pos];
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 1024
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *
 
N = INT()
S = list(input())

cnt = Counter(S).values()

ans = 1
for x in cnt:
	ans = ans*(x+1)%mod

print((ans-1%mod))



Measured memory_bytes: 11404
import java.util.*;

public class Main {
    static final int MOD = 998244353;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int k = sc.nextInt();
		Combination cmb = new Combination(n + 1);
		long ans = 0;
		for (int i = 0; i <= k; i++) {
		    ans += m * pow(m - 1, n - i - 1) % MOD * cmb.getComb(n - 1, i) % MOD;
		    ans %= MOD;
		}
		System.out.println(ans);
   }
   
   static long pow(long base, int p) {
       if (p == 0) {
           return 1;
       } else if (p % 2 == 0) {
           return pow(base * base % MOD, p / 2);
       } else {
           return pow(base, p - 1) * base % MOD;
       }
   }

}

class Combination {
    static final int MOD = 998244353;
    long[] fac;
    long[] finv;
    long[] inv;
    
    public Combination (int size) {
        fac = new long [size];
        finv = new long [size];
        inv = new long [size];
        fac[0] = 1;
        fac[1] = 1;
        finv[0] = 1;
        finv[1] = 1;
        inv[1] = 1;
        for (int i = 2; i < size; i++) {
            fac[i] = fac[i - 1] * i % MOD;
            inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
            finv[i] = finv[i - 1] * inv[i] % MOD;
        }
    }
    
    
    public long getComb(int n, int k) {
        if (n < k || n < 0 || k < 0) {
            return 0;
        }
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
    }
    
}



Measured memory_bytes: 40912
s = input()

s1 = s.replace('x', '')

if s1 != s1[::-1]:
    print(-1)
    exit()

l, r = 0, len(s)-1
ans = 0
while l < r:
    if s[l] == s[r]:
        l += 1
        r -= 1
    elif s[l] == 'x':
        l += 1
        ans += 1
    elif s[r] == 'x':
        r -= 1
        ans += 1
print(ans)


Measured memory_bytes: 9248
//#pragma GCC optimize("O3", "unroll-loops")
//#pragma GCC target("avx2")
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIXED cout << fixed << setprecision(12)
#define RANDOM srand(94385)
#define all(a) a.begin(), a.end()
#define shuffle(a) \
    for (int i = 0; i < sz(a); ++i) \
        swap(a[i], a[rand() % sz(a)]);
#define enter puts("")
#define space putchar(' ')
#define Mem(a, x) memset(a, x, sizeof(a))
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

void debug_out() { cerr << '\n'; }
template<typename T, typename ...R>void debug_out(const T &f, const R &...r) {cerr << f << " ";debug_out(r...);}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__);
inline ll read() {ll x = 0;int f = 0;char ch = getchar();while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();while (ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = getchar();return x = f ? -x : x;}
inline void write(ll x) {if (x == 0) {putchar('0');return;}if (x < 0) {putchar('-');x = -x;}static char s[23];int l = 0;while (x != 0)s[l++] = x % 10 + 48, x /= 10;while (l)putchar(s[--l]);}
int lowbit(int x) { return x & (-x); }
template<class T>T big(const T &a1, const T &a2) { return a1 > a2 ? a1 : a2; }
template<typename T, typename ...R>T big(const T &f, const R &...r) { return big(f, big(r...)); }
template<class T>T sml(const T &a1, const T &a2) { return a1 < a2 ? a1 : a2; }
template<typename T, typename ...R>T sml(const T &f, const R &...r) { return sml(f, sml(r...)); }
template<class T, class U>inline void checkMin(T &x, U y) { if (y < x) x = y; }
template<class T, class U>inline void checkMax(T &x, U y) { if (y > x) x = y; }
template<class T, class U>inline bool ifMax(T &x, U y) {if (y > x) return x = y, true;return false;}
template<class T, class U>inline bool ifMin(T &x, U y) {if (y < x) return x = y, true;return false;}

const int M = 212345;// 2e5+5
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1000000007;// 1e9+7

// HAVE FREE OPEN IN MAIN FUNCTION

void init() {
    int a=read(),b=read();
    write(big(a+b,a*b,a-b));
    enter;
}

void solve() {

}

int main() {
    init();

    solve();

    return 0;
}

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

#define INF ((1<<30)-1)
#define LLINF (1LL<<60)
#define EPS (1e-10)

int main() {
    int N;
    cin >> N;
    vector<ll> A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());

    if (N%2) {
        cout << (B[N/2] - A[N/2] + 1) << endl;
    }
    else {
        ll a = (A[N/2] + A[N/2-1]) * 5;
        ll b = (B[N/2] + B[N/2-1]) * 5;
        cout << (b - a + 5) / 5 << endl;
    }
}


Measured memory_bytes: 6428
# -*- coding: utf-8 -*-

def main():
    # 整数の入力
    N = int(input())
    ls = []
    for i in range(N):
        ls.append(int(input()))

    ls.sort()
    cnt = 0
    tmp_size = 0
    for size in ls:
        if size > tmp_size:
            cnt += 1
            tmp_size = size

    print(cnt)


main()


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

using namespace std;

int const MOD = 1000000007;
int const N = 555;

int from[N], to[N];
int c[N][N];
int dsu[N], sz[N], pv[N];
int ff[42];
set<int> sv[N];
int mul(int a, int b) {
  return (int) ((long long) a * b % MOD);
}

int get(int *p, int x) {
  return x == p[x] ? x : (p[x] = get(p, p[x]));
}

int gcd(int a, int b) {
  return !b ? a : gcd(b, a % b);
}

int modpow(int a, int b) {
  int ret = 1;
  while (b > 0) {
    if (b & 1) {
      ret = mul(ret, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return ret;
}

int solve2(int n, int k) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int g = gcd(i, n);
    int pw = 1;
    for (int j = 0; j < g; j++) {
      pw = mul(pw, k);
    }
    ans = (ans + pw) % MOD;
  }
  ans = mul(ans, modpow(n, MOD - 2));
  return ans;
}

int main() {
  for (int i = 0; i < N; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
    }
  }
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", from + i, to + i);
    --from[i];
    --to[i];
  }
  for (int i = 0; i < m; i++) dsu[i] = i;
  for (int i = 0; i < m; i++) {
    for (int j = i + 1; j < m; j++) {
      int cn = 0;
      ff[cn++] = from[i];
      ff[cn++] = to[i];
      ff[cn++] = from[j];
      ff[cn++] = to[j];
      set<int> q;
      int rem = -1;
      for (int e = 0; e < cn; e++) {
        if (q.find(ff[e]) == q.end()) {
          q.insert(ff[e]);
        } else {
          q.erase(ff[e]);
          rem = ff[e];
        }
      }
      if (q.size() > 2) continue;
      int v = *q.begin();
      q.erase(q.begin());
      int u = *q.begin();
      q.erase(q.begin());
      for (int e = 0; e < n; e++) pv[e] = e;
      for (int e = 0; e < m; e++) {
        if (e == i || e == j) continue;
        if (from[e] == rem || to[e] == rem) continue;
        pv[get(pv, from[e])] = get(pv, to[e]);
      }
      if (get(pv, v) == get(pv, u)) {
        dsu[get(dsu, i)] = get(dsu, j);
      }
    }
  }
  int ans = 1;
  for (int i = 0; i < m; i++) {
    sz[get(dsu, i)]++;
    sv[get(dsu, i)].insert(from[i]);
    sv[get(dsu, i)].insert(to[i]);
  }
  for (int i = 0; i < m; i++) {
    if (get(dsu, i) == i) {
      if ((int) sv[i].size() == sz[i]) {
        ans = mul(ans, solve2(sz[i], k));
      } else {
        ans = mul(ans, c[sz[i] + k - 1][k - 1]);
      }
    }
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 1536
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn= new Scanner(System.in);
		int n =scn.nextInt();
		 ArrayList<ArrayList<Integer>> al= new ArrayList<>();
		 for(int i=0;i<n;i++){
			 ArrayList<Integer>al1 = new ArrayList<>();
			 al.add(al1);
		 }
		int m =scn.nextInt();
		int [] arr =new int[n];
		for(int i=0;i<arr.length;i++){
			arr[i]=scn.nextInt();
		}
		while(m-->0){
			int a=scn.nextInt();
			int b =scn.nextInt();
			a--;
			b--;
			ArrayList<Integer> al1 =al.get(a);
			al1.add(b);
			ArrayList<Integer> al2 = al.get(b);
			al2.add(a);
		}
		int cnt=0;
		for(int i=0;i<arr.length;i++){
			ArrayList<Integer> al1 = al.get(i);
			boolean f =true;
			for(int val : al1){
				if(arr[i]<=arr[val]){
					f=false;
					break;
				}
			}
			if(f){
				cnt++;
			}
		}
		System.out.println(cnt);
	}

}

Measured memory_bytes: 73436
//#pragma GCC optimize(3)

#include<bits/stdc++.h>
#define MST(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for(int i = a ; i < b ; ++i)
#define per(i,a,b) for(int i = a ; i > b ; --i)
#define ALL(v) v.begin(),v.end()
#define ft first
#define sd second
using namespace std;

template<class T> void show(T *x,int len,int s = 0) {for(int i = s ; i < s+len-1 ; ++i) cerr << x[i] << ' ';cerr << x[s+len-1] << endl;}
void debug() {cerr << endl;}
template <typename T, typename... Args> void debug(T x,Args... args) {cerr << x << ' ';debug(args...);}
typedef long long LL;
typedef unsigned long long ULL;

typedef pair<LL,LL> pii;
#include <ext/pb_ds/priority_queue.hpp>
using namespace __gnu_pbds;
typedef __gnu_pbds::priority_queue<pii,greater<pii>,pairing_heap_tag> heap;
typedef heap::point_iterator iter;
template<class T>
inline void cmin(T &A,const T &B) {A = (A<B?A:B);}
template<class T>
inline void cmax(T &A,const T &B) {A = (A>B?A:B);}

const int N = 3000+19;
int n,P;
int c[N][N],s[N][N];

int power(int a,int b,int p) {
    int ans = 1;
    for( ; b ; b >>= 1,a = 1ll*a*a%p)
        if(b&1) ans = 1ll*ans*a%p;
    return ans;
}

void solve() {
    cin >> n >> P;
    c[0][0] = 1;
    for(int i = 1 ; i < N ; ++i) {
        c[i][0] = c[i][i] = s[i][i] = 1;s[i][0] = 0;
        for(int j = 1 ; j < i ; ++j) {
            c[i][j] = (c[i-1][j-1]+c[i-1][j])%P;
            s[i][j] = (s[i-1][j-1]+1ll*j*s[i-1][j]%P)%P;
        }
    }
    int ans = 0;
    for(int i = 0 ; i <= n ; ++i) {
        int res = 1ll*c[n][i]*power(2,power(2,n-i,P-1),P)%P*((i&1) ? P-1 : 1)%P,tmp = power(2,n-i,P);
        int tot = 0;
        for(int j = 0 ; j <= i ; ++j)
            tot = (tot+1ll*power(tmp,j,P)*s[i+1][j+1]%P)%P;
        ans = (ans+1ll*tot*res%P)%P;
    }
    cout << ans << endl;
}

signed main() {
    //srand((int)time(0));
    //ios::sync_with_stdio(0);
    int T = 1;
    //cin >> T;
    while(T--) solve();
}

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

typedef  long long ll;

int main(){
	
	int N;
  	string S;
  	int K;
  	cin >> N;
  	cin >> S;
  	cin >> K;
	//cout <<S[K-1]<<endl;
  	for(int i = 0; i < N ; i++){
    	if(S[i]==S[K-1]){

	    cout << S[K-1];
    	}else{
        cout << "*";
        }
    }
  	

    	cout  << endl;





  	
  
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>

// BEGIN CUT HERE
#ifdef _MSC_VER
#include <agents.h>
#endif
// END CUT HERE 

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define REV(v) rbegin(v), rend(v)
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define MP make_pair
#define MT make_tuple
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

string str[] = {
	"",
	".,!? ",
	"abc",
	"def",
	"ghi",
	"jkl",
	"mno",
	"pqrs",
	"tuv",
	"wxyz",
};

int main(){
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	string s;
	while (n--){
		cin >> s;
		char ch = ' ';
		int cnt = 0;
		for (auto c : s){
			if (c == ch){
				++cnt;
			}else if(c == '0'){
				if (cnt) cout << str[ch-'0'][(cnt-1)%str[ch-'0'].size()];
				cnt = 0;
				ch = ' ';
			}
			else{
				ch = c;
				cnt = 1;
			}
		}
		if (cnt) cout << str[ch - '0'][(cnt - 1) % str[ch - '0'].size()];
		cout << endl;
	}


	return 0;
}

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

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

    for (int i = 0; i < 10; i++) {
        if ((1 << i) > n) {
            printf("%d\n", (1 << (i - 1)));
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 256
N,Q=map(int,input().split())
S=input()
c=[0]
t = 0
for i in range(1,N):
    t += 1 if  S[i-1:i+1]=='AC' else 0
    c.append(t)
for _ in range(Q):
    l,r=map(int, input().split())
    print(c[r-1]-c[l-1])


Measured memory_bytes: 7864
#include<iostream>
#include<queue>
using namespace std;
queue<long long int>q;
int main(){
    int k;
    cin>>k;
    for(int i=1;i<10;i++){
        q.push(i);
    }
    while(k--){
        long long int x = q.front();
        q.pop();
        if(k==0){
            cout<<x<<endl;
            return 0;
        }
        if(x % 10 != 0)q.push(10*x + x % 10 - 1);
        q.push(10*x + x % 10);
        if(x % 10 != 9)q.push(10 * x + x % 10 + 1);
    }
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl
typedef long long ll;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;

using namespace std;

int main(){
    ll a, b, c, d;  cin >> a >> b >> c >> d;
    print(max({a*d, a*c, b*c, b*d}));
}

Measured memory_bytes: 3636
#include <cstdio>
#include <iostream>

using namespace std;


signed main()
{   
    int mp[101] = {0};
    int key;
    while ( scanf("%d\n", &key ) != EOF )
    {
        mp[ key ]++;
    }
    int mode = 0;
    for( int i = 1; i <= 100; i++ )
    {
        if( mode < mp[i] )
        {
            mode = mp[i];
        }
    }
    
    ///mode_value
    for( int i = 1; i <= 100; i++ )
    {
        if( mp[i] == mode )
        {
            printf( "%d\n", i );
        }
    }
    return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <string>
using namespace std;
 
int main() {    
    int mach = 0;
    string s, t;
    cin >> s >> t;
    int ss = s.size(), ts = t.size();
    if(ss >= ts) {
        for(int i = ss - 1; i > ts - 2; --i) {
            if(s[i] == t[ts-1] || s[i] == '?') {
                mach = 1;
                for(int j = 1; j < ts; ++j) {
                    if(s[i-j] == t[ts-j-1] || s[i-j] == '?') {
                        mach++;
                    } else {
                        mach = 0;
                        break;
                    }
                }
                if(mach == ts) {
                    for(int k = 0; k < ts; ++k) {
                        s[i-k] = t[ts-k-1];
                    }
                    break;
                }
            }
        }
    }

    if(mach) {
        for(int i = 0; i < ss; ++i) {
            if(s[i] == '?') s[i] = 'a';
        }
        cout << s << "\n";
    } else {
        cout << "UNRESTORABLE" << "\n";
    }
    
}


Measured memory_bytes: 256
/* nothing is impossible */
#include <bits/stdc++.h> 
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef double ld;
typedef string st;
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
const ll MOD = 1e9 + 7 ;
const ll INF=1e14;                                                                                                 
ll mpow(ll a,ll b,ll p=MOD){a=a%p;ll res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}             
map<ll,ll>mo;
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
 /// freopen("input.txt", "r", stdin);
  ll n,m,s=0;
  cin>>n>>m;
  ll ans=0;
  mo[0]++;
  forn(i,n)
  {
    ll x;
    cin>>x;
    s=(s+x)%m;
    ans+=mo[s]++;
  }
  cout<<ans;
return 0;
}         

Measured memory_bytes: 4224
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def main():
    N = I()
    d = collections.defaultdict(int)
    for _ in range(N):
        c = S()
        d[c] += 1
    cnt = 0
    for key, val in d.items():
        if val % 2 == 1:
            cnt += 1
    print(cnt)
main()



Measured memory_bytes: 88916
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

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

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(in.readLine());
      int[] seq = new int[n+2];
      seq[0] = seq[n+1] = 0;
      int[] d = new int[n+1];

      String line = in.readLine();
      char regex = ' ';
      boolean isContinue = true;
      for(int i=1, offset=0,next=0; isContinue; offset = ++next) {
        if((next = line.indexOf(regex,offset)) == -1) {
          next = line.length();
          isContinue = false;
        }
        seq[i++] = Integer.parseInt(line.substring(offset,next));
      }

      int sum=0;
      StringBuilder buf = new StringBuilder();
      for(int i=0; i<=n; i++) {
        sum += d[i] = Math.abs(seq[i+1] - seq[i]);
      }

      int ans=0;
      for(int i=1; i<=n; i++) {
        ans = sum;
        ans -= d[i-1];
        ans -= d[i];
        ans += Math.abs(seq[i+1] - seq[i-1]);
        buf.append(ans).append('\n');
      }

      System.out.print(buf);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
}

Measured memory_bytes: 43260
#include <stdio.h>

int main()
{
	int i, N, P, A[51];
	scanf("%d %d", &N, &P);
	for (i = 1; i <= N; i++) scanf("%d", &(A[i]));
	
	int sum = 0, parity = 0;
	for (i = 1; i <= N; i++) {
		sum += A[i];
		if (A[i] % 2 == 1) parity++;
	}
	
	long long ans = 1, tmp;
	for (i = 0, tmp = 1; i < N - parity; i++, tmp *= 2);
	ans *= tmp;
	for (i = 0, tmp = 1; i < parity - 1; i++, tmp *= 2);
	ans *= tmp;
	if (parity == 0) {
		if (P == 1) printf("0\n");
		else printf("%lld\n", ans);
	} else printf("%lld\n", ans);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

int main(){
    std::string s; std::cin >> s;
    int N = s.size();
    if (N < 3) {
        std::cout << 0 << std::endl;
        return 0;
    }
    int i_f = s.size() - 2;
    int over_hundred = 0;
    for (int i = 0; i < i_f; ++i)
        over_hundred += (s[N - 3 - i] - '0') * std::pow(10, i);
    int under_hundred = 0;
    if (((s[N - 1] - '0') + ((s[N - 2] - '0') * 10)) % 5 == 0)
       under_hundred = ((s[N - 1] - '0') + ((s[N - 2] - '0') * 10)) / 5;
    else
       under_hundred = (((s[N - 1] - '0') + ((s[N - 2] - '0') * 10)) / 5) + 1;
    if (under_hundred > over_hundred)
        std::cout << 0 << std::endl;
    else
        std::cout << 1 << std::endl;

    return 0;
}

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

int main() {
int N;
cin >> N;
vector<int> vec(N);
for (int i = 0; i < N; i++) {
   cin >> vec.at(i);
 }

sort(vec.begin(), vec.end());

double ans = vec.at(0);

for (int i = 1; i < N; i++) {
   ans = (ans + vec.at(i)) / 2.0;
}

cout << ans << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


set<int> SET;

int main(){

	int num_query;
	scanf("%d",&num_query);

	int command,x;

	for(int loop = 0; loop < num_query; loop++){

		scanf("%d %d",&command,&x);

		if(command == 0){

			SET.insert(x);
			printf("%lld\n",SET.size());

		}else if(command == 1){

			if(SET.count(x) > 0){

				printf("1\n");
			}else{

				printf("0\n");
			}
		}else{

			SET.erase(x);
		}
	}

	return 0;
}


Measured memory_bytes: 12492
def main(N,Q,C,LR,A):
    data = [0]*(N+1)
    def add(i,x):
        i+=1
        while i <= N:
            data[i]+= x
            i+=i&-i 
            #下桁から最初に1が出現するところまで拾う
            #111 -> 1 , 1100 -> 100 , 1010 -> 1
    def sum(a,b):
        r=0
        i=b
        while i>0:
            r+=data[i]
            i-=i&-i
        i=a
        while i>0:
            r-=data[i]
            i-=i&-i
        return r
    p=[-1]*N
    q=0
    a=[0]*Q
    for i in range(N):
        if p[C[i]-1]>=0:
            add(p[C[i]-1],-1)
        p[C[i]-1]=i
        add(i,1)
        while q<Q and LR[A[q]][1]==i+1:
            a[A[q]]=sum(LR[A[q]][0]-1,LR[A[q]][1])
            q+=1
    return a

import sys
if sys.argv[-1]=='ONLINE_JUDGE':
    from numba import*
    from numba.pycc import CC
    cc = CC('my_module')
  
    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return njit(f)
  
    main=cc_export(main,(i8,i8,i8[:],i8[:,:],i8[:]))
    cc.compile()
    exit()
  
def input(): return sys.stdin.buffer.readline()
N,Q=map(int, input().split())
import numpy as np
C=np.array(input().split(),dtype=np.int64)
#print(C)
LR_ = [0] * (Q*2)
for i in range(Q):
    LR_[i*2],LR_[i*2+1] = input().split()
LR=np.array(LR_, dtype=np.int64).reshape(Q,2)
#print(LR)
A=np.argsort(LR[:,1])

from my_module import main
print(*main(N,Q,C,LR,A),sep='\n')

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

int main(){
    int n;
    cin >> n;

    int N[3];
    N[0] = n/100;
    N[1] = n/10 - n/100*10;
    N[2] = n/1 - n/10*10;

    for(int i = 0; i < 3; i++)
    {
        if(N[i] == 9){
            N[i] = 1;
        }
        else
        {
            N[i] = 9;
        }        
    }

    n = N[0]*100 + N[1]*10 + N[2]*1;

    cout << n << endl;

}

Measured memory_bytes: 256
#include <cstdio>
using namespace std;
int a,b,c;
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	for(int i=b;i<=c;++i){
		if(i%a==0){
			puts("OK");
			return 0;
		}
	}
	puts("NG");
	return 0;
}

Measured memory_bytes: 1636
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;n>i;++i)
using namespace std;
using ll=int64_t;
using vi=vector<int>;
using VI=vector<ll>;
using vis=vector<string>;
using vvi=vector<vi>;
int gcd(int a,int b){
    if(a%b==0)
    return b;
    return gcd(b,a%b);
}
int main(){
    int s;
    cin>>s;
    int L=s/100;
    int R=s%100;
    if(1<=L&&L<=12){
        if(1<=R&&R<=12) cout<<"AMBIGUOUS"<<endl;
        else cout<<"MMYY"<<endl;
    }
    else{
        if(1<=R&&R<=12) cout<<"YYMM"<<endl;
        else cout<<"NA"<<endl;
    }
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
using namespace std;
typedef long long int ll;
int main()
{
	ll a,b;
	cin >> a >> b;

	if(a==b){
		cout << a << endl;
		return 0;
	}
	if(b-a==1){
		ll ans=a^b;
		cout << ans << endl;
		return 0;
	}
	
	if(a%2==0){
		if(b%2==0){
			ll cnt=(b-a)/2;
			ll ans=cnt%2;
			ans ^= b;
			cout << ans << endl;
		}else{
			ll cnt=(b+1-a)/2;
			ll ans=cnt%2;
//			ans = ans&b;
			cout << ans << endl;
		}
	}else{
		ll ans;
		a++;
		if(b%2==0){
			ll cnt=(b-a)/2;
			ans = cnt%2;
			ans ^= b;
		}else{
			ll cnt=(b+1-a)/2;
			ans = cnt%2;
		}
		ans ^= (a-1);
		cout << ans << endl;
	}

	return 0;
}

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

typedef struct{
	int name[300];
	int point[300];
	int rank[300];
} TEAM;

void bubble_sort(TEAM *ptr, int i);
void swap(int *a, int *b);

int main(void)
{
	TEAM PCK;
	int rank;
	int team_temp, point_temp;
	int i, j;
	
	i = 0;
	while (1){
		scanf("%d%*c%d", &team_temp, &point_temp);
		
		if (team_temp == 0 && point_temp == 0){
			break;
		}
		
		PCK.name[i] = team_temp;
		PCK.point[i] = point_temp;
		i++;
	}
	
	bubble_sort(&PCK, i);
	
	rank = 1;
	for (j = 0; j < i; j++){
		PCK.rank[j] = rank;
		if (j != i - 1 && PCK.point[j] != PCK.point[j + 1]){
			rank++;
		}
	}
	
	while (scanf("%d", &team_temp) != EOF){
		for (j = 0; j < i; j++){
			if (PCK.name[j] == team_temp){
				printf("%d\n", PCK.rank[j]);
			}
		}
	}
	
	return (0);
}

void bubble_sort(TEAM *ptr, int i){
	int j, k;
	
	for (j = 0; j < i - 1; j++){
		for (k = 0; k < i - j - 1; k++){
			if (ptr->point[k] < ptr->point[k + 1]){
				swap(&ptr->point[k], &ptr->point[k + 1]);
				swap(&ptr->name[k], &ptr->name[k + 1]);
			}
		}
	}
}

void swap(int *a, int *b){
	*a += *b;
	*b = *a - *b;
	*a = *a - *b;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

#include <set>
#include <map>
#include <iomanip>

using namespace std;

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

using ll = long long;

int main()
{
	ll N, M;
	cin >> N >> M;

	vector<ll> A(N);
	ll sum = 0;
	rep(i, M) {
		cin >> A[i];
		sum += A[i];
	}

	if (N < sum) {
		cout << -1 << endl;
	}
	else {
		cout << N - sum << endl;
	}


	return 0;
}

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

int main() {
	/*union {
		double x;
		long long int y;
	} ans;*/
	double ans;
	
	int n, k;
	
	cin >> n >> k;
	
	int win;
	
	for(int i = 1; i <= n; i++) {
		win = ceil(log2((double)k /i));
		//cout << "i = " << i << ": " << win << endl;
		if(win >= 1) {
			ans += pow(0.5, win);
		} else {
			ans += 1;
		}
	}
	
	ans /= n;
	
	cout << setprecision(25) << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>

using namespace std;
typedef long long ll;

void func(int times, ll &a, ll &b) {
    if (times % 2 == 1)a = a - b;
    else b = a + b;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    if (n < 100) {
        for (int i = 1; i <= n; i++)func(i, a, b);
        cout << a << " " << b << endl;
    } else {
        n %= 12;
        n += 120;
        for (int i = 1; i <= n; i++)func(i, a, b);
        cout << a << " " << b << endl;
    }
    return 0;
}



Measured memory_bytes: 3120
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author ExplodingFreeze
 */

#include <iostream>
#include <fstream>

#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=(a);i<(b);i++)
#define MOD 1000000007
using pii=std::pair<int,int>;

using namespace std;

int n,d[100005];
class CDivideTheProblems {
public:
	void solve(std::istream& in, std::ostream& out) {
		in >> n;
		f(i,0,n)
			in >> d[i];
		sort(d,d+n);
		out << d[n/2]-d[n/2-1] << "\n";
	}
};


int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	CDivideTheProblems solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 1024
n=int(input());a=list(map(int,input().split()));mod=10**9+7;x=m=1;z=0
for i in range(2,n):x=m=m*i%mod
for i in range(n):z=z+x*(a[i]-a[i-1])%mod;x=x+m*pow(i+1,mod-2,mod)%mod
print(z%mod)

Measured memory_bytes: 14252
x = list(map(int,input().split(" ")))
h = x[0]
w = x[1]

ans = 0
if h == 1:
    print(1)
elif w == 1:
    print(1)
elif h % 2 == 0:
    ans = int(h/2 * w)
    print(ans)
elif (h % 2 != 0) and (w % 2 == 0):
    ans = int(h * w/2)
    print(ans)
elif (h % 2 != 0) and (w % 2 != 0):
    ans = int((h//2 +1) * (w//2 +1)) + (h//2 * (w - 1 - w//2))
    print(int(ans))

Measured memory_bytes: 3064
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
#include <functional>
#include <random>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
typedef vector<vvpl> vvvpl;
typedef pair<ll, PL> TL;
typedef vector<TL> vtl;
typedef vector<vtl> vvtl;
const int INF = 1001001001;
const ll LINF = 1e18;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back
#define ALL(X) (X).begin(),(X).end()

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

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

inline ll popcnt(ll x){return __builtin_popcountll((unsigned long long)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
//friend bool operator<(const stc& lhs, const stc& rhs){
//    return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r);
//}



int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N; cin >> N; string S; cin >> S;
    string ans = "";
    rep(i, S.size()){
        char ni = S[i]-'A';
        ni = (ni+N)%26;
        ans += 'A'+ni;
    }
    cout << ans << endstr;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
const int INF = 1e9;
using namespace std;

vector<ll> divisor(ll n){
    vector<ll> 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(begin(ret),end(ret));
    return(ret);
}

signed main() {
    ll N; cin >> N;
    vector<ll> v=divisor(N);
    if(v.size()%2==0){
        cout << v[v.size()/2]+v[v.size()/2-1]-2 << endl;
    }else {
        cout << v[(v.size()-1)/2]*2-2 << endl;
    }
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

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

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

inline int test(int h, int m, int s){
  return h * 60 * 60 + m * 60 + s;
}

int main(){
  REP(i,3){
    int h = getInt();
    int m = getInt();
    int s = getInt();

    int t = test(h, m, s);

    int h2 = getInt();
    int m2 = getInt();
    int s2 = getInt();

    int t2 = test(h2, m2, s2);

    int diff = t2 - t;

    int hh = diff / (60 * 60); diff %= (60 * 60);
    int mm = diff / 60; diff %= 60;
    int ss = diff;

    cout << hh << " " << mm << " " << ss << endl;
    
  }
  return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;

void solve();
int main() {
	solve();
#ifdef DBG
	while (true);
#endif
}

void solve() {
	int h, w;
	scanf("%d %d", &h, &w);
	char s[50][51], c[50][50] = { 0 };
	for (int i = 0; i < h; i++)
		scanf("%s", s[i]);
	for (int i = 1; i < h; i++)
		for (int j = 0; j < w; j++)
			c[i - 1][j] += s[i][j] == '#';
	for (int i = 0; i < (h - 1); i++)
		for (int j = 0; j < w; j++)
			c[i + 1][j] += s[i][j] == '#';
	for (int i = 0; i < h; i++)
		for (int j = 1; j < w; j++)
			c[i][j - 1] += s[i][j] == '#';
	for (int i = 0; i < h; i++)
		for (int j = 0; j < (w - 1); j++)
			c[i][j + 1] += s[i][j] == '#';

	bool can = 1;
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
			if (s[i][j] == '#' && c[i][j] == 0)
				can = 0;
	printf("%s\n", can ? "Yes" : "No");
}

Measured memory_bytes: 128
n = int(input())
if n%10==0:
    print(10)
    exit(0)
ans = pow(10,10)
for a in range(n+1):
    b = n-a
    tmp_ans = 0

    for sa in str(a):
        tmp_ans += int(sa)

    for sb in str(b):
        tmp_ans += int(sb)

    ans = min(ans, tmp_ans)
print(ans)


Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cstdlib> 
#include<cstring>
using namespace std;
int read()
{
	int x=0,f=1; char c=getchar();
	while (c<'0'||c>'9') {if (c=='-') f=-1; c=getchar();}
	while (c>='0'&&c<='9') {x=x*10+c-'0';c=getchar();}
	return x*f;
}
char s[101000];
int main()
{
	scanf("%s",s+1);
	int ls=0;
	while (s[ls+1]) ls++;
	for (int i=1; i<=ls; i+=2) printf("%c",s[i]);
	return 0;
}

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

int main() {
  int N;
  string color, result;
  result = "Three";
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> color;
    
    if (color == "Y") {
      result = "Four";
    }
  }
  
  cout << result << endl;
}

Measured memory_bytes: 256
A,B,N=(int(x) for x in input().split())
#N=int(input())
#A=list(map(int, input().split()))

a=B-1
if a>N:
    x=int(A*N/B)-A*int(N/B)
else:
    x=int(A*a/B)-A*int(a/B)
print(x)

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

int main() {
  int N, M, C;
  cin >> N >> M >> C;

  vector<int> B;
  for (int i=0; i<M; i++) {
     int t;
     cin >> t;
     B.push_back(t);
  }

  int ans = 0;
  for (int i=0; i<N; i++) {
    int res=0;
    for (int j=0; j<M; j++) {
       int t;
       cin >> t;
       res += t*B[j];
    }
    res += C;
    if (res > 0)
      ans ++;
  }

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

Measured memory_bytes: 256
import numpy as np
import sys 
N,K = map(int, input().split())
A = np.array(sys.stdin.readline().split(), np.int64)
maxa = np.max(A)
mina = maxa // (K+1)
while maxa > mina + 1:
    mid = (maxa + mina)// 2
    div = np.sum(np.ceil(A/mid-1))
    if div > K:
        mina = mid
    else:
        maxa = mid

print(maxa)



Measured memory_bytes: 52588
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; }

long dif4(long a1, long a2, long a3, long a4){
	long max=a1, min=a1;
	if(max<a2) max=a2;
	if(max<a3) max=a3;
	if(max<a4) max=a4;
	if(min>a2) min=a2;
	if(min>a3) min=a3;
	if(min>a4) min=a4;
	return max-min;
}

int b[3][30];
int d[30][30];
int main(void){
	int n=nextint();
	int c=nextint();
	for(int i=0; i<c; i++){
		for(int j=0; j<c; j++){
			d[i][j]=nextint();
		}
	}
	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			int C=nextint()-1;
			b[(i+j)%3][C]++;
		}
	}
	int ans=INT_MAX;
	for(int i1=0; i1<c; i1++){
		for(int i2=0; i2<c; i2++) if(i2!=i1){
			for(int i3=0; i3<c; i3++) if(i3!=i1&&i3!=i2){
				int now=0;
				for(int i=0; i<c; i++){
					now += b[0][i]*d[i][i1];
					now += b[1][i]*d[i][i2];
					now += b[2][i]*d[i][i3];
				}
				if(now<ans) ans=now;
			}
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 1584
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

int main() {
  int n;
  cin >> n;
  ll ans = 0;
  FOR(i, 1, n + 1) {
    if (i % 3 == 0) continue;
    if (i % 5 == 0) continue;
    ans += i;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 3620