akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    ll a,b,c;
    cin >> a >> b >> c;
    int n = 0;
    while(n <= 1000000){
        if((a&1) || (b&1) || (c&1)){
            pr(n);
            return 0;
        }
        ll ta = a;
        ll tb = b;
        ll tc = c;
        a = tb/2 + tc/2;
        b = ta/2 + tc/2;
        c = tb/2 + ta/2;

        n++;
    }
    pr(-1);
}

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

using namespace std;

int main()
{
    int n;  cin >> n;
    for(int i = 1;i<=n;i++){
        if(n % i == 0 && i <= 9 && n/i <= 9)
            return cout << "Yes" , 0;
    }
    cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long x;
__int128 ans=1; 
long long a[100005];
void print(__int128 x)
{
	if (!x) return ;
	if (x < 0) putchar('-'),x = -x;
	print(x / 10);
	putchar(x % 10 + '0');
}
int main()
{
	int flag=1;
	int n;cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]==0)
		{
			flag=0;
		}
	}
	if(!flag)
	{
		cout<<"0";return 0;
	}
	else
	{
		int flag1=1;
		for(int i=1;i<=n;i++)
		{
			ans*=a[i];
			if(ans>1000000000000000000LL)
			{
				flag1=0;
			}
		}
		if(!flag1)
		{
			cout<<"-1";return 0;
		}
		else
		{
			print(ans);
		}
	}
}

Measured memory_bytes: 4408
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        int x=i;
        if(x%3==0){
            cout << " " << i;
            continue;
        }else if ( x % 10 == 3 ){
            cout << " " << i;
            continue;
        }
        while(x/=10){
            if ( x % 10 == 3 ){
                cout << " " << i;
                break;
            }
        }
    }
    cout<<endl;
}


Measured memory_bytes: 3100
#include <iostream>
#include <iomanip>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
    int n;
    pair<int,int> a[100010];
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i].first;
        a[i].second = i;
    }
    sort(a,a + n);
    for(int i=0;i<n;i++){
        cout << a[i].second + 1 << endl;
    }
}

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

using namespace std;

int main(){
	int N;
	cin >> N;
	string W[N];
	for(int i=0;i<N;i++){
		cin >> W[i];
	}
	for(int j=0;j<N-1;j++){
		for(int i=j+1;i<N;i++){
			if(W[j]==W[i]){
				cout <<"No" << endl;
				return 0;
			}
		}
	}
	for(int i=0;i<N-1;i++){
		if(W[i][(W[i].length())-1]!=W[i+1][0]){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

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

int main() {
  int n, sum = 0, maxi = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    maxi = max(maxi, x);
    sum += x;
  }
  cout << sum - maxi / 2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef long double db;
int main(){
    ll x,k,d;cin>>x>>k>>d;
    if(abs(x)/d>=k){
        cout<<abs(x)-k*d<<endl;return 0;
    }
    else{
        ll v=abs(x);
        if(v%d<d-v%d){
            k-=v/d;v%=d;
            if(k%2==0){
                cout<<v<<endl;
            }
            else cout<<d-v<<endl;
        }
        else{
            k-=v/d+1;v=d-v%d;
            if(k%2==0){
                cout<<v<<endl;
            }
            else cout<<d-v<<endl;
        }
    }
}

Measured memory_bytes: 3632
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

if sum(A) < sum(B):
  print(-1)
  quit()

ans = 0
diff = 0
larger = []
for a, b in zip(A, B):
  if a < b:
    ans += 1
    diff += b - a
  else:
    larger.append(a - b)

larger.sort(reverse=True)
for l in larger:
  if diff > 0:
    diff -= l
    ans += 1
  else:
    break

print(ans)

Measured memory_bytes: 19052
'use strict'

function main(s) {

  s = s.split('\n')[0].split(' ');
  const a = Number(s[0]);
  const b = Number(s[1]);

  const ans = Math.ceil((a + b) / 2);
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
A, B = map(int,input().split())
A_non_zero = 0
B_non_zero = 0
if A%2==1:
    A_non_zero = A
    A +=1
if B%2!=1:
    B_non_zero =B
else:
    B +=1
count = (B-A)//2
result =bin(A_non_zero^B_non_zero^count%2)
print(int(result,2))

Measured memory_bytes: 3064
# coding: utf-8

# https://atcoder.jp/contests/abc116


def main():
    s = int(input())
    a = [s]

    i = 1
    while True:
        ai = a[i-1] // 2 if a[i-1] % 2 == 0 else 3 * a[i-1] + 1
        if ai in a:
            return i+1
        a.append(ai)
        i += 1


print(main())


Measured memory_bytes: 9088
#include <cstdio>
#define ll long long
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)

ll n,m;

int main(){
    scanf("%lld%lld",&n,&m);
    printf("%lld\n",min(n,m/2)+max(m-n*2,0)/4);
    return 0;
}

Measured memory_bytes: 128
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
struct Point{
    int a, b, c, d;
    Point(int a, int b, int c, int d){
        this->a = a ;
        this->b = b ;
        this->c = c ;
        this->d = d ;
    }
};
int main(){
    fastio
    int n , m ; 
    cin >> n >> m ; 
    vector<vector<int> > v(n, vector<int>(m));
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin >> v[i][j] ;
        }
    }
    vector<Point> ans ; 
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if ( v[i][j] & 1 ){
                if ( j + 1 < m ){
                    ans.push_back(Point{i, j, i, j + 1});
                    v[i][j]--;
                    v[i][j + 1]++;
                }
                else if ( i + 1 < n ){
                    ans.push_back(Point{i, j, i + 1, j});
                    v[i][j]--;
                    v[i + 1][j]++;
                }
            }
        }
    }
    cout << (int)ans.size() << endl;
    for(Point &p : ans){
        cout << p.a + 1 << ' ' << p.b + 1 << ' ' << p.c + 1 << ' ' << p.d + 1 << endl;
    }
    return 0 ;
}

Measured memory_bytes: 5236
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
const int maxn = 2e5+5;
long long A[maxn];
long long sum[maxn];
int N;
int main(){
	scanf("%d",&N);
	for(int i=1;i<=N;i++){
		scanf("%d",&A[i]);
		sum[i]=(sum[i-1]+A[i]%mod)%mod;
	}
	long long ans=0;
	for(int i=1;i<=N;i++){
		ans+=(A[i]%mod)*sum[i-1]%mod;
		ans%=mod;
	}
	printf("%d\n",ans%mod);
	return 0;
}

Measured memory_bytes: 6820
-- https://github.com/minoki/my-atcoder-solutions
import Control.Monad (mapM)
import Data.Char (isSpace)
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import qualified Data.ByteString.Char8 as BS
import Control.Monad.ST

readIntPair :: BS.ByteString -> (Int, Int)
readIntPair s = let Just (a, s') = BS.readInt s
                    Just (b, _) = BS.readInt $ BS.dropWhile isSpace s'
                in (a, b)

main = do
  (n,m) <- readIntPair <$> BS.getLine
  -- 2 <= n <= 10^5, 1 <= m <= 10^5
  edges <- U.replicateM m $ do
    (x,y) <- readIntPair <$> BS.getLine
    -- 1 <= x, y <= n
    return (x - 1, y - 1 :: Int)
  let -- edges_from ! x : 辺 (x,y) が存在するような y の集合
      edges_from :: V.Vector [Int]
      edges_from = V.create $ do
        sets <- VM.replicate n []
        U.forM_ edges $ \(x,y) -> do
          VM.modify sets (y :) x
        return sets
  let result :: Int
      result = runST $ do
        vec <- UM.replicate n (-1)
        let get x = do
              v <- UM.read vec x
              if v == -1
                then do ys <- mapM get (edges_from V.! x)
                        let v = maximum (0 : map (+1) ys)
                        UM.write vec x v
                        return v
                else return v
        maximum <$> mapM get [0..n-1]
  print result


Measured memory_bytes: 20476
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=1e5+5;
int h[maxn],fa[maxn];//fa[a]：记录观察点a所有与a连接的观察点的最大高度 
int n,a,b,m,ans;
int main()
{
  cin>>n>>m;
  for(int i=1;i<=n;i++)cin>>h[i];  
  for(int i=1;i<=m;i++)
  {
  	   cin>>a>>b;
  	   fa[a]=max(fa[a],h[b]);
  	   fa[b]=max(fa[b],h[a]);
  }
  for(int i=1;i<=n;i++)
  {
  	  if(h[i]>fa[i])ans++;
  }
  cout<<ans;
  return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    int n,ai;
    cin>>n;
    int ce=0,co=0;
    rep(i,n){
        cin>>ai;
        if(ai%2==0) ++ce;
        else ++co;
    }
    if(co%2==1) cout<<"NO"<<endl;
    else cout<<"YES"<<endl;
    return 0;
}

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

#define ll long long
#define pb push_back
#define vi vector<int>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define sizeOf(A) (sizeof(A))/(sizeof(A[0]))
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
const ll MOD = 1e9 + 7;

int main() {
    fastio;

    int n;
    cin >> n;
    cout << "ABC" << n << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define in(a, n) for(int i=0;i<n;i++)
#define w while(t--)
#define tc int t; cin>>t;
int intlog(double base, double x) {
    return (int)(log(x) / log(base));
}
bool sortbysec(const pair<string,long long> &a,
              const pair<string,long long> &b)
{
    return (a.second < b.second);
}
long long b[1000009];
long long z[1000009];
int lcm(int a, int b)
 {
    return (a*b)/__gcd(a, b);
 }
int main()
{
    int q[4];
    in(q,4) cin>>q[i];
    if(q[0]+q[1]>q[2]+q[3])
        cout<<"Left";
    else if(q[0]+q[1]==q[2]+q[3])
        cout<<"Balanced";
    else
        cout<<"Right";

}


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

int main()
{
	int n;
	string s;

	cin >> n >> s;

	for (auto &p : s)
	{
		p += n;
		if (p > 'Z')
			p = p - 'Z' + 'A' - 1;

		cout << p;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
typedef long long ll;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

int main(){
    int n,a,b,p[110];
    cin >> n >> a >> b;
    for(int i=0;i<n;i++){
        cin >> p[i];
    }
    int a1=0,a2=0,a3=0;
    for(int i=0;i<n;i++){
        if(p[i]<=a){
            a1++;
        }else if(b<p[i]){
            a3++;
        }else{
            a2++;
        }
    }
    cout << min(a1,min(a2,a3)) << endl;

    return 0;
}

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

int main(void)
{
	int n;
	int a[102][102];
	int sum1[102][102];
	int sum2[102][102];
	int max;
	int x, y, x2, y2;
    int s;

	scanf("%d", &n);

	for (y = 1; y <= n; y++){
		for (x = 1; x <= n; x++){
			scanf("%d", &a[y][x]);
		}
	}
	
	memset(sum1, 0, sizeof(sum1));
	memset(sum2, 0, sizeof(sum2));

	for (y = 1; y <= n; y++){
		for (x = 1; x <= n; x++){
			sum1[y][x] = sum1[y - 1][x] + sum1[y][x - 1] - sum1[y - 1][x - 1] + a[y][x];
//printf("<%d>", sum1[y][x]);
		}
//printf("\n");
	}
#if 0
	for (y = n; y >= 1; y--){
		for (x = n; x >= 1; x--){
			sum2[y][x] = sum2[y + 1][x] + sum2[y][x + 1] - sum2[y + 1][x + 1] + a[y][x];
		}
	}

	for (y = 1; y <= n; y++){
		for (x = 1; x <= n; x++){
printf("(%d)", sum2[y][x]);
		}
		printf("\n");
	}
#endif

	max = -10000000;
	for (x = 1; x <= n; x++){
		for (y = 1; y <= n; y++){
			for (x2 = 1; x2 <= x; x2++){
				for (y2 = 1; y2 <= y; y2++){
					s = sum1[y][x] - sum1[y2 - 1][x] - sum1[y][x2 - 1] + sum1[y2 - 1][x2 - 1];
					if (max < s){
						max = s;
					}
				}
			}
		}
	}
	
	printf("%d\n", max);
	
	return (0);
}

Measured memory_bytes: 728
#include<bits/stdc++.h>
const static int M = 1046527;

std::vector<std::string> hash_table;

int strToKey(std::string string){
    int key, rank;
    rank = 1;
    key = 0;
    for(int i = 0; i < string.size(); i++){
	if(string[i] == 'A'){
	    key += rank * 1;
	}
	else if(string[i] == 'C'){
	    key += rank * 2;
	}
	else if(string[i] == 'G'){
	    key += rank * 3;
	}
	else if(string[i] == 'T'){
	    key += rank * 4;
	}
	rank *= 5;
    }
    return key;
}

int h1(int key){
    return key % M;
}

int h2(int key){
    return key % (M - 1);
}

int hash(int key, int cnt){
    return (h1(key) + cnt * h2(key)) % M;
}

int insert(std::string string){
    int key = strToKey(string);
    int value = hash(key, 0);
    for(int i = 1; ; i++){
	if(hash_table[value].size() == 0){
	    hash_table[value] = string;
	    return 0;
	}else{
	    value = hash(key, i);
	}
    }
}

std::string find(std::string string){
    int key = strToKey(string);
    int value = hash(key, 0);
    for(int i = 1; ; i++){
	if(hash_table[value].size() == 0){
	    return "no";
	}else if(hash_table[value] == string){
	    return "yes";
	}else{
	    value = hash(key, i);
	}
    }
}

int main(void){
    hash_table.resize(M);
    int n;
    std::string command, string;
    std::cin >> n;
    for(int i = 0; i < n; i++){
        std::cin >> command >> string;
	if(command[0] == 'i'){
	    insert(string);
	}else{
	    std::cout << find(string) << std::endl;
	}
    }

    return 0;
}

// hash_tableのリサイズを変えてみる



Measured memory_bytes: 42820
K = int(input())
L = [i for i in range(1, 10)]
cnt = 9
i = 0

while K > cnt:
  x = L[i]
  r = x % 10
  if r != 0:
    L.append(10*x + r - 1)
    cnt += 1
  L.append(10*x + r)
  cnt += 1
  if r != 9:
    L.append(10*x + r + 1)
    cnt += 1
  i += 1

print(L[K-1])

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

int main(){
    long long a,b,c,k;
    cin >> a >> b >> c >> k;
    long long ans=0;
    if(a>=k){
        ans = k;
    }else if((a+b)>=k){
        ans = a;
    }else{
        ans = (2*a)+b-k;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3608
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();
        if (a < b) {
            System.out.println("a < b");
        } else if (a > b) {
            System.out.println("a > b");
        } else {
            System.out.println("a == b");

        }
    }
}

Measured memory_bytes: 26288
#include<bits/stdc++.h>
using namespace std;
#define oo (long long)1e18
#define ll long long
#define setdp memset(dp,-1,sizeof(dp))
const ll mod = 1e9+7;
void _IOS(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);}
#define PI 3.14159265359
int sx,sy,tx,ty;
struct threeElements{
int _1st,_2nd,_3rd;
};
int n,m;
int color[14],a[100009];
bool vis[100009];
int main()
{
   // freopen ("jumping.in","r",stdin);
   _IOS();
   ll n,m;
   cin>>n>>m;
   ll ans=1,ans1=1;
   if(min(n,m)+1!=max(n,m)&&n!=m)
    return cout<<0,0;
   for(int i=1;i<=n;i++)
   {
       ans*=i;
       ans%=mod;
   }
   for(int i=1;i<=m;i++)
   {
       ans1*=i;
       ans1%=mod;
   }
   if(n==m)
   cout<<(ans*ans1*2)%mod;
   else
    cout<<(ans*ans1)%mod;

}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll k, n;
    cin >> k >> n;
    vll a(n + 1);
    ll s = 0;
    REP(i, n) {
        cin >> a[i];
    }
    a[n] = a[0] + k;
    ll res = 1e10, d;
    REP(i, n) {
        d = a[i + 1] - a[i];
        res = min(res, k - d);
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  string s;
  cin >> n >> s >> k;
  char a = s[k-1];
  rep(i,n){
    if(s[i]!=a){
      s[i] = '*';
    }
  }
  cout << s << endl;
  
  return 0;
}

Measured memory_bytes: 256
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n,m,a,b,c,d,x,y,z;
  string s,t;
  //

  // ここから
  IN(s);
  s[5] = ' ';
  s[13] = ' ';
  OUT(s);
}

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

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

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

int n;
string s;
int cnt[26],cntnum[10];

int main(){
  cin>>n>>s;
  s="+"+s; n++;
  rep(i,n/2){
    cnt[s[i*2+1]-'a']++;
  }
  rep(i,26)cntnum[cnt[i]]++;
  int res=0;
  if(cntnum[1]>0)res+=cntnum[1]*2;
  repl(i,2,10){
    if(cntnum[i]==1){
      res+=4;
    }else if(cntnum[i]>1){
      res+=6+(cntnum[i]-1)*2;
    }
  }
  cout<<res-1<<endl;
  return 0;
}



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

using namespace std;

int N, K;

int A(int value) {
    return 2*value;
}

int B(int value) {
    return value+K;
}

int f(int n, int value) {
    if(n == N) return min(A(value),B(value));
    return min(f(n+1,A(value)),f(n+1,B(value)));
}

int main() {
    cin >> N;
    cin >> K;
    cout << f(1,1) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

template <typename T>
static inline void ArrayInput(vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr;
}

template <typename T>
static inline void ArrayPut(const vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cout << *itr << " ";
  cout << endl;
}

int main() {
  uint64_t K;
  string S;
  cin >> S;
  cin >> K;

  uint64_t res = 0;
  vector<uint32_t> Pos(S.size());
  for (auto itr = Pos.begin(); itr != Pos.end(); ++itr) *itr = 0;
  char c = S[0];
  uint64_t cnt = 1;
  for (uint32_t i = 1; i < S.size(); ++i) {
    if (c == S[i]) {
      ++cnt;
    } else {
      Pos[i - 1] = cnt;
      cnt = 1;
    }
    c = S[i];
  }
  Pos[S.size() - 1] = cnt;
  if (cnt == S.size()) {
    res = (cnt * K) / 2;
    cout << res << endl;

  } else {
    for (auto itr = Pos.begin(); itr != Pos.end(); ++itr) {
      res += (*itr / 2);
    }

    uint64_t res2 = 0;
    S += S;
    vector<uint32_t> Pos2(S.size());
    cnt = 1;
    c = S[0];

    for (uint32_t i = 1; i < S.size(); ++i) {
      if (c == S[i]) {
        ++cnt;
      } else {
        Pos2[i - 1] = cnt;
        cnt = 1;
      }
      c = S[i];
    }
    Pos2[S.size() - 1] = cnt;

    for (auto itr = Pos2.begin(); itr != Pos2.end(); ++itr) {
      res2 += (*itr / 2);
    }
    cout << (res * K) + ((K - 1) * (res2 - res * 2)) << endl;
  }
  return 0;
}


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

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

using ll  = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
// #define SORT(v, n) stable_sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    // cout << fixed << setprecision(5);
    ll n;
    cin >> n;
    vector<ll> h(n + 2);
    // h[n + 1] = INF;
    rep1(i, n) { cin >> h[i]; }

    bool flg = false;
    for (int i = n; i >= 1; i--) {
        if (h[i - 1] - h[i] > 1) {
            flg = false;
            break;
        }
        if (h[i - 1] - h[i] == 1) {
            h[i - 1]--;
        }
        flg = true;
    }

    if (flg) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


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

using namespace std;

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

int main(){
  int N, X;cin >> N >> X;
  int x[100000];
  for(int i = 0;i < N;++i){
    cin >> x[i];
    x[i] -= X;
    x[i] = abs(x[i]);
  }
  sort(x, x+N);
  int a = x[0];
  for(int i = 1;i < N;++i){
    a = gcd(a, x[i]);
  }
  cout << a;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;

ll count(ll n, ll m){
    ll ans = 0;
    while(n%m == 0){
        n = n/m;
        ans++;
    }
    return ans;
}

bool IsPrime(ll num){
    if(num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for(ll i=3;i<=sqrtNum;i+=2){
        if(num % i == 0)
            return false;
    }
    return true;
}
 
int main(){
    ll N;
    cin >> N;

    ll ans = 1, c[N+1] = {};
    for(ll i=2;i<=N;i++){   // N! = 1*2*...*N
        for(ll j=2;j<=i;j++){   // 素因数
            if( IsPrime(j) )
                c[j] += count(i, j);
        }
    }

    for(int i=2;i<=N;i++){
        ans *= (c[i]+1);
        ans %= MOD;
    }

    cout << ans << endl;

}

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

int main() {
  ll t1, t2;
  ll a1, a2;
  ll b1, b2;
  cin>>t1>>t2>>a1>>a2>>b1>>b2;
  a1 *= t1; a2 *= t2;
  b1 *= t1; b2 *= t2;
  ll p = a1 - b1;
  ll q = a2 - b2;
  if(p<0)p = -p,q = -q;
  ll pq = p+q;
  if(pq==0){
    cout << "infinity" << endl;
    return 0;
  }else if(pq>0){
    cout << 0 << endl;
    return 0;
  }else{
    ll ans;
    ans = (p/(-pq))*2+1;
    if(p%(-pq)==0)ans -= 1;
    cout << ans << endl;
    return 0;
  }
}


Measured memory_bytes: 256
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
		String str = bfr.readLine();
		String[] wa = str.split(" ");
		int N = Integer.parseInt(wa[0]);
		int a = Integer.parseInt(wa[1]);
		int b = Integer.parseInt(wa[2]);
		int sum = 0;
		for(int i=1; i<=N; i++) {
			int tmpSum = 0;
			int num = i;
			while(num != 0) {
				tmpSum += num %10;
				num /= 10;
			}
			if(tmpSum >= a && tmpSum <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 23124
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

const int dm = 1 << 21;
char dn[dm], * di = dn, dt;
inline void putint(ll X) {
	int keta = 0;
	char C[20];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}

int N;
ll D[100001];
int E[200001], Ed[200001], E2[200001], H[100001];
void dfs(int A, ll B) {
	*(D + A) = B;
	for (int i = H[A]; i; i = E2[i]) if (!(*(D + E[i]))) dfs(E[i], B + Ed[i]);
}

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


	int N = getint();
	int k = 1;
	rep(i, N - 1) {
		int a = getint();
		int b = getint();
		int c = getint();
		E[k] = b;
		Ed[k] = c;
		E2[k] = H[a];
		H[a] = k++;
		E[k] = a;
		Ed[k] = c;
		E2[k] = H[b];
		H[b] = k++;
	}
	int Q = getint();
	int K = getint();
	dfs(K, 1);
	rep(i, Q) {
		int x = getint();
		int y = getint();
		putint(*(D + x) + *(D + y) - 2);
	}

	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

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

int main(){
  int N;
  char a;
  int P = 0, W = 0, G = 0, Y = 0;
  cin >> N;
  for(int i = 0; i < N;i++){
    cin >> a;
    
    switch(a){
      case 'P':
        P=1;
        break;
      case 'W':
        W=1;
        break;
      case 'G':
        G=1;
        break;
      case 'Y':
        Y=1;
        break;
    }
  }
  if(P+W+G+Y == 3){
    cout << "Three" << endl;
  }
  else{
    cout << "Four" << endl;
  }
  return 0;
}

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

int main(){
  int n;
  cin >> n;
  ll m=0;
  rep(i,n){
    if(i%3==0 || i%5==0) continue;
    m += i;
  }
  cout << m << endl;
  return 0;
}


Measured memory_bytes: 3584
#include<queue>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int n,m,cnt;
ll k;
char s[1010][1010];
struct Matrix{
    int a[5][5];
    Matrix(){
        a[1][1]=a[1][2]=a[2][1]=a[2][2]=0;
    }
    int *operator[](const int b){
        return a[b];
    }
    friend Matrix operator*(Matrix A,Matrix B){
        Matrix ret;
        for(int i=1;i<=2;i++){
            for(int j=1;j<=2;j++){
                ll x=0;
                for(int k=1;k<=2;k++)
                    x+=1ll*A[i][k]*B[k][j];
                ret[i][j]=x%mod;
            }
        }
        return ret;
    }
    friend Matrix operator*=(Matrix &A,Matrix B){
        A=A*B;
        return A;
    }
}A,B;
Matrix qpow(Matrix ret,Matrix x,ll n){
    while(n){
        if(n&1ll)
            ret*=x;
        x*=x;
        n>>=1ll;
    }
    return ret;
}
int qpow(int x,ll n){
    int ret=1;
    while(n){
        if(n&1)
            ret=1ll*ret*x%mod;
        x=1ll*x*x%mod;
        n>>=1ll;
    }
    return ret;
}
void InitInput(){
    scanf("%d%d%lld",&n,&m,&k);
    if(k<=1){
        putchar('1');
        exit(0);
    }
    for(int i=1;i<=n;i++){
        scanf("%s",s[i]+1);
        for(int j=1;j<=m;j++){
            if(s[i][j]=='#')
                cnt++;
        }
    }
    return;
}
void check(bool &flag1,bool &flag2){
    for(int i=1;i<=m;i++)
        if(s[1][i]=='#'&&s[n][i]=='#'){
            flag1=1;
            break;
        }
    for(int i=1;i<=n;i++)
        if(s[i][1]=='#'&&s[i][m]=='#'){
            flag2=1;
            break;
        }
    return;
}
int solve1(){
    for(int j=1;j<=m;j++){
        if(s[1][j]=='#'&&s[n][j]=='#')
            B[2][2]++;
        for(int i=1;i<=n;i++){
            if(s[i][j]=='#')
                B[1][1]++,B[2][1]--;
            else if(s[i-1][j]=='#')
                B[2][1]++;
        }
        if(s[n][j]=='#')
            B[2][1]++;
    }
    A[1][1]=A[1][2]=1;
    int ret=qpow(A,B,k-1)[1][1];
    if(ret<0)
        ret+=mod;
    return ret;
}
int solve2(){
    for(int i=1;i<=n;i++){
        if(s[i][1]=='#'&&s[i][m]=='#')
            B[2][2]++;
        for(int j=1;j<=m;j++){
            if(s[i][j]=='#')
                B[1][1]++,B[2][1]--;
            else if(s[i][j-1]=='#')
                B[2][1]++;
        }
        if(s[i][m]=='#')
            B[2][1]++;
    }
    A[1][1]=A[1][2]=1;
    int ret=qpow(A,B,k-1)[1][1];
    if(ret<0)
        ret+=mod;
    return ret;
}
int main(){
    InitInput();
    bool flag1=0,flag2=0;
    check(flag1,flag2);
    if(!flag1&&!flag2)
        printf("%d",qpow(cnt,k-1));
    else if(flag1&&!flag2)
        printf("%d",solve1());
    else if(!flag1&&flag2)
        printf("%d",solve2());
    else
        putchar('1');
    return 0;
}


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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const int mod=1e9+7;

struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};

mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}

void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}

int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );

  int n,a,b;cin>>n>>a>>b;
  int ans=0;
  if(a*n<b)ans=a*n;
  else ans=b;
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 125568
#include <iostream>
#include <vector>
#include <climits>

using namespace std;

int main(){
	int N;
	cin >> N;
	vector<int> W(N);
	for(int i = 0; i < N; i++)
		cin >> W[i];
	
	int sum = 0;
	for(int i = 0; i < N; i++)
		sum += W[i];
	
	int min_abs = INT_MAX;
	int sum_now = 0;
	for(int i = 0; i < N; i++){
		sum_now += W[i];
		if(min_abs < abs(sum - 2*sum_now))
			break;
		min_abs = abs(sum - 2*sum_now);
	}

	cout << min_abs << endl;

}

Measured memory_bytes: 256
#include<cstdio>
const int MAXN=1e5+5;
int n,m,a[MAXN];
typedef long long ll;
ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
}
int Calc(){
	ll l=1;
	for(int i=1; i<=n; i++){
		l=l*a[i]/gcd(a[i],l);
		if(l>m) return 0;
	}
	for(int i=1; i<=n; i++)
		if(l/a[i]%2==0) return 0;
	return m/l+1>>1;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1; i<=n; i++){
		scanf("%d",a+i);
		a[i]>>=1;
	}
	printf("%d\n",Calc());
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
 
using namespace std;
 
int a[1000000];
 
int main()
{
    int N, n = 0;
    cin >> N;
    for(int i = 1; i <= N; i++)
    {
        cin >> a[i];
        if(a[a[i]] == i)
            n++;
    }
    cout << n << endl;
}

Measured memory_bytes: 768
#include <iostream>
using namespace std;
#define max(a,b) ((a)>(b) ? (a) : (b))
int main(){
  int i,k,x;
  cin >> k >> x;
  for(i=x-k+1;i<=x+k-1;i++){
    cout << i << (i==x+k-1 ? '\n' : ' ');
  }
  return 0;
}

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

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

   int ans = 0;
   string s;
   cin >> s;

   rep(i,s.size()){
      if(s[i] == '+') ans++;
      if(s[i] == '-') ans--;
   }
   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using lint = long long;
using P = pair<int, int>;

// int F, H, I, J, K, L, M, N, S, T, U, W;
lint F, H, I, J, K, L, M, N, S, T, U, W;
// string A, B;
lint ans = 0, odd, even;

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

	cin >> H >> W;

	if (H == 1 || W == 1) {
		cout << 1 << endl;
		return 0;
	}

	if (W % 2 == 1) {
		odd = W / 2 + 1;
		even = W / 2;
	} else {
		odd = W / 2;
		even = W / 2;
	}

	if (H % 2 == 1) {
		ans = odd * (H / 2 + 1) + even * (H / 2);
	} else {
		ans = odd * (H / 2) + even * (H / 2);
	}

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

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
 
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

int main() {
    int n;
    cin >> n;
    for(int j = 1; j <=9; j++){
    for(int i= 1; i <=9; i++){
        if(j*i == n){
            cout << "Yes";
            return 0;
        }
    }
    }
    cout << "No";
    
    return 0;
}

Measured memory_bytes: 3620
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

pX = sorted(p, reverse=True)[:X]
qY = sorted(q, reverse=True)[:Y]

D = pX + qY + r

print(sum(sorted(D, reverse=True)[:X+Y]))


Measured memory_bytes: 24240
class DoublyLinkedList

	def initialize
		@head = nil
		@size = 0
	end

	def insert(value)
		if @head
			new_entry = Entry.new(value, @head.prev, @head)
			@head.prev = new_entry
			@head.succ = new_entry if @size <= 1
			@head = new_entry
		else
			@head = Entry.new(value, nil, nil)
			@head.prev = @head
			@head.succ = @head
		end
		@size += 1
	end

	def delete(value)
		if @head.value == value
			deleteFirst
			return
		end

		entry = @head.succ
		(@size - 1).times do
			if entry.value == value
				return if clear_if_single_entry
				entry.prev.succ = entry.succ
				entry.succ.prev = entry.prev
				@size -= 1
				return
			end
			entry = entry.succ
		end
	end

	def deleteFirst
		return if clear_if_single_entry
		@head.succ.prev = @head.prev
		@head.prev.succ = @head.succ
		@head = @head.succ
		@size -= 1
	end

	def deleteLast
		return if clear_if_single_entry
		@head.prev.prev.succ = @head
		@head.prev = @head.prev.prev
		@size -= 1
	end

	def display
		entry = @head
		(@size - 1).times do
			printf "#{entry.value} "
			entry = entry.succ
		end
		printf "#{entry.value}\n"
	end

	private

	def clear_if_single_entry
		if @size <= 1
			@head = nil
			@size = 0
			true
		else
			false
		end
	end

	class Entry
		attr_accessor :value, :prev, :succ

		def initialize(value, prev, succ)
			@value = value
			@prev  = prev
			@succ  = succ
		end

	end

end

list = DoublyLinkedList.new
n = STDIN.gets.split[0].to_i
n.times do
	method_name, param = STDIN.gets.split
	if list.respond_to?(method_name)
		if method_name == "insert" || method_name == "delete"
			list.send(method_name, param)
		else
			list.send(method_name)
		end
	end
end
list.display

Measured memory_bytes: 479000
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a,b,c) > 0 else INF
        # 少なくとも各竹に1本ずつ材料が使われる必要があるので
    ret0 = dfs(cur + 1, a, b, c)
    ret1 = dfs(cur + 1, a + l[cur], b, c) + 10
    ret2 = dfs(cur + 1, a, b + l[cur], c) + 10
    ret3 = dfs(cur + 1, a, b, c + l[cur]) + 10
    return min(ret0, ret1, ret2, ret3)

print(dfs(0,0,0,0))

Measured memory_bytes: 3064
import copy

item = [i *(i +1) * (i+2) //6 for i in range(1,181)]
q = []
while True:
    in_ = int(input())
    if in_ == 0:
        break
    q.append(in_)

INIT = 1000
MAX = max(q) +10
ans = [INIT] *MAX
ans[0] = 0
odd_item = [i for i in item if i % 2 ==0 ]
even_item = [i for i in item if not(i % 2 == 0)]

for i in even_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j] + 1

ans_ = copy.deepcopy(ans)

for i in odd_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j]+1
for i in q:
    print(ans[i],ans_[i])


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

using namespace std;

int main(){

  string array;

  cin >> array;
  int tmp = 0;
  for (int i = 0; i < 4; i++){
    if (array[i] == '+'){
      tmp++;
    }else{
      tmp--;
    }
  }
  cout << tmp << endl;


  return 0;

}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#define N 100000
using namespace std;
void func(int);
bool visited[N];
int n,m,u,v,flag,f2,cnt[N];
vector<int> edge[N];

int main(){
  while(1){
    cin>>n>>m;
    if(!n&&!m) break;
    for(int i=0;i<m;i++){
      cin>>u>>v;
      edge[u-1].push_back(v-1);
      edge[v-1].push_back(u-1);
    }
    flag=f2=0;
    for(int i=0;i<n;i++){
      if(edge[i].size()>=3) flag=1;
      if(edge[i].size()==2) f2=1;
    }
    if(f2&&!flag){
      for(int i=0;i<n;i++) visited[i]=false,cnt[i]=0;
      for(int i=0;i<n;i++)
	if(!visited[i]) func(i);
      for(int i=0;i<n;i++)
	if(cnt[i]>=2) flag=1;
    }
    if(flag) cout<<"no"<<endl;
    else cout<<"yes"<<endl;
    for(int i=0;i<n;i++) edge[i].clear();
  }
  return 0;
}

void func(int x){
  visited[x]=true;
  for(int i=0;i<edge[x].size();i++)
    if(!visited[edge[x][i]]) cnt[edge[x][i]]++;
  for(int i=0;i<edge[x].size();i++)
    if(!visited[edge[x][i]]) func(edge[x][i]);
}

Measured memory_bytes: 7088
#include <bits/stdc++.h>
using namespace std;
#define input istream_iterator<ll>(cin)
using ll = long long;

const ll N = 1e5;
const ll INF = numeric_limits<ll>::max();

ll h[N];
ll n;
ll k;
// min cost to stone i
ll dp[N];

static inline
ll cost(ll a, ll b) {
    return abs(h[a] - h[b]);
}

int main() {
    cin >> n >> k;
    copy_n(input, n, h);
    dp[0] = 0;
    for (ll i = 1; i < n; i++) {
        dp[i] = INF;
        for (ll j = 1; j <= k; j++) {
            if (i - j < 0) break;
            dp[i] = min(dp[i], dp[i - j] + cost(i, i - j));
        }
    }
    cout << dp[n - 1] << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;

int main()
{
  const int MAX_SIZE = 400;

  int n, a, s, g;
  while (cin >> n >> a >> s >> g) {
    if ((n|a|s|g) == 0)
      break;

    vector<vector<pair<int, string> > > label(n);
    for (int i = 0; i < a; ++i) {
      int x, y;
      string lab;
      cin >> x >> y >> lab;
      label[x].push_back(make_pair(y, lab));
    }

    string ans = "NO";
    priority_queue<pair<string, int>, vector<pair<string, int> >, greater<pair<string, int> > > que;
    vector<vector<string> > dp(n, vector<string>(MAX_SIZE, ""));
    que.push(make_pair("", s));
    while (!que.empty()) {
      const pair<string, int> p = que.top();
      que.pop();

      if (p.second == g) {
	ans = p.first;
	break;
      }

      if (dp[p.second][p.first.size()] != "" &&
	  dp[p.second][p.first.size()] < p.first ||
	  p.first.size() >= MAX_SIZE)
      	continue;

      dp[p.second][p.first.size()] = p.first;
      for (unsigned int i = 0; i < label[p.second].size(); ++i) {
	int v = label[p.second][i].first;
	string spell = p.first + label[p.second][i].second;
	if (spell.size() >= MAX_SIZE)
	  continue;
	if (dp[v][spell.size()] == "" || spell < dp[v][spell.size()]) {
	  dp[v][spell.size()] = spell;
	  que.push(make_pair(spell, v));
	}
      }
    }

    if (ans.size() >= MAX_SIZE-100)
      ans = "NO";
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

struct s{
  int a;
  int b;
  double c;
};

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);

  int n;
  cin >> n;
  vector<int> a(n);
  REP(i,n) cin >> a[i];
  
  vector<bool> aa(1e9 + 1,false);

  REP(i,a.size()){
    if(aa[a[i]]){
      cout << "NO" << endl;
      return 0;
    }
    else{
      aa[a[i]] = true;
    }
  }

  cout << "YES" << endl;
  
  return 0;
}

Measured memory_bytes: 123904
#include<iostream>
#include<cstdlib>
#include<string>
using namespace std;

int main(){
    string S;
    cin>>S;
    if(S[5]=='0'){
        string month = S.substr(6,1);
        if(stoi(month)>4){cout<<"TBD"<<endl;}
        else{cout<<"Heisei"<<endl;}
    }
    else{cout<<"TBD"<<endl;}
    
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n,k = LI()
    s = input()
    for i in range(k-1):
        print(s[i],end = "")
    print(s[k-1].lower(),end = "")
    for i in range(k,n):
        print(s[i],end = "")
    print()
    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 39152