akhauriyash/Code-Regression huggingface dataset:
/*
		Author : Kaustubh Gangwar
		||S||A||M||R||A||T||
*/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ld long double
#define pb push_back
#define gcd __gcd
#define mp make_pair
#define vii vector<int>
#define vll vector<long long>
#define all(x) x.begin(),x.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define fe(i,a,b) for(int i=a;i<=b;i++)
typedef long long  ll;
typedef pair<int,int> pii;



int main()
{	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	
		
		int x;
		cin>>x;
		int a[x];
		int n=0;
		f(i,0,x)
		{	
		cin>>a[i];
		
		if(n<a[i])
		n=a[i];
		
		}
		
		vector<char> check(n+5, true);
		int freq[n+5]={0};
		f(i,0,x)
		{
		if(check[a[i]]) 
    	{
    	freq[a[i]]++;
        for(int j=2*a[i]; j <= n; j += a[i])
        check[j] = false;
    	}
		}
		
		int ans=0;
		f(i,0,x)
		{
			if(check[a[i]] && freq[a[i]]==1)
			ans++;
		}
		
		cout<<ans;
		
		
	
return 0;
}


Measured memory_bytes: 8868
#include <iostream>
#include <string>

using namespace std;

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

    for (const char c : s) {
        if (c == '7') {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3624
#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const int INF = 1000000;
const double PI=3.14159265359;


int main(){

  string s;cin>>s;
  string k="keyence";
  string ans=s;
  rep(i,0,k.size()+1){
    string t=s;
    t.erase(i,s.size()-k.size());
    if(t==k){
      out("YES");
      return 0;
    }
  }

  out("NO");


  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define loop(i, a, b) for(lli i=a; i<b; i++)
#define loopb(i, a, b) for(lli i=a; i>=b; i--)
#define pb push_back
#define umap unordered_map
typedef long long int lli;
typedef pair<lli, lli> pii;
typedef vector<lli> vll;
// use to avoid collision
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// for pair in unordered_map
struct hash_pair {
    static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
	}
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const{
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        uint64_t x = hash1 ^ hash2;
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
lli M = 1e9 + 7;
lli power(lli x, lli y){
    lli res = 1;
    x = x ;
    while (y > 0) {
        if (y & 1)
            res = (res*x)%M ;
        y = y>>1;
        x = (x*x)%M;
    }
    return res%M;
}
lli gcd(lli a, lli b, lli &x, lli& y){
	if(a == 0){
		x = 0;
		y = 1;
		return b;
	}
	lli x1, y1;
	lli d = gcd(b%a, a, x1, y1);
	x = y1 - (b/a)*x1;
	y = x1;
	return d;
}
lli solve(){
	lli a, b, n;
	cin>>a>>b>>n;
	lli mx = max(a, b);
	lli num = n / mx;
	if(num * mx >= n){
		cout<<num<<"\n";
	}
	else
		cout<<num+1<<"\n";
	return 0;
}
int main(){
	fastio;
	lli t;
	// cin>>t;
	t = 1;
	while(t>0){
		t--;
		solve();
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
	bool judge(int num[], int a, int b);
	int main(void){
		int num[12];
		for(int i = 0; i < 12; i++){
			cin >> num[i];
		}
		sort(num, num + 12);
		bool a, b, c;
		a = judge(num, 0, 3);
		b = judge(num, 4, 7);
		c = judge(num, 8, 11);
		if(a && b && c){
			cout << "yes" << endl;
		} else {
			cout << "no" << endl;
		}
		return 0;	
	}
	
	bool judge(int num[], int a, int b){
		int count = 0;
		for(int i = a + 1; i <= b; i++){
			if(num[a] == num[i]){
				count++;
			}
		}
		if(count == 3){
			return true;
		}else{
			return false;
		}
	}

Measured memory_bytes: 3156
/** Fucc :/
    [[[[[[[[[[]]]]]]]]]
    [[[[[[[:::::]]]]]]]
    [[               ]]
    [[               ]]
    [[      	     ]]
    [[   	         ]]
    [[   	         ]]
    [[        	     ]]
    [[[[[[[[[[]]]]]]]]]
    [[[[[[[:::::]]]]]]]
 - doanphuc : /
	** author: doanphuc. **
**/
#include <bits/stdc++.h>
#define TASK "COPRIMESET"
#define inpf freopen(TASK".inp", "r", stdin)
#define outf freopen(TASK".out", "w", stdout)
template<class T> T gcd(T a, T b) { T r; while (b != 0) { r = a % b; a = b; b = r; } return a; }
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define FOR(i,x,y) for(int i = x; i <= y ; i ++)
#define FORT(i,x,y) for(int i = x; i < y ; i ++)
#define FORD(i,x,y) for(int i = x; i >= y ; i --)
#define clean(x) memset(x, 0, sizeof(x))
#define F first
#define S second
#define maxn 100005
#define MOD 1000000007
#define pii pair<int,int>
#define ll long long
#define db double
#define mp make_pair
#define pb push_back
#define yes cout << "YES" << "\n"
#define no  cout << "NO" << "\n"
#define ct(x) cout << x << endl
#define bit(p,x) ((x>>p) & 1)
#define all(x) (x).begin(), (x).end()
#define resized(x) (x).resize(unique(all(x)) - (x).begin())
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int prime(int n){ for(int i=2;i*i<=n;i++) if(n%i==0)return 0;return 1; }
void InitPrime(){int pr[maxn] ; fill(pr + 1, pr + 1001, 1); pr[1] = 0; FOR(i, 2, 1000)if (pr[i]) for (int j = i + i; j <= 1000; j += i) pr[j] = 0;}
void AddMOD(int &x, int y){x += y; if (x >= MOD) x -= MOD; }
ll tinh(ll a, ll b,ll c){ if(b == 1) return a%c; ll x = tinh(a,b/2,c); ll y = (1ll*x * x) % c; if ( b % 2 != 0) y = (1ll*y*a) % c; return y;}
ll tinh2(ll a,ll n,ll mod=MOD){a=a<0?(mod-(-a)%mod):(a%mod);ll r=1;while(n){if(n&1)r=r*a%mod;a=a*a%mod;n>>=1;}return r;}
//void rr(){ vector <int> v (a+1, a+n+1); sort(v.begin(), v.end()); v.resize(unique(v.begin(), v.end()) - v.begin());for (int i = 1; i <= n; i++) a[i] = lower_bound(v.begin(), v.end(), a[i]) - v.begin() + 1;}
int n;
int main()
{
    cin >> n ;
    FOR(i,1,n) cout << "ACL" ;

}


Measured memory_bytes: 3440
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;

int main() {
	int N;
	string S;
	cin >> N >> S;

	int cnt = 0;
	for(int i  = 0; i <= N - 2; i++) {
		if(S.substr(i, 3) == "ABC") cnt++;
	}

	cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep2(i,m,n) for (int i = (m); i < (n); ++i)
#define rep(i,n) rep2(i,0,n)
typedef long long int ll;
typedef long double ld;
typedef pair<int, int> P;
template<typename T> struct V : vector<T> { using vector<T>::vector; };
V() -> V<int>;
V(size_t) -> V<int>;
template<typename T> V(size_t, T) -> V<T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
const int INF = 1<<30;
const ll LINF = 1LL<<61;
const ll MOD = 1000000007;
const int M = 80*80;
const int C = M * 2 + 1;
typedef bitset<C> bs;

int main()
{
    int h, w;
    cin >> h >> w;
    auto a = make_vec(h,w,0), b = make_vec(h,w,0);
    rep(i,h) rep(j,w) cin >> a[i][j];
    rep(i,h) rep(j,w) cin >> b[i][j];
    // bs dp[h][w];
    auto dp = make_vec(h+1,w+1,bs(0));
    dp[0][1][M] = 1; //i,j = 0,0でのみ使われる
    rep(i,h) rep(j,w) //dp[i+1][j+1] f(dp[i+1][j], dp[i][j+1])
    {
        int d = abs(a[i][j] - b[i][j]);
        dp[i+1][j+1] |= dp[i+1][j] >> d;
        dp[i+1][j+1] |= dp[i+1][j] << d;
        dp[i+1][j+1] |= dp[i][j+1] >> d;
        dp[i+1][j+1] |= dp[i][j+1] << d;
    }
    int ans = INF;
    rep(i,C) if(dp[h][w][i]) chmin(ans, abs(i - M));
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 13740
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace AtCoder
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            var a = inputLongArray[0];
            var b = inputLongArray[1];
            var c = inputLongArray[2];

            int count = 0;

            if(c != b && c != a) {
                ++count;
			}

            if(b != a) {
                ++count;
			}

            ++count;

            Console.WriteLine(count);
        }
    }
}

Measured memory_bytes: 18840
a,b,k=map(int,input().split())
from fractions import gcd
def make_divisor_list(num):
    if num<1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor=[]
        divisor.append(1)
        for i in range(2,num//2+1):
            if num%i==0:
                divisor.append(i)
        divisor.append(num)

        return divisor
l=make_divisor_list(gcd(a,b))
print(l[-k])


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

int main(){
    int n,all; cin>>n;
    int a[n];
    rep(i,n){
        cin>>a[i];
        (i==0) ? all=a[i] : all=all^a[i];
    }
    rep(i,n) cout<<(all^a[i])<<endl;
}

Measured memory_bytes: 4424
package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var s, t, u string
	var a, b int
	Fscan(in, &s, &t, &a, &b, &u)
	if u == s {
		a--
	} else {
		b--
	}
	Fprintln(out, a, b)
}

func main() { run(os.Stdin, os.Stdout) }


Measured memory_bytes: 640
#include<bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<stdlib.h>
//#include<string.h>
//#include<algorithm>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define READ freopen("in.txt","r",stdin)
#define WRITE freopen("out.txt","w",stdout);
#define pb push_back
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define sf(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sl2(x,y) scanf("%lld %lld",&x,&y)

#define sl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x);
#define pLL pair<long long,long long>
#define pDB pair<double,double>
#define ff first
#define sn second
#define PRINT_CASE  printf("Case %d: ",tc++)
#define PRINT_CASENL  printf("Case %d:\n",tc++)
//#define mx 100005
#define lnd tree[ind<<1]
#define rnd tree[(ind<<1)+1]
#define cnd tree[ind]
#define lndp b,(b+e)>>1,(ind<<1)
#define rndp ((b+e)>>1)+1,e,(ind<<1)+1
#define IN(a,x,y) (a>=x && a<=y)
#define popcountL __builtin_popcountll
#define popcount __builtin_popcount
/// int other=mask^((1<<n)-1);
typedef long long ll;
typedef long long int lln;
typedef pair<int,int> pii;
ll INF=1<<28;
//typedef long long lld;
const double PI=acos(-1.0);
//int fx[]={1,-1,0,0}; //direction array
//int fy[]={0,0,1,-1};
int dir[4][2]={1,0,-1,0,0,-1,0,1};
int knight[8][2]={1,2,1,-2,2,1,2,-1,-1,2,-1,-2,-2,1,-2,-1};
const long double EPS=1e-7;
//#define INF 10000

struct compare
{
  bool operator()(const pair<int,pii>& l, const pair<int,pii>& r)
  {
      if(l.ff==r.ff)
      {
          return l.sn.ff>r.sn.ff;
      }
      return l.ff<r.ff;
  }
};
// bool operator<(pair<int,pii> l, pair<int,pii> r)
//  {
//      if(l.ff==r.ff)
//      {
//          cout<<"ok "<<endl;
//          return l.sn.ff<r.sn.ff;
//      }
//      return l.ff>r.ff;
//  }

/////////////////////////////////////template sesh/////////////////////////////////////////////////////

///code goes from here
const int mx=1000150;
///
ll mod=1e9+7;
int arr[3010][3010];
ll dp[3010][3010][4];
int n,m;
ll fun(int x,int y,int k)
{
    if(x>n || y>m)
        return -INT_MAX;
    if(x==n && y==m)
    {
        if(k<3)
            return arr[x][y];
        return 0;
    }
    ll &ret=dp[x][y][k];
    if(ret!=-1)
        return ret;
    ret=0;
    ret=fun(x,y+1,k);
    ret=max(ret,fun(x+1,y,0));
    if(k<3)
    {
        ret=max(ret,arr[x][y]+fun(x,y+1,k+1));
        ret=max(ret,arr[x][y]+fun(x+1,y,0));
    }
    return ret;
}
int main()
{
//    SPEED;
    int t,tc=1;
//    sf(t);
    mem(dp,-1);
    t=1;
    while(t--)
    {
        int k;
        sf3(n,m,k);
        int x,y,z;
        for(int i=0;i<k;i++)
        {
            sf3(x,y,z);
            arr[x][y]=z;
        }
        cout<<fun(1,1,0)<<endl;

    }


    return 0;
}



Measured memory_bytes: 322516
from collections import deque
n = int(input())
arg = input()

q = deque()
for s in arg:
    if len(q) == 0:
        q.append(s)
    else:
        if q[-1] == '(' and s == ')':
            q.pop()
        else:
            q.append(s)
l = 0
r = 0
for i in range(len(q)):
    st = q.pop()
    if st == '(':
        r += 1
    else:
        l += 1
print('(' * l + arg + ')' * r)

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

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

  if ((a + b) % 2 == 0)
    cout << (a + b) / 2 << endl;
  else
   cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 3604
#include<iostream>
#include<map>
using namespace std;
int main()
{
	map<unsigned long,unsigned long> mp;
	int n, q, a, b, c;
	int i, j, k;

	unsigned long tmp = 0;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a;
		mp[a]++;
		tmp += a;
	}

	cin >> q;
	unsigned long *ans = new unsigned long[q];
	for (i = 0; i < q; i++) {
		cin >> b >> c;
		tmp -= b * mp[b];
		tmp += c * mp[b];
		mp[c] += mp[b];
		mp[b] = 0;
		ans[i] = tmp;
	}

	for (i = 0; i < q; i++) {
		cout << ans[i] << endl;
	}

	return 0;
}


Measured memory_bytes: 10140
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

int main(){cout<<fixed<<setprecision(10);
		   //偶奇が一致しないもの/2
           int n;
           cin>>n;
           vector<pair<int,int>> a(n);//a[i],偶奇(0index) 
           rep(i,0,n){
            cin>>a[i].first;
             a[i].second=i%2;
           }
           sort(all(a));
           int ans=0;
           rep(i,0,n){
            if(a[i].second!=i%2)ans++;
           }
           cout<<ans/2<<endl;
}

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



int main(){
	int N;
	cin>>N;
	vector <long long> dist(N,0);
	long long D;
	cin >>D;
	dist.at(D)++;
	if(D!=0){
		cout<<0<<endl;
	}
	
	else{
	for(int i=1;i<N;i++){
		cin >>D;
		dist.at(D)++;
	}
	
	// for(int i=0;i<N;i++){
		// cout<<i<<":"<<dist.at(i)<<endl;
	// }
	
	long long count =0;
	if(dist.at(0)!=1){
		cout<<0<<endl;
	}
	else{
		bool pro = true;
		bool pro2 = true;
		int p=0;
		int k=0;
		while(pro){
			k++;
			// cout<<k<<endl;
			if(dist.at(k)==0){
				pro=false;
				p=k;
			}
			if(k==N-1){
				break;
			}
			
		}
		// cout<<"p:"<<p<<endl;
		if(k<N-1){
			while(pro2){
				k++;
				if(k==N){
					break;
				}
				if(dist.at(k)!=0){
					pro2=false;
				}
			}
		}
		
		if(!pro2){
			cout<<0<<endl;
			
		}
		else{
			count=dist.at(0);
			long long temp;
			long long prime = 998244353;
			for(int i=0;i<p-1;i++){
				temp=1;
				
				for (int j=0;j<dist.at(i+1);j++){
					temp=temp*dist.at(i);
					temp=temp%prime;
				}
				
				count=count*temp;
				count = count%prime;
			}
			cout<<count<<endl;
			// cout<<"1"<<endl;
		}
		
	}
	}
	return 0;
}

	

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long


using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);	
    cin.tie(NULL); cout.tie(NULL);
    
    ll a, b, n; cin >> a >> b >> n;
    
    if(n >= b-1)
    {
		cout << (a*(b-1))/b << '\n';
	}else{
		cout << (a*n)/b << '\n';
	}
	
	
    
    return 0;
}



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

long func(const vector<int>& a)
{
    long res=0;
    long s=a[0];
    for(int i=1; i<a.size(); ++i) {
        if (s<0 and s+a[i]<=0) {
            res+=-(s+a[i])+1;
            s=1;
        }
        else if (s>0 and s+a[i]>=0) {
            res+=s+a[i]+1;
            s=-1;
        }
        else {
            s+=a[i];
        }
    }
    return res;
}

int main()
{
    int n; cin>>n;
    vector<int> a(n); for(int& e: a) cin>>e;
    auto b=a;
    if (a[0]!=0) {
        b[0]=a[0]>0 ? -1 : 1;
        cout<<min(func(a), func(b)+abs(a[0])+1)<<endl;
    }
    else {
        a[0]=1;
        b[0]=-1;
        cout<<min(func(a), func(b))+1<<endl;
    }
}



Measured memory_bytes: 1024
// Ver19.02
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  char s[20];
  scanf("%s",s);
  int date_number = (s[5]-'0')*1000+(s[6]-'0')*100+(s[8]-'0')*10+s[9]-'0';
  if(date_number<=430) puts("Heisei");
  else puts("TBD");
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
#define fi first
#define se second
#define upb upper_bound
#define lwb lower_bound
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y){
    if(y<=0) return 1;
    ll ans = 1;
    x %= mod;
    while(y){
        if(y&1)
            ans = (x * ans) % mod;
        x = (x * x) % mod;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = (a - b); if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = (a + b); if(c >= mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

//------------------------------------------------------------------------------------------

//const ll N = 2e5 + 1;
//vector<ll> adj[N];
//bool visited[N];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<<fixed<<setprecision(10);

	ll n, k;
	cin>>n>>k;
	ll a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=k;i<n;i++){
		if(a[i-k]<a[i]) cout<<"Yes\n";
		else cout<<"No\n";
	}


    return 0;
}


Measured memory_bytes: 5180
#include<stdio.h>
#include<stdlib.h>
int count = 0;

void binarySearch(int *S,int left,int right,int target){
    if(left>right){
        //printf("%d is not found\n",target);
        return;
    }
    int mid = (left+right)/2;
    //printf("mid???%d\n",mid);
    if(S[mid]==target){
        //printf("%d is found! It is at %d\n",target,mid);
        count++;
        return;
    }else{
        if(target>S[mid]){
            //printf("target%d>S[mid]%d????????????????????????\n",target,S[mid]);
            binarySearch(S,mid+1,right,target);
        }else{
            //printf("target%d<S[mid]%d????????????????????????\n",target,S[mid]);
            binarySearch(S,left,mid-1,target);
        }
    }
}

int main(){
    int n,q,i;
    int *S,*T;
    scanf("%d",&n);
    S = (int *)malloc(sizeof(int)*n);
    for(i=0;i<n;i++)scanf("%d",&S[i]);
    scanf("%d",&q);
    T = (int *)malloc(sizeof(int)*q);
    for(i=0;i<q;i++)scanf("%d",&T[i]);
    /*
    for(i=0;i<n;i++){
        if(i==0){
            printf("%d",S[i]);
        }else{
            printf(" %d",S[i]);
        }
    }
    */
    
    
    
    for(i=0;i<q;i++){
        binarySearch(S,0,n-1,T[i]);
    }
    
    printf("%d\n",count);
    
    return 0;
}

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

using namespace std;

typedef short sho;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
typedef string str; 
 
typedef pair<int,int> pii;
typedef pair<ll,ll> pll; 
typedef pair<ld,ld> pld;
 
typedef vector<int> vi; 
typedef vector<ll> vl; 
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pld> vpd;

#define STDIO
#define MP make_pair 
#define FF first
#define SS second
#define sz(x) (int)x.size()
#define begin(x) (x).begin() 
#define end(x) (x).end()
#define rbegin(x) (x).rbegin()
#define rend(x) (x).rend()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define PF push_front 
#define PB push_back
#define PP push
#define lb lower_bound 
#define ub upper_bound

inline void checkmin(int &x, int y){x = min(x, y);}
inline void checkmax(int &x, int y){x = max(x, y);}

string s;

bool isp(string a)
{
	string b=a;
	reverse(all(a));
	return a==b;
}

int main() 
{
	#ifndef STDIO
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /* start code */
    cin>>s;
    if(!isp(s)) cout<<"No\n";
    else
    {
    	string a=s.substr(0,(sz(s)-1)/2);
    	string b=s.substr((sz(s)+3)/2-1);
    	if(!isp(a)||!isp(b)) cout<<"No\n";
    	else cout<<"Yes\n";
	}
    /* end code */
	return 0;
}

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

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

  vector<vector<int>> inputs(m, vector<int>(2));
  for (int i = 0; i < m; ++i) {
    cin >> inputs[i][0] >> inputs[i][1];
  }

  int cnt = m;
  for (int i = 0; i < m; ++i) {
    map<int, vector<int>> edge;
    for (int j = 0; j < m; ++j) {
      if (i == j) continue;
      edge[inputs[j][0]].push_back(inputs[j][1]);
      edge[inputs[j][1]].push_back(inputs[j][0]);
    }
    
    int start = inputs[i][0];
    int goal = inputs[i][1];
    
    queue<int> que;
    que.push(start);
    unordered_set<int> visited;
    visited.insert(start);
    
    while (!que.empty()) {
      int curr = que.front();
      que.pop();
      if (curr == goal) {
        --cnt;
        break;
      }
      for (int next : edge[curr]) {
        if (visited.find(next) != visited.end()) continue;
        que.push(next);
        visited.insert(next);
      }
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;

	int s = 0;

	if (a < 0)
	{
		s += abs(a) * c;

		a = 0;
	}

	if (a >= 0)
	{
		if (a == 0)
		{
			s += d;
		}

		s += (b - a) * e;
	}

	cout << s << endl;
}


Measured memory_bytes: 3088
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();
    
    System.out.println(c + " " + a +" "+  b);
	}
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll a, b;
  char op;
  cin >> a >> op >> b;

  if (op == '+') cout << a + b << endl;
  else cout << a - b << endl;

  return 0;
}


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

#define rep(i,n) for (int i = 0; i < (n); ++i)


void solve(std::string S, std::string T){
    ll ans = 1e8;
    rep(i,S.size()){
        ll cnt = 0;
        if(i+T.size() > S.size()) break;
        rep(j,T.size()){
            if(S[i+j] != T[j]) cnt++;
        }
        ans = min(ans, cnt);
    }

    cout << ans << endl;
}

int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


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

int main(){
    int N, A[1001];

    cin >> N;

    bool result = true;
    for(int i=0; i<N; i++){
        cin >> A[i];
    }
    for(int i=0; i<N; i++){
        if(A[i]%2==0){
            if(A[i]%5==0 || A[i]%3==0){
                result = true;
            }
            else{
                result = false;
                break;
            }
        }
    }
    if(result){
        cout << "APPROVED" << endl;
    }
    else{
        cout << "DENIED" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
N,X = map(int,input().split())
L = list(map(int,input().split()))
L.insert(0,0)
sum = 0
c = 0
for i in range(1,N+1):
    sum += L[i]
    if sum > X:
        c=1
        break
if c == 1:
    print(i)
else:
    print(i+1)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
using namespace std;
long long n,m,i,j,dp[55][55],fr[55],to[55],ans;
bool check(long long x)
{
	long long i,j,k;
	memset(dp,0,sizeof(dp));
	for (i=1;i<=n;i++)
	{
		dp[i][fr[i]]=1;
		for (j=50;j>=1;j--)
		{
			if (!((1ll<<j)&x)) continue;
			for (k=j;k<=50;k++)
			{
				if (!dp[i][k]) continue;
				dp[i][k%j]=1;
			}
		}
		if (!dp[i][to[i]]) return 0;
	}
	return 1;
}
int main()
{
	cin>>n;
	for (i=1;i<=n;i++)
	{
		cin>>fr[i];
	}
	for (i=1;i<=n;i++)
	{
		cin>>to[i];
	}
	for (i=1;i<=n;i++)
	{
		if (to[i]!=fr[i]&&to[i]*2>=fr[i])
		{
			cout<<-1;
			return 0;
		}
	}
	for (i=1;i<=50;i++) ans|=(1ll<<i);
	for (i=50;i;i--)
	{
		if (ans>=(1ll<<i)&&check(ans-(1ll<<i))) ans-=(1ll<<i);
	}
	cout<<ans;
	return 0;
}

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

int main(){
  int H,W; cin >> H >> W;
  vector<vector<char>> V(H, vector<char>(W));

  struct Pos{int cnt,x,y;Pos(int c,int x,int y):cnt(c),x(x),y(y){}};
  
  queue<Pos> que;
  
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> V[i][j];
      if(V[i][j] == '#')que.push(Pos(0,j,i));
    }
  }

  int lastCnt = 0;
  while(!que.empty()){
    Pos now = que.front();
    lastCnt = now.cnt;
    que.pop();
    int dx[4] = {-1,0,0,1};
    int dy[4] = {0,-1,1,0};
    for(int i = 0 ; i < 4; ++i){
      if(now.x + dx[i] < 0 || now.x + dx[i] >= W
	 || now.y + dy[i] < 0 || now.y + dy[i] >= H || V[now.y+dy[i]][now.x+dx[i]] == '#')
	continue;
      V[now.y+dy[i]][now.x+dx[i]] = '#';
      que.push(Pos(now.cnt + 1,now.x + dx[i],now.y + dy[i]));
      
    }
  }

  cout << lastCnt << endl;

  return 0;  
}


Measured memory_bytes: 13328
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 998244353
typedef long long ll;
using namespace std;

#define MAX_N 200020
ll inv[MAX_N+10],fac[MAX_N+10],ifac[MAX_N+10];

void setComb(){
  inv[0]=1;inv[1]=1;fac[1]=1;ifac[1]=1;fac[0]=1;ifac[0]=1;
  for(int i=2;i<MAX_N;i++){
    inv[i]=(-MOD/i)*inv[MOD%i]%MOD;
    fac[i]=fac[i-1]*i%MOD;
    ifac[i]=ifac[i-1]*inv[i]%MOD;
  }
  return;
}

ll comb(ll n,ll k){
  if(n<k||n<0||k<0) return 0;
  else return ((fac[n]*ifac[k]%MOD*ifac[n-k]%MOD+MOD)%MOD);
}

ll hcomb(ll n,ll k){
  if(n==0&&k==0) return 1;
  else if(n<0||k<0) return 0;
  else return comb(n+k-1,k);
}


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

  ll two[2*K+1]={};
  two[0]=1;
  for(int i=1;i<=2*K;i++) two[i]=two[i-1]*2%MOD;
  setComb();

  for(int i=2;i<=2*K;i++){
    int x=0;
    for(int j=1;j<i&&j<=K;j++){
      if(j>i-j) break;
      if(i-j<=K) x++;
    }
    ll ans=0;
    if(i%2==0){
      x--;
      for(int y=0;y<=x;y++){
        ll res=two[y]*comb(x,y)%MOD;
        ll z=hcomb(K-2*x+y-1,N-y-1);
        ll w=hcomb(K-2*x+y-1,N-y);
        res=((z+w)%MOD)*res%MOD;
        ans=(ans+res)%MOD;
      }
    }else{
      for(int y=0;y<=x;y++){
        ll res=two[y]*comb(x,y)%MOD;
        res=res*hcomb(K-2*x+y,N-y)%MOD;
        ans=(ans+res)%MOD;
      }
    }
    cout<<(ans+MOD)%MOD<<endl;
  }

  return 0;
}


Measured memory_bytes: 4992
#include <stdio.h>

int main()
{
	int i, r, D;
	long long x;
	scanf("%d %d %lld", &r, &D, &x);
	for (i = 1; i <= 10; i++) {
		x = x * r - D;
		printf("%lld\n", x);
	}
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1732
#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <unordered_map>

bool check_anagram(std::string a, std::string b) {
  std::array<unsigned int, 'z' - 'a' + 1> alphabet_counter_a;
  std::array<unsigned int, 'z' - 'a' + 1> alphabet_counter_b;
  alphabet_counter_a.fill(0);
  alphabet_counter_b.fill(0);
  for (int i = 0; i < 10; ++i) {
    alphabet_counter_a.at(a[i] - 'a') += 1;
    alphabet_counter_b.at(b[i] - 'a') += 1;
  }

  if (alphabet_counter_a == alphabet_counter_b) {
    return true;
  } else {
    return false;
  }
}

int main() {
  int N;
  std::cin >> N;
  std::vector<std::string> s_array(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> s_array.at(i);
  }

  std::unordered_map<std::string, long> s_map;
  for (int i = 0; i < N; ++i) {
    std::string s = s_array.at(i);
    std::array<unsigned int, 'z' - 'a' + 1> alphabet_counter;
    alphabet_counter.fill(0);
    for (int i = 0; i < 10; ++i) {
      alphabet_counter.at(s[i] - 'a') += 1;
    }
    std::string key_string = "";
    for (const auto x : alphabet_counter) {
      key_string += std::to_string(x);
    }

    if (s_map.count(key_string) == 0) {
      s_map.emplace(key_string, 1);
    } else {
      s_map.at(key_string) += 1;
    }
  }

  long long sum = 0;
  for (auto x : s_map) {
    const long long n = x.second;
    sum += n * (n - 1) / 2;
  }

  std::cout << sum << std::endl;

  return 0;
}


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

int main()
{
	int N;
	cin >> N;
	vector<long long> L( N );
	for( int i = 0; i < N; i++ ) {
		cin >> L[i];
	}

	int ans = 0;
	for( int i = 0; i < N; i++ ) {
		for( int j = i + 1; j < N; j++ ) {
			for( int k = j + 1; k < N; k++ ) {
				if( L[i] != L[j] && L[j] != L[k] && L[k] != L[i] ) {
					long long ma = max( L[i], max( L[j], L[k] ) );
					if( ma == L[i] && L[i] < L[j] +L[k] ||
						ma == L[j] && L[j] < L[i] + L[k] ||
						ma == L[k] && L[k] < L[i] + L[j] ) {
						ans++;
					}
				}
			}
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
char s[200];
int f1(int n[],int num)
{
	int sum=0;
	sum+=n[0];
	sum+=9*(num-1);
//	printf("f1: %d\n",sum);
	if(sum<0) sum=0;
	return sum;
}
int f2(int n[],int num)
{
	int sum=0;
	sum+=(n[0]-1)*9*(num-1);
	sum+=9*9*(num-1)*(num-2)/2;
	int i1,n2[200];
	for(i1=1;n[i1]==0;i1++);
	for(int i=i1;i<num;i++)
	{
		n2[i-i1]=n[i];
	}
//	printf("f2: %d\n",sum);
	sum+=f1(n2,num-i1);
	if(sum<0) sum=0;
	return sum;
}
int f3(int n[],int num)
{
	int sum=0;
	sum+=(n[0]-1)*9*9*(num-1)*(num-2)/2;
	sum+=9*9*9*(num-1)*(num-2)*(num-3)/6;
	int i1,n2[200];
	for(i1=1;n[i1]==0;i1++);
	for(int i=i1;i<num;i++)
	{
		n2[i-i1]=n[i];
	}
//	printf("f3: %d\n",sum);
	sum+=f2(n2,num-i1);
	return sum;
}
int main(void)
{
	scanf("%s",s);
	int n[200];
	for(int i=0;i<strlen(s);i++)
	{
		n[i]=s[i]-'0';
	}
	int k,sum=0,num=strlen(s);
	scanf("%d",&k);
//	printf("%d ",num);
	if(k==1)
	{
		sum=f1(n,num);
	}
	else if(k==2&&num>1)
	{
		sum=f2(n,num);
	}
	else if(k==3&&num>2)
	{
		sum=f3(n,num);
	}
	printf("%d",sum);
}

Measured memory_bytes: 256
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_087_B.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 i      PIC 9(2).
    01 j      PIC 9(2).
    01 k      PIC 9(2).
    01 A      PIC 9(2).
    01 B      PIC 9(2).
    01 C      PIC 9(2).
    01 X      PIC 9(5).
    01 cnt    PIC 9(5) VALUE 0.
    01 ZS     PIC Z(4)9.
    01 ans    PIC X(4).
    01 val    PIC 9(5).
    01 DUMMY  PIC X(1).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT A.
    ACCEPT B.
    ACCEPT C.
    ACCEPT X.

    PERFORM VARYING i FROM 0 BY 1 UNTIL A < i
        PERFORM VARYING j FROM 0 BY 1 UNTIL B < j
            PERFORM VARYING k FROM 0 BY 1 UNTIL C < k
                COMPUTE val = 500 * i + 100 * j + 50 * k
                IF val = X THEN
                    ADD 1 TO cnt
                END-IF
            END-PERFORM
        END-PERFORM
    END-PERFORM.

    MOVE cnt TO ZS.

    PERFORM UNANS.

    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.


Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, D, L, R;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> D;
  L = A + B;
  R = C + D;
  
  if (L == R){
	cout << "Balanced" << endl;
  }
  else if (L > R){
	cout << "Left" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m;
int main(){
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;++i){
        if(i&1)printf("%d %d\n",m+2+i/2,2*m+1-i/2);
        else printf("%d %d\n",1+i/2,m+1-i/2);
    }
    return 0;
}


Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long int a,b;
  cin>>a>>b;
  long long int arr[a];
  for(int x=0; x<a; x++){
    cin>>arr[x];
    }
  long long int dp[a];
 for(int x=0; x<a; x++){
     dp[x]=1000000000;
 }
 dp[0]=0;
  for(int x=1; x<a; x++){
      for(int y=x-1; y>=x-b && y>=0; y--){
    dp[x]=min(dp[y]+abs(arr[x]-arr[y]),dp[x]);
  }
}
cout<<dp[a-1];
}


Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 60;
#define int long long

const int MAX_N = 100010;

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	string s; cin >> s;
	rep(i, s.size()) {
		int tmp = s[i] + n;
		if (tmp >= 91)tmp -= 26;
		s[i] = (char)tmp;
	}
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
import sys

def solve(n, m, l, r):
    l_max = max(l)
    r_min = min(r)
    if l_max > r_min:
        return 0
    else:
        return r_min - l_max + 1


if __name__ == '__main__':

    n, m = map(int, sys.stdin.readline().strip().split(" "))
    l = []
    r = []
    for i in range(m):
        l_tmp, r_tmp = map(int, sys.stdin.readline().strip().split(" "))
        l.append(l_tmp)
        r.append(r_tmp)
    print solve(n, m, l, r)

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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let ans = if solve() {"Yes"} else {"No"};

    println!("{}", ans);
}

fn solve() -> bool {
    input! {
        n: usize,
        a: usize1,
        b: usize1,
        c: usize1,
        d: usize1,
        s: chars,
    }

    if c > d {
        let mut ok = false;
        for i in b..d+1 {
            if s[i-1] != '#' && s[i] != '#' && s[i+1] != '#' {
                ok = true;
                break;
            }
        }

        if !ok {
            return false;
        }
    }

    for i in a..c {
        if s[i] == '#' && s[i+1] == '#' {
            return false;
        }
    }

    for i in b..d {
        if s[i] == '#' && s[i+1] == '#' {
            return false;
        }
    }

    return true;
}


Measured memory_bytes: 4352
from itertools import product
p=4
n,a,b,c=map(int,input().split())
banboo=[0]*n
for i in range(n):
    banboo[i]=int(input())

Bit_4=list(product(range(p),repeat=n))
ans=10**6
for Bi in Bit_4:
    tmp=[0]*4
    magic=0
    if 1 in Bi and 2 in Bi and 3 in Bi:
        for i in range(n):
            tmp[Bi[i]]+=banboo[i]
            if tmp[Bi[i]]!=banboo[i] and Bi[i]!=0:
                magic+=10
        magic+=abs(tmp[1]-a)
        magic+=abs(tmp[2]-b)
        magic+=abs(tmp[3]-c)
        ans=min(magic,ans)
print(ans)

Measured memory_bytes: 16976
#include <bits/stdc++.h>
using namespace std;
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; }

int main() {
    int k, a, b;
    cin >> k >> a >> b;
    int res = (b / k) - ((a - 1) / k);
    
    cout << (res ? "OK" : "NG") << '\n';
    
    return 0;
}

Measured memory_bytes: 3636
// practice with kaiboy
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	int[] ii = new int[60];
	int[] jj = new int[60];
	int[] ww = new int[60];
	int m;
	void add(int i, int j, int w) {
		ii[m] = i; jj[m] = j; ww[m] = w; m++;
	}
	void main() {
		int l = sc.nextInt();
		int k = 0;
		while (1 << k + 1 <= l)
			k++;
		for (int i = 0; i < k; i++) {
			int j = i + 1;
			add(i, j, 0);
			add(i, j, 1 << i);
		}
		for (int i = 0; i < k; i++)
			if ((l & 1 << i) != 0)
				add(i, k, l ^= 1 << i);
		println(k + 1 + " " + m);
		while (m-- > 0)
			println((ii[m] + 1) + " " + (jj[m] + 1) + " " + ww[m]);
	}
}


Measured memory_bytes: 40340
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
using namespace std;

typedef long long ll;
typedef long double ld;

int main(){
  ll n,m;
  cin >> n >> m;
  vector<ll> arr(n);
  for(ll i=0;i<n;i++){
    cin >> arr[i];
  }
  vector<ll> arr1;
  arr1.resize(n,1);

  while(m--){
    ll a,b;
    cin >> a >> b;
    if(arr[b-1]>arr[a-1]){
      arr1[a-1]=0;
    }
    else if(arr[a-1]>arr[b-1]){
      arr1[b-1]=0;
    }
    else{
      arr1[b-1]=0;
      arr1[a-1]=0;
    }
  }
  ll count =0;
  for(ll i=0;i<n;i++){
    if(arr1[i]==1){
      count +=1;
    }
  }
  cout << count;
 
}

Measured memory_bytes: 4796
#include<stdio.h>

int main(void)
{
    int m,count;

    while(scanf("%d",&m),m){

count=0;

    m=1000-m;
    count+=m/500;
    m%=500;
    count+=m/100;
    m%=100;
    count+=m/50;
    m%=50;
    count+=m/10;
    m%=10;
    count+=m/5;
    m%=5;
    count+=m/1;
    m%=1;
    printf("%d\n",count);
}
    return 0;

}

Measured memory_bytes: 600
/* Bubble Sort */
#include <stdio.h>
#include <stdlib.h>

int bubbleSort(int* A, int N) { 
  int flag = 1; // 逆の隣接要素が存在する
  int counter = 0;

  while (flag) {
    int j;

    flag = 0;
    for (j=N-1; j>=1; j--) {
      if (A[j] < A[j-1]) {
	int tmp = A[j];
	A[j] = A[j-1];
	A[j-1] = tmp;
	
	flag = 1;
	counter++;
      }
    }
  }

  return counter;
}

int main(void) {
  int A[100]; // 数列
  int N; // 数列の長さ
  int i;
  int count; // 交換回数
  
  scanf("%d", &N);

  // 数列読み込み
  for (i=0; i<N; i++)
    scanf("%d", &A[i]);

  count = bubbleSort(A, N);

  for (i=0; i<N; i++) {
    printf("%d", A[i]);
    if (i != N-1)
      putchar(' ');
  }
  putchar('\n');

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

  return 0;
}

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

using namespace std;
//using namespace __gnu_pbds;

#define ll  long long
#define PR  pair<int, int>

const int N = 10;
const int MOD = 1e9 + 7;
const long long INF = 5e18;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int n, m, k;
string s[N], tmp[N];

bool check(int maskR, int maskC) {
    for (int i = 0; i < n; i++) {
        tmp[i] = s[i];
    }
    for (int i = 0; i < n; i++) {
        if (maskR & (1 << i)) {
            for (int j = 0; j < m; j++) {
                tmp[i][j] = 'R';
            }
        }
    }
    for (int i = 0; i < m; i++) {
        if (maskC & (1 << i)) {
            for (int j = 0; j < n; j++) {
                tmp[j][i] = 'R';
            }
        }
    }
//    cout << '\n' << maskR << " " << maskC << '\n';
    int b = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (tmp[i][j] == '#') {
                b++;
            }
        }
//        cout << tmp[i] << '\n';
    }
//    cout << '\n';
    return b == k;
}

int main() {
//    ios::sync_with_stdio(false);
//    cin.tie(0);
    cin >> n >> m >> k;
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    ll ans = 0;
    for (int i = 0; i < (1 << n); i++) {
        for (int j = 0; j < (1 << m); j++) {
            if (check(i, j)) {
                ans++;
            }
        }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define dump(x) cout << (x) << endl
#define LMAX 9223372036854775807LL
#define LMIN -9223372036854775807LL
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T *)array, (T *)(array + N), val);
}

const ll INF = 1e18;
const ll mod = 1e9 + 7;


int main(){
    ll n, k;
    cin >> n >> k;
    ll l = 2 * k;
    vector<vector<ll>> v(2 * l,vector<ll>(2 * l, 0));
    REP(i, n){
        ll x, y;
        char c;
        cin >> x >> y >> c;
        if(c == 'B')x += k;
        x = x % l;
        y = y % l;
        v[x][y]++;v[x + l][y + l]++;
        v[x + l][y]++;v[x][y + l]++;
    }
    FOR(i,1,2 * l){
        REP(j ,2 * l)v[i][j] += v[i - 1][j];
    }
    REP(i,2 * l){
        FOR(j,1,2 * l)v[i][j] += v[i][j - 1];
    }
    ll ans = 0;
    REP(i,l){
        REP(j,l){
            ll tmp = v[i][j] + 2 * v[i + k][j + k] - v[i + k][j] - v[i][j + k];
            tmp +=  v[i + l][j + l] - v[i + k][j + l] - v[i + l][j + k];
            ans = max(ans,max(tmp,n - tmp));
        }
    }
    dump(ans);
    return 0;
}

Measured memory_bytes: 125440