akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;

int main(int argc, char const *argv[])
{
    char b;
    cin >> b;
    if (b=='A') cout << 'T' << endl;
    else if (b=='C') cout << 'G' << endl;
    else if (b=='T') cout << 'A' << endl;
    else cout << 'C' << endl;
    return 0;
}

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	cin >> n;

	vector<long long> a(n + 1), b(n);
	for (int i = 0; i < n + 1; ++i) 
		cin >> a[i];
	for (int i = 0; i < n; ++i) {
		cin >> b[i];
	}
	long long sum = 0;
	for (int i = 0; i < n; ++i) {
		auto tmp = min(a[i], b[i]);
		sum += tmp;
		a[i] -= tmp;
		b[i] -= tmp;
		tmp = min(a[i + 1], b[i]);
		sum += tmp;
		a[i + 1] -= tmp;
		b[i] -= tmp;
	}
	cout << sum << "\n";
	return 0;
}


Measured memory_bytes: 1792
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};
int main(){
	int n,m;
	cin>>n>>m;
	int out=0;
	rep(i,n){
		int a;cin>>a;
		out+=max(0,a-m);
	}
	if(out)cout<<out<<endl;
	else cout<<"kusoge"<<endl;
}













Measured memory_bytes: 3116
#include <set>
#include <string>
#include <iostream>

using namespace std;

int main() {
	set<string> st;
	int n = 0;
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		st.insert(s);
	}
	cout << st.size() << "\n";
	return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, x;
  cin >> n >> x;
  vector<ll> a(n);
  for(int i=0;i<n;i++)
    cin >> a[i];

  ll ans = 0;
  for(int i=0;i<n-1;i++) {
    ll t = a[i] + a[i+1];
    if(t>x) {
      ans += t-x;
      a[i+1] = max<ll>(0, a[i+1]-t+x);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
//#include<vector>
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 chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#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_unlocked(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;
}

void pakuri_sort(int N, int A[]) {
	const int b = 8;
	int tmp[100001];
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

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


	int N = getint();
	int A = getint();
	int B = getint();
	A -= B;
	int H[100000];
	rep(i, N) H[i] = getint();
	pakuri_sort(N, H);

	int L = 0;
	int R = (1000000000 + B - 1) / B;

	while (L + 1 != R) {
		int m = (L + R) / 2;
		int damage = B * m;
		int cnt = 0;
		auto kaishi = upper_bound(H, H + N, damage);
		for (; kaishi != H + N; kaishi++) {
			cnt += (*kaishi - damage + A - 1) / A;
			if (cnt > m) break;
		}
		if (cnt > m) L = m;
		else R = m;
	}

	printf("%lld", R);

	Would you please return 0;
}

Measured memory_bytes: 1024
import math
N, K = [int(_) for _ in input().split()]
p = math.ceil(math.log2(K))
e = []
for i in range(p + 1):
    e += [(i, math.ceil(K / 2**i))]
for i in range(p + 1):
    if N >= e[i][1]:
        e = e[i:]
        e = [(e[0][0], N + 1)] + e
        break
ans = 0
for i in range(1, len(e)):
    ans += (e[i - 1][1] - e[i][1]) * 2**(p - e[i][0])
print(ans / N / 2**p)

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

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,u,v = LI()
    ab = [LI() for _ in range(n-1)]
    e = collections.defaultdict(list)
    for a,b in ab:
        e[a].append(b)
        e[b].append(a)

    def search(s, ea):
        d = collections.defaultdict(lambda: inf)
        d[s] = 0
        q = []
        heapq.heappush(q, (0, s))
        v = collections.defaultdict(bool)
        for u in ea:
            v[u] = True
        while len(q):
            k, u = heapq.heappop(q)
            if v[u]:
                continue
            v[u] = True

            for uv in e[u]:
                if v[uv]:
                    continue
                vd = k + 1
                if d[uv] > vd:
                    d[uv] = vd
                    heapq.heappush(q, (vd, uv))

        return d

    du = search(u, [])
    dv = search(v, [])
    r = 0
    for i in range(n):
        if du[v] - du[u] < 3:
            break
        r += 1
        for c in e[u]:
            if dv[u] > dv[c]:
                u = c
                break
        for c in e[v]:
            if du[v] > du[c]:
                v = c
                break

    ea = []
    t = dv[u]
    for c in range(1, n+1):
        if dv[c] < t:
            ea.append(c)
    d = search(u, ea)
    m = max(d.values())
    r += m
    s = t - dv[v]
    if s > 1:
        r += 1

    return r


print(main())





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

using namespace std;

typedef long long ll;
typedef long double ld;



int main(){
	ld pi = acos(-1);
	ld a,b,x,a2b,a3,ab2;
	cin >> a >> b >> x;
	a2b = a * a * b;
	ab2 = a * b * b;
	a3 = a*a*a;
	ld ans ;
	if (x >= a2b/2)
	{
		ans = atan((2*(a2b - x)/a3)) * 180 /pi;
	}
	else ans = 90 - (atan((2*x)/ab2) * 180 /pi );

	cout << fixed << setprecision(10) << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(){
  double a,b,c,d;
  scanf("%lf %lf %lf %lf",&a,&b,&c,&d);
  printf("%lf\n",sqrt((a-c)*(a-c)+(b-d)*(b-d)));
  return 0;
}

Measured memory_bytes: 2740
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
void bits (ll a,ll fix){
  string s="";
  while(a>0){
    char c='0'+a%2;
    a/=2;
    s+=c;
  }
  for(int i=s.size();i<fix;i++)
    s+='0';
  reverse(s.begin(),s.end());
  cout<<s<<endl;
}


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,k;cin>>n>>k;
  vector<vector<pair<ll,ll>>> beki(35);
  vector<pair<ll,ll> > num(n);
  ll zero=0;
  for(int i=0;i<n;i++){
    cin>>num[i].F>>num[i].S;
    if(num[i].F==0)zero+=num[i].S;
    else
      for(int j=30;j>=0;j--){
	if((num[i].F)&(1<<j)){
	  beki[j].pb(num[i]);
	  break;
	}
      }
  }
  ll ans=0;
  ll keta=0;
  ll nu=k;
  while(nu>0){keta++;nu>>=1;}
  /*  ll bitsum=(1<<(keta-1));
  for(int i=0;i<keta-1;i++)
    for(int j=0;j<beki[i].size();j++){
      ans+=beki[i][j].S;
    }
  */
  ll bitsum=0;
  for(int i=keta-1;i>=0;i--){
    if(!((1<<i)&k))continue;
    ll sum=0;
    bitsum+=(1<<i);
    for(int j=0;j<keta;j++)
      for(int jj=0;jj<beki[j].size();jj++){
	if(beki[j][jj].F<(1<<i)){
	  sum+=beki[j][jj].S;
	  //  cout<<beki[j][jj].F<<" ! "<<bitsum<<endl;
	}else if(((beki[j][jj].F)|(bitsum-1)) == (bitsum-1)){
	  sum+=beki[j][jj].S;
	  //cout<<beki[j][jj].F<<" !! "<<(bitsum-(1<<i))<<endl;
	}
      }

    ll sum2=0;
    for(int j=0;j<keta;j++){
      for(int jj=0;jj<beki[j].size();jj++)
	if((bitsum|beki[j][jj].F)==bitsum)sum2+=beki[j][jj].S;
    }
    //cout<<sum<<" "<<ans<<" "<<sum2<<endl;
    ans=max(sum,max(ans,sum2));
  }
  cout<<ans+zero<<endl;
  return 0;
}


Measured memory_bytes: 4084
#include<bits/stdc++.h>
using namespace std;
#define bp __builtin_popcount
int del(int n, int x, int p) {
    int ans = 0;
    int f = 1;
    for (int i = 0; i < n; ++i) {
        if (i == p) continue;
        ans += f * ((x >> i) & 1);
        f <<= 1;
    }   
    return ans;
}   
int ins(int n, int x, int p, bool t) {
    int ans = 0;
    ans += x & ((1 << p) - 1);
    ans += (1 << p) * t;
    ans += (x >> p) << (p + 1);
    return ans;
}   
vector <int> solve(int n, int a, int b) {
    if (n == 1) {
        return {a, b};
    }   

    int p = -1;
    for (int i = 0; i < n; ++i) {
        if (((a >> i) & 1) != ((b >> i) & 1)) {
            p = i;
        }   
    }   

    int x, y;

    if (p) {
        x = a ^ (1 << (p - 1));
    }
    else {  
        x = a ^ (1 << (p + 1));
    }   

    y = x ^ (1 << p);

    vector <int> l = solve(n - 1, del(n, a, p), del(n, x, p)), r = solve(n - 1, del(n, y, p), del(n, b, p));
    vector <int> ans;
    for (int e : l) {
        ans.push_back(ins(n, e, p, (a >> p) & 1));
    }   
    for (int e : r) {
        ans.push_back(ins(n, e, p, (b >> p) & 1));
    }   
    return ans;
}   
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    int n, a, b;
    cin >> n >> a >> b;
    if ((bp(a) & 1) == (bp(b) & 1)) {
        cout << "NO\n";
    }
    else {
        cout << "YES\n";
        vector <int> ans = solve(n, a, b);
        for (int e : ans) cout << e << ' ';
        cout << '\n';
    }
}   

Measured memory_bytes: 1756
#include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3fll
typedef long long ll;
typedef pair<int,int> pii;
typedef unsigned long long ull;
const int maxn=1e5+10;
ll A[maxn],B[maxn];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n+1;i++)
		scanf("%lld",&A[i]);
	for(int i=1;i<=n;i++)
		scanf("%lld",&B[i]);
	ll ans=0;
	for(int i=1;i<=n;i++)
	{
		ll mi=min(A[i],B[i]);
		A[i]-=mi;
		B[i]-=mi;
		ans+=mi;
		mi=min(A[i+1],B[i]);
		A[i+1]-=mi;
		B[i]-=mi;
		ans+=mi;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1792
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()

# 戦略
# 一番ハブの多いやつをrootにした木で幅優先する?いや1でいい
# 3つのノードがまっすぐ連なるところは過去の色を再利用したい
# ハブになっているノードが問題では？


# やっぱり幅優先

# どうやって最後に並び替える？そもそも並び替える必要がないか
# color = [1]
# ans = []
# cur_color = 0
# pre_color = 0
# defaultcolor = 1
# pre_parent = 0
# for _ in range(N):
#     a, b = read_ints()
#     if a != pre_parent:
#         # 新しく色付けを始める
#         cur_color = defaultcolor
#         ans.append(cur_color)
#     elif a == pre_parent:
#         # 色付けを拡張していく
#         cur_color += 1
#         ans.append(cur_color)


from collections import defaultdict, deque
tree = defaultdict(lambda: [])
inputls = []
ans = dict()
for _ in range(N - 1):
    a, b = read_ints()
    inputls.append((a, b))
    tree[a].append(b)  # 一方方向だけでいいよね
    ans[(a, b)] = 0  # 初期化

# bfs
que = deque([(1, 0)])  # (親ノード,親の前の色情報)
defcolor = 1
while que:
    cur, pre_color = que.popleft()
    cur_color = defcolor
    for nx in tree[cur]:
        if cur_color == pre_color:
            cur_color += 1

        que.append((nx, cur_color))
        ans[(cur, nx)] = cur_color
        cur_color += 1


print(max(ans.values()))
for a, b in inputls:
    print(ans[(a, b)])


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

priority_queue <P ,vector<P>, greater<P> > que_select;
priority_queue <P> que_left;

int main(){
    int N, K;
    cin >> N >> K;
    int t[100100];
    ll d[100100];
    P s[100100]; //とりあえず大きい方からK個を入れる
    for(int i=0; i<N; i++){
        cin >> t[i] >> d[i];
        s[i] = P(d[i],t[i]);
//        que[t[i]].push(d[i]);
    }
    sort(s, s+N, greater<P>());
    int num[100100]; //iがいくつ選ばれているか
    for(int i=0; i<100100; i++){
        num[i]=0;
    }

    ll f[100100]; //PDFのf //i種類選んだ時のmax
    ll INF = pow(10,15);
    for(int i=0; i<=N; i++){
        f[i]=-INF;
    }
    ll sum =0;
    int var=0;
    for(int i=0; i<K; i++){
        sum +=s[i].first;
        var++;
        if(num[s[i].second] >= 1){ //2種類目以降を入れる
            var--;
            que_select.push(P(s[i].first, s[i].second));
        }
        num[s[i].second]++;
    }
    for(int i=0; i<=var; i++){
        f[i] = sum;
    }
    for(int i=K; i<N; i++){
        que_left.push(s[i]);
    }
    
    for(int i=var; i<=N; i++){ //種類を増やす
        if(que_select.empty()) break; //もう種類を増やせない
        P p = que_select.top(); que_select.pop();
        sum -=p.first;
        num[p.second]--;
        bool flag=true;
        if(que_left.empty()) break;
        P q = que_left.top(); que_left.pop();
        while(num[q.second] > 0){
            if(que_left.empty()){flag = false; break; }
            q = que_left.top(); que_left.pop();
        }
        if(!flag) break;
        sum +=q.first;
        var++;
        f[var] = sum;
        num[q.second]++;
    }
    ll ans=0;
    for(ll i=0; i<=N; i++){
        ans = max(ans, f[i]+ i*i);
    }
    cout << ans << endl;
}

Measured memory_bytes: 6516
#include <iostream>

int main()
{
    std::int64_t a, b, n;
    std::cin >> a >> b >> n;
    if (n < b)
    {
        std::cout << static_cast<int>(a * (static_cast<double>(n) / b)) << std::endl;
    }
    else
    {
        std::cout << static_cast<int>(a * ((b-1.0) / b)) << std::endl;
    }
}


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

int main(){
    int n,k;
    cin>>n>>k;
    vector<int>a(n);
    rep(i,n)cin>>a[i];
    rep(i,k){
        vector<int>sum(n);
        rep(j,n){
            int l=max(0,j-a[j]);
            int r=min(n,j+a[j]+1);
            sum[l]++;
            if(r!=n)sum[r]--;
        }
        rep(j,n-1)sum[j+1]+=sum[j];
        bool same=true;
        rep(j,n){
            if(a[j]!=sum[j])same=false;
            a[j]=sum[j];
        }
        if(same)break;
    }
    rep(i,n)cout<<a[i]<<" ";
}

Measured memory_bytes: 4844
#coding: UTF-8

import sys
import math

class Algo:
  @staticmethod
  def profit(r, n):
    maxv = r[1] - r[0]
    minv = r[0]

    for i in range(1, n):
      if r[i-1] < minv:
        minv = r[i-1]
      if r[i]-minv > maxv:
        maxv = r[i]-minv
    
    print(maxv)

N = int(input())
R = []
for i in range(0,N):
  R.append(int(input()))
Algo.profit(R, N)

Measured memory_bytes: 13428
using System;

namespace ABC156A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            string[] ss = Console.ReadLine().Split(' ');
            a = int.Parse(ss[0]);
            b = int.Parse(ss[1]);
            if (a < 10)
                Console.WriteLine(b + (100 * (10 - a)));
            else
                Console.WriteLine(b);
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
#include<iostream>
using namespace std;
#define MAX 100000

int n, m;

int main(){
  cin >> n >> m;
  int l, r, lmax = 0, rmin = MAX;
  for (int i = 0; i < m; i++){
    cin >> l >> r;
    lmax = max(l, lmax);
    rmin = min(r, rmin);
  }

  cout << max(rmin - lmax + 1, 0) << endl;

  return 0;
}

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

int main(){
    ll n;
    cin >> n;
    if(n%2 == 1){
        cout << "0" << endl;
        return 0;
    }

    ll ans = 0;
    ll num = 1;
    n /= 10;
    while(n>0){
        ans += (n - n/10)*num;
        ll q = 5;
        while(n/q > 0){
            ans += (n/q + 1)/2;
            q *= 5;
        }
        n /= 10;
        num++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;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 repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	int ans=0;
	cin >>n;
	map<int,int>a;
	int bef;
	rep(i,n){
		cin>>bef;
		a[bef]+=0;
		a[bef]++;
	}
	int d=0;
	repi(itr,a){
		d+=(itr->S)-1;
	}
	cout<<n-((d+1)/2 *2)<<endl;
}

Measured memory_bytes: 4992
#include <cstdio>
#include <algorithm>
#include <string>
#include <queue>
using namespace std;

int a[10],ans=0; 

int main(void){
	for(int i=1;i<=3;i++)
	scanf("%d",&a[i]);
	sort(a+1,a+1+3);
	for(int i=1;i<3;i++)
	ans+=a[i];
	printf("%d\n",ans);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
long long lcm(long long a, long long b) {
    return (a * b)/(__gcd(a, b));
}
int main() {
    ios_base :: sync_with_stdio(false);
    cin.tie(nullptr);
    long long a, b;
    cin >> a >> b;
    cout << lcm(a, b);
    return 0;
}


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

using namespace std;

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

  int n;
  cin >> n;
  cout << fixed << setprecision(10) << (n + 1) / 2 / 1.0 / n;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  int w,h,n,cnt=0;
  cin>>w>>h>>n;
  cnt=n/max(w,h);
  if(n%max(w,h)!=0)
    cnt++;
  cout<<cnt<<endl;
}

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

int n, x, a[5][5], v[5][5];

bool f1(int p) {
	for(int i=0; i<3; i++) if(!v[p][i]) return 0;
	return 1;
}

bool f2(int p) {
	for(int i=0; i<3; i++) if(!v[i][p]) return 0;
	return 1;
}

bool f3() {
	for(int i=0; i<3; i++) if(!v[i][i]) return 0;
	return 1;
}

bool f4() {
	for(int i=0; i<3; i++) if(!v[i][2-i]) return 0;
	return 1;
}

int main() {
	int i, j;
	for(i=0; i<3; i++) for(j=0; j<3; j++) cin >> a[i][j];
	cin >> n;
	while(n--) {
		cin >> x;
		for(i=0; i<3; i++) for(j=0; j<3; j++) if(x==a[i][j]) v[i][j] = 1;
	}
	for(i=0; i<3; i++) {
		if(f1(i)) return puts("Yes")*0;
		if(f2(i)) return puts("Yes")*0;
		if(f3() || f4()) return puts("Yes")*0;
	}
	return puts("No")*0;
}

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

int main(){
    int A,B;
    cin >>A>>B;
    for(int i=0;i<100*100;i++){
        int a=i*0.08;
        int b=i*0.1;
        if((a==A)&&(b==B)){
            cout << i <<endl;
            return 0;
        }
    }
    cout << -1;
    return 0;
}

Measured memory_bytes: 256
a[210][9],i,j,n;main(x){for(scanf("%d",&n);n/++i;)for(j=4;--j;--a[a[i][j]=x][j+3])scanf("%d",&x);for(;--i;)for(j=4;--j;)*a[i]+=!~a[x=a[i][j]][j+3]*x;for(;n/++i;)printf("%d\n",*a[i]);}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int P1=537829,P2=421971,M1=998244353,M2=1e9+7,N=500005;
int ne2[N],fac1[N],fac2[N],v1[N],v2[N],n,ne[N];
char s[N];
void init(){
	fac1[0]=fac2[0]=1;
	for (int i=1;i<=n;i++)fac1[i]=fac1[i-1]*P1%M1,fac2[i]=fac2[i-1]*P2%M2;
	for (int i=1;i<=n;i++)v1[i]=(v1[i-1]*P1+s[i])%M1,v2[i]=(v2[i-1]*P2+s[i])%M2;
	for (int i=2,k=0;i<=n;i++){
		while (k&&s[i]!=s[k+1])k=ne[k];
		if (s[i]==s[k+1])k++;
		ne[i]=k;
	}
}
int cmp(int l1,int r1,int l2,int r2){
	if ((v1[r1]-v1[l1-1]*fac1[r1-l1+1]%M1+M1)%M1!=(v1[r2]-v1[l2-1]*fac1[r2-l2+1]%M1+M1)%M1)return 0;
	if ((v2[r1]-v2[l1-1]*fac2[r1-l1+1]%M2+M2)%M2!=(v2[r2]-v2[l2-1]*fac2[r2-l2+1]%M2+M2)%M2)return 0;
	return 1;
}
int check(int x){
	if (n%x!=0)return 0;
	for (int i=x+1;i<=n;i+=x)
		if (!cmp(1,x,i,i+x-1))return 0;
	return 1;
}
signed main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	init();
	int ans=0;
	for (int i=1;i<=n;i++)
		if (check(i)){
			ans=n/i;
			break;
		}
	if (ans==n){
		printf("%lld\n1",n);
		return 0;
	}
	if (ans==1){
		puts("1\n1");
		return 0;
	}
	int v=n-1,k=n/ans;
	reverse(s+1,s+n+1);
	for (int i=2,k=0;i<=n;i++){
		while (k&&s[i]!=s[k+1])k=ne2[k];
		if (s[i]==s[k+1])k++;
		ne2[i]=k;
	}
	for (int i=1;i<n;i++)
		if ((ne[i]&&i%(i-ne[i])==0)||(ne2[n-i]&&(n-i)%(n-i-ne2[n-i])==0))v--;
	printf("2\n%lld\n",v);
}


Measured memory_bytes: 24192
#include "bits/stdc++.h"
#define REP(i, m, n) for(long long i = m; i < n; ++i)
#define CO(n) cout << n << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int H,A;

int main()
{
    ios::sync_with_stdio(false);
    cin >> H >> A;
    CO((H-1)/A+1);
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from itertools import accumulate

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    p = 10**9 + 7
    if K == 1:
        print(0)
        exit()

    a = [None] * (N+1)
    inva = [None] * (N+1)
    a[0] = 1
    
    for i in range(1, N+1):
        a[i] = i * a[i-1] % p
    
    inva[N] = pow(a[N],p-2,p)
    for i in range(N):
        inva[N-i-1] = inva[N-i] * (N-i) % p

    ans = 0
    maxA = list(accumulate(A[::-1]))
    minA = list(accumulate(A))
    # print(A)
    # print(maxA)
    # print(minA)
    # if K > 2:
    #     maxA = sum(A[N-(K-2):])
    #     minA = sum(A[:K-2])
    for i in range(K-1,N):# 1つ隣どうしからN-1つ隣まで
        j = min(i,N-i)
        # print(i,j,maxA[j-1],minA[j-1])
        tmp = (a[i-1]*inva[K-2] % p) * inva[i-K+1] % p
        ans += (maxA[j-1]-minA[j-1]) * tmp % p
        ans %= p
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 30988
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(S.Length % 2 != 0){
			Console.WriteLine("No");
			return;
		}
		for(int i=0;i<S.Length;i++){
			if(S[i] != "hi"[i % 2]){
				Console.WriteLine("No");
				return;
			}
		}
		Console.WriteLine("Yes");
	}
	String S;
	public Sol(){
		S = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11092
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MP make_pair
#define EACH(i,c) for(auto i: c)
#define SORT(c) sort((c).begin(),(c).end())

#define ALL(a)  (a).begin(),(a).end()

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string A, B;
	cin >> A >> B;

	int n = A.length();
	int ret = 0;
	REP(i, n)
	{
		ret += !(A[i] == B[i]);
	}

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 3620
/*input
3 0 1
300000000 1000000000
100000000 1000000000
200000000 1000000000
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back

#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)

#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int raise(int a,int n,int m = MOD){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= raise(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

const int N = 2e5+1;
int bit[N];
pair<int,int> a[N];
int n,d,wow;

void upd(int ind,int x){
    while(ind <= n){
      bit[ind] += x;
      ind += ind&(-ind);
    }
}

int suma(int ind){
    int res = 0;
    while(ind){
      res += bit[ind];
      ind -= ind&(-ind);
    }
    return res;
}

void solve(){
    cin >> n >> d >> wow;
    RE(i,n){
      cin >> a[i].f >> a[i].s;
    }
    sort(a+1,a+n+1);
    int ans = 0;
    RE(i,n){
      int dd = suma(i);
      if(dd*wow >= a[i].s)continue;
      int diff = a[i].s-dd*wow;
      int ops = (diff+wow-1)/wow;
      ans += ops;
      int lo = i;
      int hi = n;
      while(lo < hi){
        int mid = (lo+hi+1)/2;
        if(a[mid].f > a[i].f+2*d)hi = mid-1;
        else lo = mid;
      }
      upd(i,ops);
      upd(lo+1,-ops);
    }
    cout << ans;
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;
  //cin >> t;
  while(t--){
    solve();
  }
  return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<string>
#include <vector>
#include<queue>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<bitset>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
#define PI 3.141592653589793
using vll = vector<ll>;
using Graph = vii;
const ll MOD = 998244353;

int main() {
	int n;
	cin >> n;
	vll a(n);
	rep(i, n) cin >> a[i];
	vsort(a);
	for (int i = 0; i < n - 1; i++) {
		ll k = a[i];
		ll l = a[i + 1];
		ll r = l % k;
		while (r != 0) {
			l = k;
			k = r;
			r = l % k;
		}
		a[i + 1] = k;
		//if (i == 1) cout << k << endl;
	}
	cout << a[n - 1] << endl;
}

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

const int id = 0;

int op(int l, int r) {
	return l + r;
}

struct node {
	int pos, val, all;
	node *lch, *rch;
	node(int p, int v)
		: pos(p), val(v), all(v), lch(nullptr), rch(nullptr) {}
};

node* update_up(node* t) {
	t->all = op(op((t->lch ? t->lch->all : id), t->val), (t->rch ? t->rch->all : id));
	return t;
}

node* change(node* t, int val) {
	t->val += val;
	return update_up(t);
}

node *update(node* t, int p, int val, int lb, int ub) {
	if (!t) return new node(p, val);
	if (t->pos == p) return change(t, val);
	int m = (lb + ub) >> 1;
	if ((p > m) ^ (t->pos < p)) {
		swap(t->pos, p);
		swap(t->val, val);
	}
	if (p < m) {
		t->lch = update(t->lch, p, val, lb, m);
	}
	else {
		t->rch = update(t->rch, p, val, m, ub);
	}
	return update_up(t);
}

int find(node* t, int l, int r, int lb, int ub) {
	if (!t || r <= lb || ub <= l) return id;
	if (l <= lb && ub <= r) return t->all;
	int m = (lb + ub) >> 1;
	int val = l <= t->pos && t->pos < r ? t->val : id;
	return op(op(find(t->lch, l, r, lb, m), val), find(t->rch, l, r, m, ub));
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, q;
	cin >> n >> q;
	node *seg = nullptr;
	while (q--) {
		int com, x, y;
		cin >> com >> x >> y; x--;
		if (com == 0) {
			seg = update(seg, x, y, 0, n);
		}
		else {
			printf("%d\n", find(seg, x, y, 0, n));
		}
	}
	return 0;
}



Measured memory_bytes: 5500
from math import ceil
HealthA, AtkA, HealthB, AtkB = map(int, input().split())
num_takahashi = ceil(HealthB/AtkA)
num_aoki = ceil(HealthA/AtkB)
if num_takahashi<= num_aoki:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9168
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;

int main() {
    int N, A, B;
    cin >> N >> A >> B;

    int C = N * A;

    int ans = min(C, B);

    cout << ans << endl;
}

Measured memory_bytes: 3632
import math
a=input()
res=[i for i in a.split()]
x,y=[res[i] for i in (0,1)]
A,B=int(x),int(y)
if 2<=A<=20 and 1<=B<=20:
    w=(B-1)/(A-1)
    z=math.ceil(w)
    print(z)

Measured memory_bytes: 9104
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    int N; cin >> N;
    int H[100010]; REP(i, N) cin >> H[i];
    int cnt = 0, res = 0;

    REP(i, N - 1){
        if(H[i] - H[i + 1] >= 0) cnt++;
        else{
            res = max(cnt, res);
            cnt = 0;
        }
    }
    res = max(cnt, res);

    cout << res << endl;
}

Measured memory_bytes: 640
N = int(input())
A = [int(x) for x in input().split()]
B = [int(y) for y in input().split()]
A_sum = sum(A)

for i in range(N):
    while (B[i] != 0 and A[i+1] != 0):
        if A[i] == 0:
            if B[i] <= A[i+1]:
                A[i+1] -= B[i]
                B[i] = 0
            else:
                B[i] -= A[i+1]
                A[i+1] = 0
        else:
            if B[i] <= A[i]:
                A[i] -= B[i]
                B[i] = 0
            else:
                B[i] -= A[i]
                A[i] = 0

A_after_sum = sum(A)
print(A_sum- A_after_sum)

Measured memory_bytes: 19648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353

vector<ll> a(110000,1100000000);
vector<ll> b(110000,1100000000);
vector<ll> c(110000,1100000000);
vector<ll> ba(110000,0);
bool aisOK(ll index, ll key){ 
    if (a.at(index) >= key) return true; 
    else return false;
}

ll binsea(ll key, ll sizem){ //sizem番目まで二分探索
	ll left = -1;
	ll right = sizem;
	while (right-left>1){
		ll mid = left+(right-left)/2;
		if (aisOK(mid, key)) right = mid;
		else left = mid;
	}
	return right; //自分より大きい、または小さいものの最小のindex、なければsizemを返す
}

bool bisOK(ll index, ll key){ 
    if (b.at(index) >= key) return true; 
    else return false;
}

ll binseb(ll key, ll sizem){ //sizem番目まで二分探索
	ll left = -1;
	ll right = sizem;
	while (right-left>1){
		ll mid = left+(right-left)/2;
		if (bisOK(mid, key)) right = mid;
		else left = mid;
	}
	return right; //自分より大きい、または小さいものの最小のindex、なければsizemを返す
}

int main(){
	ll n; cin >> n;
	REP(i,n) cin >> a.at(i);
	REP(i,n) cin >> b.at(i);
	REP(i,n) cin >> c.at(i);
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	ba.at(0) = 0;
	FOR(i,1,n) ba.at(i) = binsea(b.at(i-1),n)+ba.at(i-1);
	ll ans = 0;
	REP(i,n) ans += ba.at(binseb(c.at(i),n));
	cout << ans << endl;
}

Measured memory_bytes: 3712
#include <cstdio>

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

    int res = X - A;
    if(res < 0){
        printf("NO\n");
    }else{
        if(res > B){
            printf("NO\n");
        }else{
            printf("YES\n");
        }
    }

    return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;


int main(){

	int *data;
	data = new int[50001];

	data[0]=0;
	data[1]=0;
	data[2]=1;
	data[3]=1;

	for(int i=3;i<=50000;i++){
		int flag=0;
		for(int j=3;j*j<=i;j+=2){
			if(i%j==0){
				flag=1;
				break;
			}
		}
		if(flag==1){
			data[i]=0;
		}
		else{
			data[i]=1;
		}
	}

	int n;
	while(1){
		cin>>n;
		if(n==0)break;
		if(n<=3){
			cout<<0<<endl;
			continue;
		}
		else if(n%2==1){
			if(data[n-2]==1){
				cout<<1<<endl;
			}
			else{
				cout<<0<<endl;
			}
			continue;
		}
		else if(n==4){
			cout<<1<<endl;
		}
		else{
			int cnt=0;
			for(int i=3;i<=n/2;i+=2){
				if(data[i]==1&&data[n-i]==1){
				//	cout<<i<<" "<<n-i<<endl;
					cnt++;
				}
			}
			cout<<cnt<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1376
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <sstream>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)

using namespace std;

typedef long long ll;

const double EPS = 1e-10;
const double PI = acos(-1.0);

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main(void) {
	int k, x;
	scanf("%d%d", &k, &x);

	vector<int> result;
	for(int i = x - k + 1; i < x + k; i++) {
		if(-1000000 <= i && i <= 1000000) {
			result.push_back(i);
		}
	}

	for(auto&& num : result) {
		printf("%d ", num);
	}
	putchar('\n');
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        string[] n = Read.Strs();
        int a=int.Parse(n[0]+n[1]);
        double ans = Math.Sqrt(a);
        int s = (int)ans;
        Console.WriteLine(ans==s?"Yes":"No");
    }
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b) { return a / gcd(a, b) * b; }
    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long() { return long.Parse(Console.ReadLine()); }
    public static long[] longs() { return Console.ReadLine().Split().Select(long.Parse).ToArray(); }
    public static int Int() { return int.Parse(Console.ReadLine()); }
    public static int[] ints() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 13140
import java.util.Scanner;
import java.lang.Math;

class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int a;
    int b;
    int ans=0;
    String str;
    char op;

    while(true){
      a = sc.nextInt();
      str = sc.next();
      op = str.charAt(0);
      b = sc.nextInt();

      if (op == '+') {
        ans = a+b;
        System.out.println(ans);
      }
      else if (op == '-'){
        ans = a-b;
        System.out.println(ans);
      }
      else if (op == '*'){
        ans = a*b;
        System.out.println(ans);
      }
      else if (op == '/'){
        ans = a/b;
        System.out.println(ans);
      }
      else if (op == '?') {
        //System.out.printf("\n");
        break;
      }
    }
  }

}



Measured memory_bytes: 26216
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

class Main{
	public static void main(String[] args)throws IOException{
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader reader = new BufferedReader(isr);
		String string, str[];
		
		int n, m, sum;
		while(!(string = reader.readLine()).equals("0")){
			n = Integer.valueOf(string);
			
			HashMap<String, Integer> map = new HashMap<String, Integer>();
			for(int i = 0; i < n; i++){
				str = reader.readLine().split(" ");
				map.put(str[0], Integer.valueOf(str[1]));
			}
			
			n = Integer.valueOf(reader.readLine());
			for(int i = 0; i < n; i++){
				str = reader.readLine().split(" ");
				m = Integer.valueOf(str[1]);
				sum = 0;
				for(int j = 0; j < m; j++){
					sum += map.get(str[j + 2]);
				}
				
				if(map.get(str[0]) > sum) map.put(str[0], sum);
			}
			
			System.out.println(map.get(reader.readLine()));
		}
		reader.close();
	}
}

Measured memory_bytes: 25804
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String rs = "";
        for (int i = s.length() - 1; i >= 0; i--) {
            rs += s.charAt(i);
        }

        String prev = s.substring(0, (s.length() - 1) / 2);
        String rprev = "";
        for (int i = prev.length() - 1; i >= 0; i--) {
            rprev += prev.charAt(i);
        }

        String after = s.substring(((s.length() + 3) / 2) - 1);
        String rafter = "";
        for (int i = after.length() - 1; i >= 0; i--) {
            rafter += after.charAt(i);
        }

        if (s.equals(rs) && prev.equals(rprev) && after.equals(rafter)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 21844
// 標準入力から一行を読み取り、指定の型に変換する
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

// 標準入力から一行を読み取り、空白文字で分割し、各要素を指定の型に変換する関数
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let st: Vec<String> = read_vec();
    let s = &st[0];
    let t = &st[1];

    let svec: Vec<char> = s.chars().collect();
    let tvec: Vec<char> = t.chars().collect();

    let mut stvec: Vec<char> = Vec::new();

    for i in 0..n
    {
        stvec.push(svec[i]);
        stvec.push(tvec[i]);
    }

    let result: String = stvec.into_iter().collect();

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


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

#define ll long long

int main() {
    int abc[5];
    for(int i = 0;i < 5;i++) {
        scanf("%d", &abc[i]);
    }

    int min_index = 0;
    int min = 334;
    for(int i = 0;i < 5;i++) {
        if(abc[i]%10 < min && abc[i]%10) {
            min = abc[i]%10;
            min_index = i;
        }
    }

    int sum = 0;
    for(int i = 0;i < 5;i++) {
        if(i != min_index) {
            sum += abc[i]%10 == 0 ? abc[i] : (abc[i]/10 + 1)*10;
        }else{
            sum += abc[i];
        }
    }
    printf("%d\n", sum);
    return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
l_max = 1
r_min = N
for _ in range(M):
  l, r = map(int, input().split())
  l_max = l if l > l_max else l_max
  r_min = r if r < r_min else r_min
if r_min - l_max >= 0:
  print(r_min - l_max + 1) 
else:
  print("0")

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

int main(){
  ll N;cin>>N;
  vector<ll> x(N),y(N),h(N);rep(i,N) cin>>x[i]>>y[i]>>h[i];
  //中心i,j
  rep(i,101){
    rep(j,101){
      ll H;
      rep(k, N){
        if(h[k]!=0){
        H = abs(i-x[k])+abs(j-y[k])+h[k];
        break;
        }
      }
      bool flag=true;
      rep(k, N){
        if(h[k]==0 && abs(i-x[k])+abs(j-y[k])<H){
          flag=false;
          break;
        }
        else if(h[k]>0 && abs(i-x[k])+abs(j-y[k])+h[k]!=H){
          flag=false;
          break;
        }
      }
      if(flag) cout << i << " " <<  j << " " << H << endl;
    }
  }
}

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

int main(){
    int i, m;
    string s;
    cin >> s;
    i = s.size()-1;
    while(i>0){
        m = i;
        if(i > 3){
            if(s.substr(i-4, 5) == "dream" || s.substr(i-4, 5) == "erase"){
                i -= 5;
            }
        }
        if(i > 4){
            if(s.substr(i-5, 6) == "eraser"){
                i -= 6;
            }
        }
        if(i > 5){
            if(s.substr(i-6, 7) == "dreamer"){
                i -= 7;
            }
        }
        if(m == i){
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    string T;
    cin >> T;
    for (int i=0; i<T.length(); i++){
        if (T[i] == '?'){
            T[i] = 'D';
        }
    }
    cout  << T << endl;
    return 0;
}

Measured memory_bytes: 3756
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <cmath>

using namespace std;

void a_between_two_intergers(void) {
	int a, b, c;
	cin >> a >> b >> c;

	if ((c >= a) && (c <= b)) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
}

int main()
{
    a_between_two_intergers();
    return 0;
}

Measured memory_bytes: 3624
n, k = map(int,input().split())
a = list(map(int, input().split()))
c = 1
s = 0
b = [0]*(n+1)
b[1] = 1
d = [0]*(n+1)
d[1] = 0

for i in range(n*10):
    c = a[c-1]
    b[c] += 1
    if b[c] == 2:
        s = i+1 - d[c]
        f = d[c]
        break
    d[c] = i+1

e = c

h = 1
if k < f:
    for i in range(k):
        h = a[h-1]
    print(h)
else:
    S = (k-f)%s
    for i in range(S):
        e = a[e-1]
        #print(e)
    #print(s)
    #print(c)
    #print(f)
    print(e)

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

int main()
{
  int n = 6;
  int dat[ n ];
  for( int i = 0; i < n; i++ ) {
    cin >> dat[ i ];
  }

  int tbl[][7] = {
    { 4, 2, 3, 5, 4, 0 },
    { 1, 4, 6, 3, 1, 0 },
    { 1, 2, 6, 5, 1, 0 },
    { 1, 5, 6, 2, 1, 0 },
    { 1, 3, 6, 4, 1, 0 },
    { 5, 3, 2, 4, 5, 0 }
  };

  int tblx = extent<decltype(tbl),0>::value;
  int tbly = extent<decltype(tbl),1>::value;

  for( int i = 0; i < tblx; i++ ) {
    for( int j = 0; j < tbly; j++ ) {
      if( j == tbly - 1 ) {
        continue;
      }
      tbl[ i ][ j ] = dat[ tbl[ i ][ j ] - 1 ];
    }
  }

  int q, a, b, right;
  cin >> q;
  for( int i = 0; i < q; i++ ) {
    cin >> a >> b;
    for( int j = 0; j < tblx; j++ ) {
      for( int k = 0; k < tbly; k++ ) {
        if( tbl[ j ][ k ] == a and tbl[ j ][ k + 1 ] == b ) {
          cout << dat[ j ] << endl;
        }
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3084
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <ctime>
constexpr int MOD = 1000000007;
constexpr int INF = 2000000000;
using namespace std;
int main() {
	int a[4];
	cin >> a[0] >> a[1] >> a[2] >> a[3];

	sort(a, a + 4);
	bool f = (a[0] == a[1]) && (a[2] == a[3]);

	cout << (f ? "yes" : "no") << endl;
}

Measured memory_bytes: 3104