akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    using namespace std;
    #define INF 2000000000
    typedef long long int ll;
    typedef pair<ll,ll> ii;
    typedef pair<ii,ll> iii;
    typedef vector<ll> vi;
    typedef vector<ii> vii;
    #define getbit(n,i) (((n)&(1<<(i)))!=0)
    #define setbit0(n,i) ((n)&(~(1<<(i))))
    #define setbit1(n,i) ((n)|(1<<(i)))
    #define togglebit(n,i) ((n)^(1<<(i)))
    #define lastone(n) ((n)&(-(n)))
    #define read freopen("debug\\in.txt","r",stdin)
    #define write freopen("debug\\out.txt","w",stdout)
    #define fi first
    #define se second
    #define getI(a) scanf("%d",&a)
    #define getII(a,b) scanf("%d%d",&a,&b)
    #define PI (acos(-1))
    #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL)
    #define mod (1000000007)
    #define asz 500005
    #define pb push_back
    #define ppf pop_front
    #define ppb pop_back
    #define pf push_front
    ll k=2,n;
    ll dp[200005];
    ll h[200005];
   // ll mini=1e9;
    ll recurse(ll pos){
      if(pos==n)
      return 0;
      ll i;
      if(dp[pos]!=-1)
      return dp[pos];
      ll mini=1e9;
      for(i=1;i<=k&&pos+i<=n;i++){
        mini=min(mini,recurse(pos+i)+abs(h[pos]-h[pos+i]));
      }
      return dp[pos]=mini;
    }
    int main()
    {
        fastread;
        ll i,j,l,m,t,q,r,c;
        for(i=1;i<=200005;i++)
        dp[i]=-1;
        cin>>n;
        for(i=1;i<=n;i++)
        cin>>h[i];
        cout<<recurse(1);
        return 0;
    }

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

int main() {
  
  string a,b,c;
  cin >> a >> b >> c;
  
  if(a[a.size()-1] == b[0] && b[b.size()-1] == c[0]) cout << "YES" << endl;
  else cout << "NO" << endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  double x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  printf("%.8lf\n", sqrt((pow((x1 - x2), 2) + pow((y1 - y2), 2))));
}


Measured memory_bytes: 3284
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const int mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-4;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void){
	string s;cin>>s;
	int i,n=s.size(),a=0;
	for(i=0;i<n/2;i++){if(s[i]!=s[n-i-1]){a++;}}
	cout<<a<<endl;
	return 0;
}

Measured memory_bytes: 256
from collections import defaultdict
N,M=map(int,input().split())
dic=defaultdict(list)
DIC=defaultdict(str)
l=[]
for i in range(M):
  i,x=map(int,input().split())
  l.append([i,x])
  dic[i].append(x)
for i in range(1,N+1):
  half_l='0'*(6-len(str(i)))+str(i)
  if len(dic[i])==0:
    pass
  else:
    sorted_l=sorted(dic[i])
    index_dic={}
    index=1
    for num in sorted_l:
      index_dic[num]=index
      index+=1
    for j in range(len(dic[i])):
      INDEX=index_dic[dic[i][j]]
      half_r='0'*(6-len(str(INDEX)))+str(INDEX)
      DIC[(i,dic[i][j])]=half_l+half_r
for i in range(M):
  i,x=l[i][0],l[i][1]
  print(DIC[(i,x)])

Measured memory_bytes: 69832
#include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
// using namespace atcoder;
void Main()
{
    ll n, K;
    cin >> n >> K;

    vector<ll> x(n), y(n);
    rep(i, n) cin >> x[i] >> y[i];
    
    vector<ll> dict;
    rep(i, n) {
        dict.push_back(x[i]);
        dict.push_back(x[i]-1);
        dict.push_back(x[i]+1);
        dict.push_back(y[i]);
        dict.push_back(y[i]-1);
        dict.push_back(y[i]+1);
    }

    sort(all(dict));

    // 圧縮
    vector<ll> u(n), v(n);
    rep(i, n) {
        u[i] = lower_bound(all(dict), x[i]) - dict.begin();
        v[i] = lower_bound(all(dict), y[i]) - dict.begin();
    }

    ll m = dict.size();
    vector<vector<ll> > S(m, vector<ll>(m));

    rep(i, n) {
        S[v[i]][u[i]]++;
    }

    rep(y, m) {
        repi(x, m) {
            S[y][x] = S[y][x-1] + S[y][x];
        }
    }
    
    rep(x, m) {
        repi(y, m) {
            S[y][x] = S[y-1][x] + S[y][x];
        }
    }

    // S[y][x] (x,y)までの領域に含まれる個数
    ll res = -1;

    auto us = u;
    auto vs = v;
    sort(all(us));
    sort(all(vs));

    for (ll i = 0; i < n - 1; i++) {
        for (ll j = i + 1; j < n; j++) {
            for (ll iy = 0; iy < n - 1; iy++) {
                for (ll jy = iy + 1; jy < n; jy++) {
                    ll l = us[i];
                    ll r = us[j];
                    ll b = vs[iy];
                    ll t = vs[jy];
                    ll cnt = S[t][r] - S[b-1][r] - S[t][l-1] + S[b-1][l-1];

                    if (cnt >= K) {
                        ll L = dict[l];
                        ll R = dict[r];
                        ll B = dict[b];
                        ll T = dict[t];
                        ll area = (R - L) * (T - B);
                        if (res < 0) {
                            res = area;
                        }
                        else {
                            res = min(area, res);
                        }
                    }
                   
                }
            }
        }
    }

    put(res);
}
signed main(){ Main();return 0;}

Measured memory_bytes: 4284
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep2(i,x,n) for (int i = x; i < n; i++)
using ll = long long int;
int main() {
    ll n;
    cin >> n;
    string res = "";
    while(n>0) {
        n--;
        res += (char)('a' + n%26);
        n /= 26;
    }
    reverse(res.begin(),res.end());
    cout << res << endl;
    return 0;
}


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

int main() {
    int n, m;
    std::cin >> n >> m;
    std::vector<long long> x(n), y(n), z(n);
    std::vector<std::vector<long long>> t(8, std::vector<long long>(n));
    for (auto i = 0; i < n; i++) {
        std::cin >> x[i] >> y[i] >> z[i];
        for (auto j = 0; j < 8; j++) {
            t[j][i] = (j & 4 ? x[i] : -x[i]) + (j & 2 ? y[i] : -y[i]) + (j & 1 ? z[i] : -z[i]);
        }
    }
    auto ret = 0ll;
    for (auto i = 0; i < 8; i++) {
        std::sort(t[i].begin(), t[i].end());
        std::reverse(t[i].begin(), t[i].end());
        ret = std::max(ret, std::accumulate(t[i].begin(), t[i].begin() + m, 0ll));
    }
    std::cout << ret << std::endl;

    return 0;
}

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

int main(void)
{
	int A, B, C, K;
	cin >> A >> B >> C >> K;
	
	int ret = 0;
	ret += min(A, K);
	K -= A;
	K -= B;
	if (K <= 0)
		goto END;

	ret -= min(C, K);

END:
	cout << ret << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
vector<vector<int>>a;
vector<int>vis;
void dfs(int i);
long long modular_expo(long long x,long long y);

bool cmp(pair<double,int>p1,pair<double,int>p2)
{
    if(p1.first>p2.first)
        return true;
    else
    {
        if(p1.first<p2.first)
            return false;
        else if(p1.first==p2.first)
        {
            if(p1.second<p2.second)
                return true;
            else
                return false;
        }
    }
}
/*bool cmp1(map<int,int>a,map<int,int>b)
{
    if(a.first<b.first)
        return true;
    else
        return false;
}*/
ll m;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);


    ll n,k;
    cin>>n>>k;
    int i;
    vector<ll>a(n,0);
    for(i=0;i<n;i++)
        cin>>a[i];
    sort(a.begin(),a.end());
    ll sum=0;
    for(i=0;i<k;i++)
        sum+=a[i];
    cout<<sum;



}

long long modular_expo(long long x,long long y)
{

    if(y==0)
        return 1;
    if(y%2==0)
        return (modular_expo((x*x)%m,y/2))%m;
    if(y%2==1)
        return ((x%m)*modular_expo((x*x)%m,(y-1)/2))%m;


}


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

int main () {
  vector<char> S(3);
  vector<char> T(3);
  cin >> S.at(0) >> S.at(1) >> S.at(2);
  cin >> T.at(0) >> T.at(1) >> T.at(2);
  int count = 0;
  for (int i = 0;i < 3;i++) {
    if (S.at(i) == T.at(i)) {
      count++;
    }
  }
  cout << count << endl;
}

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

int main(void) {

	int n;

	std::cin >> n;

	std::vector<int> v(n);

	for (size_t i = 0; i < n; i++) {
		std::cin >> v[i];
	}

	std::sort(v.begin(), v.end());

	std::cout << v.back() - v.front() << std::endl;



	return 0;
}

Measured memory_bytes: 256
# coding: utf-8
h, w, p = map(int,input().split())
F = []
for i in range(h):
    F.append(list(input()))
    
ih = [i for i in range(h)]
iw = [i for i in range(w)]
ans = 0
for i in range(2 ** h):
    l_h = []
    for j in range(h):
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            l_h.append(ih[j])
    for j in range(2 ** w):
        l_w = []
        for k in range(w):
            if ((j >> k) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
                l_w.append(iw[k])
        tmp = 0
        for u in l_h:
            for v in l_w:
                if F[u][v] == "#":
                    tmp += 1
        #print(tmp)
        if tmp == p:
            #print(tmp,k)
            ans += 1

print(ans)

Measured memory_bytes: 9156
#include <iostream>

using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  if (a > b) {
    cout << "a > b" << endl;
  } else if (a == b) {
    cout << "a == b" << endl;
  } else {
    cout << "a < b" << endl;
  }
}


Measured memory_bytes: 3076
#include <stdio.h>

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


	int L[N];
	for(int i=0; i<N; i++) scanf("%d", &L[i]);

	int d = 0, cnt = 1;
	for(int i=0; i<N; i++){
		d += L[i];
		if(d > X) break;
		cnt += 1;
	}

	printf("%d\n", cnt);
}

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

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;

    ll ans = K;
    REP(i, N - 1) {
        ans *= (K - 1);
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
// for loop
#define F(i, L, R) for(int i = L; i < R; i++)
#define FE(i, L, R) for(int i = L; i <= R; i++)
// for (reversed)
#define FR(i, L, R) for(int i = L; i > R; i--)
#define FRE(i, L, R) for(int i = L; i >= R; i--)

// data types
#define ul unsigned long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned shoft

// vectors
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define ALL(c) (c).begin(),(c).end()
#define last(vec) vec.size()-1
#define lastEle(vec) vec[last(vec)]
#define pb push_back

// debug
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a, L, R) FE(i, L, R) cout << a[i] << (i==R?'\n':' ')
#define printAF(a, L) printA(a, 0, L-1)
#define printV(a) printA(a, 0, a.size()-1)

// utils
#define char2int(c) (c-'0')
#define bit(x, i) (x&(1<<i))
#define space ' '
#define PI 3.14159265358979323

int main() {
    vector<int> result;
    while(1) {
    int n,x;
    cin >> n >> x;
    if(n == 0 && x == 0)break;
    int ans = 0;
    FE(i, 1, n){
        FE(k, i+1, n){
            FE(l, k+1, n){
                if(i + k + l == x){
                    ans += 1;
                }
            }
        }
    }
    result.pb(ans);
    }


    F(i, 0, result.size()){
        cout << result[i] << endl;
    }
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
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;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m=numeric_limits<T>::max()){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int M,K; cin >>M >>K;
  int n = power(2, M);
  if (M == 0){
    if (K != 0){ cout <<-1 <<endl; return 0;}
    cout <<0 <<" " <<0 <<endl;
  }else if (M == 1){
    if (K != 0){ cout <<-1 <<endl; return 0;}
    cout <<0 <<" " <<0 <<" " <<1 <<" " <<1 <<endl;
  }else{
    if (K >= n){ cout <<-1 <<endl; return 0;}
    for (int i=0; i<n; i++){
      if (i != K) cout <<i <<" ";
    }
    cout <<K <<" ";
    for (int i=n-1; i>=0; i--){
      if (i != K) cout <<i <<" ";
    }
    cout <<K <<endl;
  }
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#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 SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
// #define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;


const int MAX_n = 300;
const int MAX_m = 300;
int n, m;

int tmp;

int freq[MAX_m+1];
bool used[MAX_m+1];

queue<int> que[MAX_n];

signed main(){


    cin >> n >> m;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cin >> tmp;
            que[i].push(tmp);
        }
    }

    int ans = INF;
    for(int i = 0;i < m;i++){
        int ans_t=0;
        fill(freq,freq+m+1,0);
        for(int j = 0;j < n;j++){
            freq[que[j].front()]++;
        }
        int f_n = max_element(freq,freq+301) - freq;
        used[f_n]=1;
        for(int j = 0;j < n;j++){
            if(que[j].front() == f_n){
                ans_t++;
                if(i == m-1)
                    que[j].pop();
                    while(used[que[j].front()]!=0){
                        que[j].pop();
                    }
            }
        }
        ans = min(ans, ans_t);
    }

    cout<< ans<< endl;

    return 0;
}

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

/*
int main (void){
    int dif;
    int min = 753;
    long int S;
    scanf("%ld", &S);

    while(S > 99){
        dif = S % 1000 - 753;
        if (dif < 0){
            dif = -dif;
        }
        if (dif < min){
            min = dif;
        }
        S = S / 10;
    }
    printf("%d\n", min);

    return 0;
}
*/

int main (void){
    char S[11];
    scanf("%s", S);

    int len = strlen(S);
    int X[len - 2];
    int dif[len - 2];

    for (int i = 0; i < len - 2; i++){
        X[i] = (S[i] - '0') * 100 + (S[i + 1] - '0') * 10 + (S[i + 2] - '0');
        dif[i] = abs(X[i] - 753);
    }

    int ans = dif[0];
    for (int i = 0; i < len - 2; i++){
        if (dif[i] < ans){
            ans = dif[i];
        }
    }
    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
vvl G;
vl dp;  // dp[v] : 人vに対応する頂点を根とした部分木のトーナメントの深さの最小値
 
void dfs(ll v) {
    vl x;  // vの子のdp値を入れるvector
    dp[v] = G[v].size();  // 少なくとも子の数以上の深さは必要
    for(auto u : G[v]) {
        dfs(u);
        x.pb(dp[u]);
    }
    sort(rall(x));
    rep(i, G[v].size()) {
        chmax(dp[v], x[i] + i+1);
    }
}
 
int main() {
    ll n;
    cin >> n;
    
    G.resize(n);
    exrep(i, 1, n-1) {
        ll v;
        cin >> v;
        v--;
        G[v].pb(i);
    }

    dp.resize(n);
    dfs(0);
    
    out(dp[0]);
    re0;
}

Measured memory_bytes: 17408
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#include <iomanip>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int W,H,x,y;
	cin >> W >> H >> x >> y;
	cout << setprecision(10) << (double)W*H/2.0 << " ";
	if(x == W/2.0 && y == H/2.0){
		cout << "1" << endl;
	}else{
		cout << "0" << endl;
	}
}


Measured memory_bytes: 256
def resolve():
    def lcms(*numbers):
        from fractions import gcd
        from functools import reduce
        def lcm_base(x, y):
            return (x * y) // gcd(x, y)
        return reduce(lcm_base, numbers)
    
    N = int(input())
    T = [int(input()) for i in range(N)]
    print(lcms(*T))




if '__main__' == __name__:
    resolve()

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

int main() {
  string hitachi;
  cin >> hitachi;
  int count = 0;
  for(int i = 0; i < hitachi.size()-1; i++){
    if(hitachi.at(i) == 'h' && hitachi.at(i+1) == 'i'){
      count++;
    }
  }
  
  if(hitachi.size() % 2 == 0 && count == hitachi.size()/2){
  cout << "Yes" << endl;
  }
  
  else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
# Problem C - Strange Bank

# input
N = int(input())

# initialization
INF = 10**15
dp = [INF] * (N+1)

# dynamic programming
dp[0] = 0
for i in range(1, N+1):

    # 9 yen
    if i>=9:
        nine_count = 0
        tmp = 1
        while tmp*9<=i:
            nine_count += 1
            tmp *= 9
        dp[i] = min(dp[i], dp[i-9**nine_count]+1)

    # 6 yen
    if i>=6:
        six_count = 0
        tmp = 1
        while tmp*6<=i:
            six_count += 1
            tmp *= 6
        dp[i] = min(dp[i], dp[i-6**six_count]+1)

    # 1 yen
    if i>=1:
        dp[i] = min(dp[i], dp[i-1]+1)

# output
print(dp[N])


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


#define FastRead        ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl            "\n"

typedef long long ll;

int main()
{
    ll sum=0;
    string s;

    cin>>s;

    for(ll i=0;i<s.size();i++)
        sum += s[i]-'0';

    if(sum%9==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 3736
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    for h in range(1, 3501):
        for n in range(1, 3501):
            d = 4*h*n - n*N - h*N
            if d > 0:
                w = N*h*n / d
                if w.is_integer():
                    print(h, n, int(w))
                    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 38896
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    def count_div_by2(num):
        cnt = 0
        while num%2 == 0:
            cnt += 1
            num //= 2
        return cnt
    print(sum(count_div_by2(n) for n in A))
if __name__ == '__main__':
    main()

Measured memory_bytes: 42604
class String
    def comp
        sz = self.size
        res = self[0]
        (sz-1).times do |i|
            res += self[i+1] if self[i+1] != res[-1]
        end
        return res
    end
end
 
s = gets.chomp

puts s.comp.size == 4 ? "Good" : "Bad"

Measured memory_bytes: 1788
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        if (sc.nextInt() >= 30) System.out.println("Yes");
        else System.out.println("No");
    }

    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        
        String next() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine()  {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

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

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

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

    }
}

Measured memory_bytes: 32744
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int a = 0, b = 0, sum = 0, sub = 0, mult = 0;

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

    sum = a + b;
    sub = a - b;
    mult = a * b;

    if (mult > sub && mult > sum) {
        printf("%d\n", mult);
    } else if (sum > mult && sum > sub) {
        printf("%d\n", sum);
    } else {
        printf("%d\n", sub);
    }

    return 0;
}



Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in, n) for(int i=0; i<n; i++) cin>>in[i]
#define forout(out, n) for(int i=0; i<n; i++) cout<<out[i]<<endl
#define rep(i, n) for(int i=0; i<(n); i++)
int main(){
    int n; cin>>n;
    vector<int> x(n);
    vector<int> y(n);
    forin(x, n);
    forin(y, n);
    vector<int> z;
    z=x;
    sort(z.begin(), z.end());

    int cntx=1;
    int cnty=1;
    int a, b;
    int jx=0, jy=0;
    do{
        rep(i, n){
            if(x[i]==z[i]) jx++;
            if(y[i]==z[i]) jy++;
        }
        if(jx==n) a=cntx;
        else cntx++;
        if(jy==n) b=cnty;
        else cnty++;
        jx=0;
        jy=0;
    }while(next_permutation(z.begin(), z.end()));

    cout<<abs(a-b)<<endl;
}

Measured memory_bytes: 3604
N = int(input())
v = list(map(int, input().split()))

v.sort()
ans = 0

for i in range(N - 1):
    v1 = v.pop(0)
    v2 = v.pop(0)
    vv = (v1 + v2) / 2
    v.insert(0, vv)
print(v[0])

Measured memory_bytes: 9044
#include <bits/stdc++.h>
using namespace std;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main(){
  int64_t a,b,c,d;
  cin >> a >> b >>c >>d;
  int64_t x=b/c-(a-1)/c,y=b/d-(a-1)/d;
  int64_t n=1;
  n=euclidean_gcd(c,d);
  int64_t m=c*d/n;
  int64_t z=b/m-(a-1)/m;
  cout << b-a-x-y+z+1 <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
#define rep(i, n)  for (int i = 0; i <  (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(), (x).end()
const ll INF = ll(1e18)+1;

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

    ll n,k;
    cin >> n >> k;
    vector<ll> ai(n);
    rep(i,n) cin >> ai[i];

    rep(i,n-k){
        if(ai[i] < ai[k+i]) cout << "Yes\n";
        else cout << "No\n";
    }
}

Measured memory_bytes: 4784
h , w = map(int, input().split())
if h == 1 or w == 1: exit(print(1))
a1 = h//2 + 1 if h % 2 != 0 else h//2
a2 = h - a1
a3 = w//2 + 1 if w%2!=0 else w//2
a4 = w - a3
#print(a1 , a2 , a3,a4)
ans = a1*a3 + a2*a4
print(ans)

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (1e9)
#define INFL (1e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<class T>using arr=vector<vector<T>>;
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll join(ll a, ll b){
    return a*10 + b;
}

int main()
{
    int k; cin >> k;
    vector<ll> a;
    rep(i,9) a.push_back(i+1);

    while(1){
        // prvec(a);
        if(k <= a.size()) break;
        k -= a.size();
        vector<ll> b;
        rep(i, a.size()){
            ll one = a[i]%10;
            FOR(j, -1, 2){
                if(j==-1 && one==0) continue;
                if(j==1 && one==9) continue;
                b.push_back(join(a[i], one+j));
            }
        }
        a = b;
    }

    pr(a[k-1]);
    return 0;}

Measured memory_bytes: 5720
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define N 100000

typedef struct{
    char name[10];
    int time;
}Process;

Process *head,*tail;
Process *proc;

void enqueue(Process x,int n){
    if((head==&proc[0]&&tail==&proc[n-1])||(tail+1==head)) //full
        return;
    *tail=x;
    if(tail==&proc[n-1])
        tail=proc;
    else
        tail++;
    return;
}

Process dequeue(int n){
    Process p={"empty",0};
    if(head==tail)
        return p;
    p=(*head);
    if(head==&proc[n-1])
        head=proc;
    else
        head++;
    return p;
}


int main(){
    int num,q,sum_time=0;
    Process ret;

    scanf("%d%d",&num,&q);
    num++;
    proc=(Process*)malloc(sizeof(Process)*num);
    head=proc;
    tail=&proc[num-1];

    for(int i=0;i<num-1;i++){
        scanf("%s%d",&proc[i].name,&proc[i].time);
    }

    while(true){
        ret=dequeue(num);
        if(strcmp(ret.name,"empty")==0)
            break;
        if(ret.time-q<=0){
            sum_time+=ret.time;
            printf("%s %d\n",ret.name,sum_time);
           continue;
        }
        else{
            ret.time=ret.time-q;
            enqueue(ret,num);
            sum_time+=q;
        }
    }

    /*for(int j=0;;j++){
        ret=dequeue(num);
        if(strcmp(ret.name,"empty")==0)
            break;
        printf("%s %d\n",ret.name,ret.time);
    }*/

    free(proc);
    return 0;

}



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

double length(vector<int> a, vector<int> b){
  vector<double> tr;
  for(int i = 0; i < a.size(); i++){
    int temp = a.at(i) - b.at(i);
    tr.push_back(temp);
  }
  double r = 0;
  for(int i = 0; i < tr.size(); i++){
    r += tr.at(i) * tr.at(i);
  }
  return sqrt(r);
}

int main(){
  int N, D;
  cin >> N >> D;
  vector<vector<int>> X(N, vector<int>(D));
  for(int i = 0; i < N; i++){
    for(int j = 0; j < D; j++) cin >> X.at(i).at(j);
  }
  vector<double> l(N * N);
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(i >= j) l.at(N * i + j) = 0.1;
      else l.at(N * i + j) = length(X.at(i), X.at(j));
    }
  }
  int count = 0;
  for(int i = 0; i < l.size(); i++){
    if(l.at(i) == (int)l.at(i)){
      //cout << i << " l.at(i) = " << l.at(i) << endl;
      //cout << i << " int l.at(i) = " << (int)l.at(i) << endl;      
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
/*
  Compete against Yourself.
  Author - Aryan Choudhary (@aryanc403)
*/

#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define fo(i,n)   for(i=0;i<(n);++i)
#define repA(i,j,n)   for(i=(j);i<=(n);++i)
#define repD(i,j,n)   for(i=(j);i>=(n);--i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define endl "\n"

typedef long long int lli;
typedef long double mytype;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef vector<lli> vi;

clock_t time_p=clock();
void aryanc403()
{
#ifdef ARYANC403
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
#endif
}

#ifdef ARYANC403
#include "/home/priank/codes/PastCodes/header.h"
#else
    #define dbg(args...)
#endif

const lli INF = 0xFFFFFFFFFFFFFFFL;

lli seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline lli rnd(lli l=0,lli r=INF)
{return uniform_int_distribution<lli>(l,r)(rng);}

class CMP
{public:
bool operator()(ii a , ii b) //For min priority_queue .
{    return ! ( a.X < b.X || ( a.X==b.X && a.Y <= b.Y ));   }};

void add( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt==m.end())         m.insert({x,cnt});
    else                    jt->Y+=cnt;
}

void del( map<lli,lli> &m, lli x,lli cnt=1)
{
    auto jt=m.find(x);
    if(jt->Y<=cnt)            m.erase(jt);
    else                      jt->Y-=cnt;
}

bool cmp(const ii &a,const ii &b)
{
    return a.X<b.X||(a.X==b.X&&a.Y<b.Y);
}

const lli mod = 1000000007L;
// const lli maxN = 1000000007L;

    lli T,n,i,j,k,in,cnt,l,r,u,v,x,y;
    lli m;
    string s;
    vi a;
    //priority_queue < ii , vector < ii > , CMP > pq;// min priority_queue .

int main(void) {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    // freopen("txt.in", "r", stdin);
    // freopen("txt.out", "w", stdout);
// cout<<std::fixed<<std::setprecision(35);
// cin>>T;while(T--)
{
    lli n,a,b;
    cin>>n>>a>>b;

    if((a+b)%2==0)
    {
        cout<<(b-a)/2<<endl;
        return 0;
    }

    cout<<(b-a-1)/2+min(a,n-b+1)<<endl;

}   aryanc403();
    return 0;
}


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

int main(){
   vector<int> s(4);
  cin>>s.at(0)>>s.at(1)>>s.at(2)>>s.at(3);
  sort(s.begin(),s.end());
  vector<int> ss={1,4,7,9};
  if (s==ss) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <map>
#include <vector>

using namespace std;

int main() {
    int N;
    int *ue;
    int *sita;
    int max = 0;

    scanf("%d",&N);
    ue = new int[N];
    sita = new int[N];

    for(int i = 0;i < N;i++) {
        scanf("%d",&ue[i]);
    }
    for(int i = 0;i < N;i++) {
        scanf("%d",&sita[i]);
    }

    for(int i = 0;i < N;i++) {
        int po = 0;
        for(int x = 0;x < i + 1;x++) {
            po += ue[x];
        }
        for(int y = i;y < N;y++) {
            po += sita[y];
        }
        max = max < po ? po : max;
    }

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


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

int main() {
    int a, b;
    cin >> a >> b;
    string S = "";
    string A, B;
    A = to_string(a);
    B = to_string(b);
    if (a <= b){
        for (int i = 0;i < b;i++){
            S += A;
        }
    }
    else{
        for (int i = 0;i < a;i++){
            S += B;
        }
    }
    cout << S << endl;
}

Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>

#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,n) for(int i=0;i<(n); i++)
#define rep2(i,n) for(int i=0;i<=(n);i++)

using namespace std;
typedef long long ll;
const int NMAX = 200005;
const int k = 200000;
static const int INF = 1<<29;
string s,t,ans;
int dp[3001][3001];
ll gcd(ll a, ll b){
    if(a<b) swap(a,b);
    if(b==0) return a;
    return gcd(b, a%b);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0); //この2行はより速度を向上させる
    // 追加２, 以降 cin の入力元が 'input.txt' になる


    int n,A[NMAX],B[NMAX];
    cin >> n;
    rep(i,n) cin >> A[i+1];

    for(int i=n;i>=1;--i){
        int sum=0;
        for(int j=2*i;j<=n;j+=i){//倍数判定
            sum ^= B[j]; //ビット排他的論理和演算子
        }
        B[i] = sum ^ A[i]; //双方が0か1なら1を格納。それ以外は0を格納。
    }
    vector<int> ans;
    rep2(i,n){
        if (B[i]) ans.push_back(i);
    }
    cout << ans.size() << endl;
    for(int i=0;i<ans.size();++i){
        cout << ans[i];
        if(i+1 != ans.size()) cout << " ";
    }
    cout << endl;

    return 0;

}

Measured memory_bytes: 3192
using System;
using static System.Console;

namespace abc179
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(ReadLine());
            var count = 0;
            for (var i = 1; i < n; ++i)
            {
                count += (n - 1) / i;
            }
            WriteLine(count);
        }
    }
}


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

using namespace std;
using ll = long long;

#pragma region Macros
#define FOR(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define rep(i, n) FOR(i, 0, n)

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

template <class T> string join(const T &v, const string delim = ",")
{
    if (v.empty())
        return "";

    ostringstream res;
    res << v[0];
    for (int i = 1; i < v.size(); i++)
    {
        res << delim << v[i];
    }
    return res.str();
}

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << ":" << #x << " = " << (x) << endl;
#else
#define dbg
#endif

#pragma endregion Macros

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

    int lb = 0;
    int rw = 0;

    rep(i,N) {
        if (S[i] == '.') rw++;
    }

    int res = 100100100;

    chmin(res, lb + rw);
    for (int i = 0; i < N; i++) {
        if (S[i] == '#') {
            lb++;
        } else {
            rw--;
        }
        chmin(res, lb + rw);
    }

    cout << res << endl;
}


Measured memory_bytes: 3716
#include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
using namespace std;

int cnt = 0;
vector<int> G;

int insertionSort(int A[], int n, int g) {
    for (int i = g; i < n; i++) {
        int v = A[i];
        int j = i - g;
        while (j >= 0 && A[j] > v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
    
    return 0;
}

int shellSort(int A[], int n) {
    for (int i = G.size() -1; i >= 0; i--) {
        insertionSort(A, n, G[i]);
    }
    
    return 0;
}

int main() {
    int n = 0, A[1000000];
    cin >> n;
    for (int i = 0; i < n; i++) scanf("%d", &A[i]);

    int h = 1;
    for (int i = 0; ; i++) {
        if (h > n) break;
        G.push_back(h);
        h = 3 * h + 1;
    }
    
    shellSort(A, n);
    
    // =========== output
    cout << G.size() << endl;
    for (int i = G.size() -1; i >= 0; i--) {
        if (i != G.size() -1) cout << " ";
        cout << G[i];
    }
    
    cout << endl << cnt << endl;
    
    for (int i = 0; i < n; i++) {
        cout << A[i] << endl;  
    }

    return 0;
}


Measured memory_bytes: 7064
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int tmp=0;
    int ans=0;
    while(n--)
    {
        int kk;
        cin>>kk;
        if(tmp==0)
        {
           tmp=kk;
           ans++;
        }
        else
        {
            if(tmp>kk)
            {
                ans++;
                tmp=kk;
            }
            else{
                ;
            }
        }
    }
    cout<<ans;
}


Measured memory_bytes: 256
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;
TPL<TNM T> using vec = vector<T>;
TPL<TNM T> using vec2 = vec<vec<T>>;
TPL<TNM T> using vec3 = vec<vec2<T>>;
TPL<TNM T> using vec4 = vec<vec3<T>>;
TPL<TNM T> using vec5 = vec<vec4<T>>;

TPL<TNM K, TNM V> using umap = unordered_map<K, V>;
TPL<TNM K, TNM V> using uset = unordered_set<K, V>;

TPL<class T> inline void OUT(const T &x) { cout << x << "\n"; }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(6); } } pre__;

TPL<TNM V, TNM H> void resize(vector<V>& v, const H h) { v.resize(h); }
TPL<TNM V, TNM H, TNM ... T> void resize(vector<V>& v, const H& h, const T ... t) { v.resize(h); for (auto& _v : v) resize(_v, t ...); }
TPL<TNM V, TNM T> void fill(V& x, const T& val) { x = val; }
TPL<TNM V, TNM T> void fill(vector<V>& vec, const T& val) { for (auto& v : vec) fill(v, val); }

int main(void) {
	int N;
	cin >> N;
	vec<ll> A(N);
	REP(i, N)cin >> A[i];

	ll cnt = 0;
	REP(i, N) {
		while (A[i] % 2 == 0) {
			++cnt;
			A[i] /= 2;
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 384
//https://codeforces.com/contest/1334/problem/A
//BROWNIE TK

#include <bits/stdc++.h>
using namespace std;

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()

#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en

#define le length()
#define mp make_pair
#define mt make_tuple
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define pll pair<lli, lli>
#define pii pair<int, int>
#define pil pair<int, lli>

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)

#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)

#define bset(a, p) ((a) | (1ll << (p)))
#define bchk(a, p) ((a) & (1ll << (p)))
#define bxor(a, p) ((a) ^ (1ll << (p)));
#define brem(a, p) (bchk(a, p) ? (bxor(a, p)) : (a))
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/

#define lb lower_bound
#define ub upper_bound
#define er equal_range

#define findnot find_first_not_of

#define maxe *max_element
#define mine *min_element

#define mod2 1000000007
#define mod 998244353
#define gcd __gcd
#define kira ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#define oset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define osetlli tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements sbtriectly lesser than k
//2. find_by_order(k) : k-th element in the set
#define ofk order_of_key
#define fbo find_by_order

/*STD funcions*/
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
lli modi(lli a, lli m) { return power(a, m - 2, m); }
/*CODE BEGINS*/

int main()
{
    kira;
    lli k;
    cin>>k;
    lli sum=0;
    for(lli i=1;i<=k;i++)
    {
        for(lli j=1;j<=k;j++)
        {
            for(lli l=1;l<=k;l++)
            {
                lli g=gcd(i,j);
                sum+=gcd(g,l);
            }
        }
    }
    p1(sum);
    return 0;
}


Measured memory_bytes: 3652
#include <iostream>

using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    int ans=1;
    for(int m=0; m<M; m++) {
        ans *= 2;
    }
    cout << ans * (1900*M + 100*(N-M)) << endl;


    return 0;
    
}

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

int n;

vector<int> make_R(int s,int a,int c) {
    vector<int> R(n+1);
    R[0] = s;
    for(int i=1; i<=n; ++i) R[i] = (a*R[i-1]+c)%256;
    return R;
}

vector<int> make_O(vector<int> &I,vector<int> &R) {
    vector<int> O(n);
    for(int i=0; i<n; ++i) O[i] = (I[i]+R[i+1])%256;
    return O;
}

double entropy(vector<int> &o) {
    int cnt[256];
    memset(cnt, 0, sizeof(cnt));

    for(int i=0; i<n; ++i) cnt[o[i]]++;
    double ret = 0;

    for(int i=0; i<256; ++i) {
        double t = (double)cnt[i]/(double)n;
        if(cnt[i] > 0) ret += -t*log(t);
    }
    return ret;
}

int main() {
    while(cin>>n, n) {
        vector<int> I(n);
        for(int i=0; i<n; ++i) cin>>I[i];

        double mH = 1e300,td;
        int aa=0,as=0,ac=0;

        for(int s=0; s<=15; ++s) {
            for(int a=0; a<=15; ++a) {
                for(int c=0; c<=15; ++c) {
                    vector<int> R = make_R(s,a,c);
                    vector<int> O = make_O(I,R);
                    td = entropy(O);

                    if(td + 1e-10 < mH) {
                        mH = td;
                        aa = a,as = s,ac = c;
                    }else if(abs(td-mH) < 1e-10) {
                        if(s < as) {
                            aa = a,as = s,ac = c;
                        }else if(s == as) {
                            if(a < aa)
                                aa = a,as = s,ac = c;
                            else if(a == aa && c < ac)
                                aa = a,as = s,ac = c;
                        }
                    }
                }
            }
        }

        cout<<as<<" "<<aa<<" "<<ac<<endl;
    }
}

Measured memory_bytes: 928
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
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 all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll k,a,b;
  cin>>k>>a>>b;
  ll ans=1;
  if(2<=b-a){
    if(k>a-1){
      k-=a-1;
      ll cu=k%2;
      ans=a;
      ans+=(b-a)*(k/2)+cu;
      COUT(ans);
    }
    else{
      COUT(k+1);
    }
  }
  else{
    COUT(k+1);
  }
}

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

int main()
{
     ll n , a , b ; 
     cin >> n >> a >> b ;
     if( n*a<b ){
        cout << n*a << endl; 
     }
     else{
        cout << b << endl;
        
     }




}


Measured memory_bytes: 256
// AtCoder template
// sabaより胡蝶しのぶさんの方が可愛いのではないか？
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)

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

    string s; cin >> s;
    int n = s.size();

    rep(i,n-1){
        if(s[i] == s[i+1]){
            cout << i+1 << " " << i+2 << endl;
            return 0;
        }
    }

    rep(i,n-2){
        if(s[i] == s[i+2]){
            cout << i+1 << " " << i+3 << endl;
            return 0;
        }
    }

    cout << "-1 -1" << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<numeric>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<map>
#include<utility>
#include<cmath>
#include<tuple>
#include<string>
#include<bitset>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
using namespace std;
using ll = long long;

int main(){
    int n;
    cin>>n;
    int ans=0;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        if(a%2==1&&(i+1)%2==1) ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3620