akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,in;
	cin>>n;
	vvl vv(n,vl(n)),nvv(n,vl(n));
	ll ans=0;
	rep(i,n)rep(j,n){
		cin>>vv[i][j];
		nvv[i][j] =vv[i][j];
		ans+=nvv[i][j];
	}
	rep(i,n){
		rep(j,n){
			bool sw=true;
			rep(k,n){
				if(sw&&(i!=k)&&(j!=k)&&nvv[i][j]==vv[i][k]+nvv[k][j]){
					ans-=nvv[i][j];
					sw=false;
				}
				nvv[i][j]=min(nvv[i][j],nvv[i][k]+nvv[k][j]);
			}
		}
	}
	bool ok=true;
	rep(i,n)rep(j,n){
		if(vv[i][j]!=nvv[i][j])ok=false;
	}
	if(ok){
		cout<<ans/2<<endl;
	}
	else{
		cout<<-1<<endl;
	}
}


Measured memory_bytes: 1664
#include <stdio.h>

int main() {
    int n, i;
    
    for(i = 1; ; i++) {
        scanf("%d", &n);
        if (n != 0) {
            printf("Case %d: %d\n", i, n);  
        } else {
            break;
        }
    }
    
    return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
long long P=1000000007;
long long dp[100005][2];
long long col(int i,int par,int f,vector <vector <int> > &ad){
	if(dp[i][f]==-1){
		long long sum=1;
		for(int j=0;j<ad[i].size();j++){
			if(ad[i][j]==par)
				continue;
			long long c=0;
			c=(c+col(ad[i][j],i,1,ad))%P;
			if(f==1)
				c=(c+col(ad[i][j],i,0,ad))%P;
			sum=(sum*c)%P;
		}
		dp[i][f]=sum;
	}
	return dp[i][f];
}
int main(){
	int n;
	memset(dp,-1,sizeof(dp));
	cin >> n;
	vector <vector <int> > ad(n+1);
	for(int i=0;i<n-1;i++){
		int x,y;
		cin >> x >> y;
		ad[x].push_back(y);
		ad[y].push_back(x);
	}
	cout << (col(1,0,0,ad)+col(1,0,1,ad))%P << endl;
}

Measured memory_bytes: 15616
#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 2e5+5;
const ll M = 1e9+7;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
ll qpow(ll a,ll b) {ll s=1;while(b){if(b&1)s=(s*a)%M;a=(a*a)%M;b>>=1;}return s; }
ll fac[maxn],inv[maxn];

void init()
{
    int n = 2e5;
    fac[0] = 1;
    rep(i,1,n) fac[i] = fac[i-1]*i%M;
    inv[n] = qpow(fac[n],M-2);
    per(i,n-1,0) inv[i] = inv[i+1]*(i+1)%M;
}
ll C(ll a,ll b) {return fac[a]*inv[a-b]%M*inv[b]%M;}
int main()
{
    fastio(); init();
    int n,m,k;
    cin>>n>>m>>k;
    ll b = C(n*m-2,k-2);
    ll s = 0,inv2 = qpow(2,M-2);
    for(ll i=1;i<=n;i++){
        for(ll j=1;j<=m;j++){
            ll a = n * ((j*(j-1)/2 + (1+m-j)*(m-j)/2) % M) % M;
            ll b = m * ((i*(i-1)/2 + (1+n-i)*(n-i)/2) % M) % M;
            s = (s + a + b) % M;
        }
    }
    cout<<b*s%M*inv2%M<<endl;
    return 0;
}


Measured memory_bytes: 6740
n, m = map(int, input().split())
lis = sorted(list(map(int, input().split())), reverse=True)
con = 0

for i in range(n):
  if lis[i] >= sum(lis) * (1/(4*m)):
    con += 1
    if con == m:
      print("Yes")
      exit()

print("No")

Measured memory_bytes: 9184
#include<iostream>
#include<vector>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;

struct BIT{
    int siz;
    vector<int> node;
    BIT(int n){
        siz = n;
        node.resize(siz+1, 0);
    }

    int query(int i){
        int ret = 0;
        while(i > 0){
            ret += node[i];
            i -= i&-i;
        }
        return ret;
    }

    void add(int i, int x){
        while(i <= siz){
            node[i] += x;
            i += i&-i;
        }
    }
};

int main(){
    int n, r;
    while(cin >> n, n){
        vector<int> a(n);
        for(int i = 0; i < n; i++)  a[i] = i;
        cin >> r;
        while(r-- > 0){
            int s, t;
            cin >> s >> t;
            swap(a[--s], a[--t]);
        }
        vector<ll> v(n, 1);
        for(int i = 1; i < n; i++)  v[i] = (v[i-1]*i)%mod;
        BIT bit(n);
        ll ans = 0;
        for(int i = 0; i < n; i++){
            ans += (a[i]-bit.query(a[i]))*v[n-1-i]%mod;
            ans %= mod;
            bit.add(a[i]+1, 1);
        }
        cout << ans << endl;
    }
    return 0;
}


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

using namespace std;

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

using ll = long long;
using pint = pair<int, int>;
using mint = map<int, int>;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	int len = v.size();
    s << '[';
	for (int i = 0; i < len; ++i) {
		s << v[i]; if (i < len-1) s << ", ";
	}
    s << ']';
	return s;
}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m;
	cin >> n >> m;

	mint mp;
	rep(i, m){
	    int a, b;
		cin >> a >> b;
		mp[a]++;mp[b]++;
	}

	for(auto m : mp){
		if(m.second % 2) {
			NO();
			return 0;
		}
	}
	YES();

    return 0;
}


Measured memory_bytes: 4352
# ABC 070
import math
# gcdはエラーになる
def getInt(): return int(input())
def getIntFromRows(n): return [int(input()) for i in range(n)]
def gcd(x, y):
    m = max(x,y)
    n = min(x,y)
    while m%n != 0:
        w = m%n
        m = n
        n = w
    return n
def lcm(x, y): return x*y//gcd(x,y)

N = getInt()
T = getIntFromRows(N)
lc = T[0]
for i in range(1, N):
    lc = lcm(lc,T[i])
print(lc)

Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <algorithm>
#define rep(i, a, b) for (int i = (a), _ = (b); i <= _; ++ i)
#define per(i, a, b) for (int i = (a), _ = (b); i >= _; -- i)
#define For(i, a, b) for (int i = (a), _ = (b); i < _; ++ i)
#define fore(e, u, v) for (int p = e(u), v = e[p].y; p; v = e[p = e[p].nxt].y)
#define ri rd<int>
using namespace std;
typedef long long LL;
const LL O = 1000000007;
const int maxN = 207;
const int N = 200;

template<class T> inline T rd() {
	bool f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = 0;
	T x = 0; for (; isdigit(c); c = getchar()) x = x * 10 + c - 48; return f ? x : -x;
}

int n, m, K;
int stack[maxN], Top;
int dfn[maxN], low[maxN], tdfn;
int bl[maxN], sz[maxN], ed[maxN], col;
LL iv[maxN], fac[maxN], ifac[maxN], pw[maxN];
int pri[maxN], phi[maxN], cnt; bool ntpri[maxN];

struct Vec {
	static const int maxE = 207;
	int g[maxN], te;
	struct edge {int y, nxt;} e[maxE << 1];
	Vec() { te = 1; }
	inline void push(int x, int y) { e[++te] = (edge){y, g[x]}; g[x] = te; }
	inline void link(int x, int y) { push(x, y), push(y, x); }
	inline int& operator () (int x) { return g[x]; }
	inline edge& operator [] (int x) { return e[x]; }
}e;

void dfs(int x, int fa) {
	stack[++Top] = x;
	dfn[x] = low[x] = ++tdfn;
	fore (e, x, y) if (y != fa) {
		if (!dfn[y]) {
			dfs(y, x);
			low[x] = min(low[x], low[y]);
			if (low[y] >= dfn[x]) {
				sz[++col] = 1;
				do {
					bl[stack[Top]] = col;
					++sz[col];
				} while (stack[Top--] != y); 
			}
		}
		else low[x] = min(low[x], dfn[y]);
	}
}

void init() {
	iv[1] = 1; rep (i, 2, N) iv[i] = iv[O % i] * (O - O / i) % O;
	fac[0] = 1; rep (i, 1, N) fac[i] = fac[i-1] * i % O;
	ifac[0] = 1; rep (i, 1, N) ifac[i] = ifac[i-1] * iv[i] % O;
	pw[0] = 1; rep (i, 1, N) pw[i] = pw[i-1] * K % O;

	ntpri[1] = 1; phi[1] = 1;
	rep (i, 2, N) {
		if (!ntpri[i]) {
			pri[++cnt] = i;
			phi[i] = i-1;
		}
		rep (j, 1, cnt) {
			if (1LL * pri[j] * i > N) break;
			int t = pri[j] * i;
			ntpri[t] = 1;
			if (i % pri[j] == 0) {
				phi[t] = phi[i] * pri[j];
				break;
			}
			phi[t] = phi[i] * phi[pri[j]];
		}
	}
}

inline LL C(int x, int y) { return (0 <= y && y <= x) ? fac[x] * ifac[y] % O * ifac[x-y] % O : 0; }

LL Polya(int n) {
	LL res = 0;
	rep (d, 1, n) if (n % d == 0)
		res += pw[d] * phi[n/d] % O;
	return res % O * iv[n] % O;
}

int main() {

	n = ri(), m = ri(), K = ri();
	rep (i, 1, m) e.link(ri(), ri());

	tdfn = 0;
	rep (i, 1, n) if (!dfn[i]) {
		Top = 0;
		dfs(i, 0);
	}

	for (int p = 2; p <= e.te; p += 2) {
		int x = e[p].y, y = e[p^1].y;
		if (dfn[x] > dfn[y]) swap(x, y);
		ed[bl[y]]++;
	}

	init();

	LL res = 1;
	rep (c, 1, col) {
		if (sz[c] == 2) (res *= K) %= O;
		else if (sz[c] == ed[c]) (res *= Polya(ed[c])) %= O;
		else (res *= C(ed[c] + K - 1, K - 1)) %= O;
	}
	printf("%lld\n", (res + O) % O);

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int A[100] ;
int main()
{
    int a,b,k;
    cin >> a >> b >> k;
    if(2* k >= (b-a+1))
    {
        for(int i =a;i<=b;i++)
            cout << i << endl;
    }
    else
    {
        for(int i = a;i<=a+k-1;i++)
        {
            cout << i << endl;
        }
        for(int i = b-k+1;i<=b;i++)
        {
            cout << i << endl;
        }
    }
}

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

int main(){
  int A,B,amari;
  cin>>A;
  cin>>B;
  amari=A-(2*B);
  if(A>2*B){
    printf("%d",amari);
  }
  if(A<=2*B){
    cout<<0<<endl;
  }
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

A, P = map(int, raw_input().split())
print (A * 3 + P) / 2

Measured memory_bytes: 2812
//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define bged(v) (v).begin(),(v).end()
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
typedef long long ll;
const int Imx=2147483647;
const ll Lbig=2e18;
const int mod=1e9+7;
//My i/o stream
struct fastio
{
	char s[100000];
	int it,len;
	fastio(){it=len=0;}
	inline char get()
	{
		if(it<len)return s[it++];it=0;
		len=fread(s,1,100000,stdin);
		if(len==0)return EOF;else return s[it++];
	}
	bool notend()
	{
		char c=get();
		while(c==' '||c=='\n')c=get();
		if(it>0)it--;
		return c!=EOF;
	}
}_buff;
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putchar(' ')
#define putii(x,y) puti(x),puti(y)
#define putiii(x,y,z) putii(x,y),puti(z)
#define putsi(x) putnum(x),putchar('\n')
#define putsii(x,y) puti(x),putsi(y)
#define putsiii(x,y,z) putii(x,y),putsi(z)
inline ll getnum()
{
	ll r=0;bool ng=0;char c;c=_buff.get();
	while(c!='-'&&(c<'0'||c>'9'))c=_buff.get();
	if(c=='-')ng=1,c=_buff.get();
	while(c>='0'&&c<='9')r=r*10+c-'0',c=_buff.get();
	return ng?-r:r;
}
template<class T> inline void putnum(T x)
{
	if(x<0)putchar('-'),x=-x;
	register short a[20]={},sz=0;
	while(x)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1;i>=0;i--)putchar('0'+a[i]);
}
inline char getreal(){char c=_buff.get();while(c<=32)c=_buff.get();return c;}
int n;
int a[55];
int f[111];
int gf(int x){return f[x]==x?x:f[x]=gf(f[x]);}
void un(int x,int y)
{
	x=gf(x);y=gf(y);
	if(x==y)return;
	f[x]=y;
}
bool check(int x)
{
	for(int i=1;i<=2*n;i++)f[i]=i;
	for(int i=2;i<=n;i++)
	{
		for(int j=i+1;j<=n;j++)
		{
			if(abs(a[i]-a[j])<x)
			{
				un(i,j+n);
				un(i+n,j);
			}
			if(24-a[i]-a[j]<x)
			{
				return false;
			}
		}
	}
	for(int i=1;i<=n;i++)if(gf(i)==gf(i+n))return false;
	return true;
}
int main()
{
	cin>>n;n++;
	int mn=24;
	for(int i=2;i<=n;i++)
	{
		cin>>a[i];
		mn=min(mn,a[i]);
	}
	int ans=0;
	for(int i=0;i<=mn;i++)
	{
		if(check(i))
		{
			ans=i;
		}
		else break;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N =1e5+100;
int x[N],n,ans,tp;

int main(){
    scanf("%d",&n); ans=1e9;
    for(int i=1;i<=n;++i) scanf("%d",&x[i]);
    for(int i=1;i<=100;++i){
        tp=0;
        for(int j=1;j<=n;++j){
            tp+=(x[j]-i)*(x[j]-i);
        }
        ans=min(ans,tp);
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int MAX_N = 100100;
class edge
{
    public:
        int to, cost;
};
vector<edge> G[MAX_N];
int d[MAX_N];
int n;
void dijkstra(int s)
{
    priority_queue<P, vector<P>, greater<P> > que;
    for(int i = 0; i < n; i++) d[i] = INF;
    d[s] = 0;
    que.push(P(0, s));
    while(!que.empty())
    {
        P p = que.top(); que.pop();
        int v = p.second;
        if(d[v] < p.first) continue;
        for(int i = 0; i < G[v].size(); i++)
        {
            edge e = G[v][i];
            if(d[e.to] <= d[v] + e.cost) continue;
            d[e.to] = d[v] + e.cost;
            que.push(P(d[e.to], e.to));
        }
    }
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;    
    for(int i = 0; i < n - 1; i++)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].push_back({b, 1});
        G[b].push_back({a, 1});
    }
    int f_cost[n + 1], s_cost[n + 1];
    dijkstra(0);
    for(int i = 0; i < n; i++) f_cost[i] = d[i];
    dijkstra(n - 1);
    for(int i = 0; i < n; i++) s_cost[i] = d[i];
    int fcnt = 0, scnt = 0;
    for(int i = 0; i < n; i++)
    {
        if(f_cost[i] <= s_cost[i]) fcnt++;
        else scnt++;
    }
    cout << (fcnt <= scnt ? "Snuke" : "Fennec") << endl;
    return 0;
}

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

using namespace std;


int main() {
    
    int a = 0;
    cin >> a;
    cout << a + a * a + a * a * a << endl;
    
    return 0;
}

Measured memory_bytes: 3196
using System;
    using System.Text;
    using System.Collections.Generic;
    using static System.Math;
    using System.Linq;
    using static System.Array;
    
    namespace ConsoleApp2
    {
    class Program
    {
        static string S;
        static void Main(string[] args)
        {
            
            var N = long.Parse(Console.ReadLine());
            var V = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();

            for (int i = 0; i < N; i++)
            {
                V[i] -= (i + 1);
            }
            Sort(V);

            var mid = 0L;
            if(N%2 == 0)
            {
                mid = (V[N / 2] + V[(N / 2) - 1])/2;
            }
            else
            {
                mid = V[N / 2];
            }

            var sum = 0L;

            for (int i = 0; i < N; i++)
            {
                sum += Abs(V[i] - mid);
            }

            Console.WriteLine(sum);

            
        }
    }
}


Measured memory_bytes: 30468
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pli pair<ll, int>a
#define pb push_back

#define mp make_pair
#define all(a) (a).begin(),(a).end()


ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}


int main(){
  int n,x; cin >> n >> x;
  if(x == 1 || x == 2*n-1){
    cout << "No" << endl;
    return 0;
  }

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

  vi ans(2*n-1,-1);
  vector<bool> used(2*n,false);
  if(x > 2){
    ans[n-2] = 1;
    used[1] = true;
    ans[n-1] = x;
    used[x] = true;
    ans[n] = x+1;
    used[x+1] = true;
    ans[n+1] = 2;
    used[2] = true;
  }
  else{
    ans[n-2] = x+2;
    used[x+2] = true;
    ans[n-1] = x;
    used[x] = true;
    ans[n] = x-1;
    used[x-1] = true;
    ans[n+1] = x+1;
    used[x+1] = true;
  }

  int num = 1;
  rep(i,2*n-1) {
    if(ans[i] != -1) continue;
    while(used[num]) num++;
    ans[i] = num;
    used[num] = true;
  }

  rep(i,2*n-1) cout << ans[i] << endl;

}

Measured memory_bytes: 2304
import math
A,B = map(int,input().split())
ans = 0
while 1:
    C = math.floor(ans*0.08)
    D = math.floor(ans*0.1)
    if C == A and D == B:
        print(ans)
        break
    if C > A or D > B:
        print(-1)
        break
    ans += 1



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


void solve(long long N, std::vector<std::vector<long long>> A){
    A[1][0] = A[0][0] + A[1][0];
    for(int i=0; i<2; i++){
        for(int j=1; j<N; j++){
            A[i][j] = A[i][j] + (i==0 ? A[i][j-1] : max(A[i-1][j], A[i][j-1]));
        }
    }
    cout << A[1][N-1] << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::vector<long long>> A(2, std::vector<long long>(N));
    for(int i = 0 ; i < 2 ; i++){
        for(int j = 0 ; j < N ; j++){
            scanf("%lld",&A[i][j]);
        }
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

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

	void calc(){
		Scanner cin = new Scanner(System.in);
		while(true){
			int n = cin.nextInt();
			if(n==0) break;
			uni = new int[n];
			int i;
			for(i=0;i<n;i++) uni[i] = -1;
			int m = cin.nextInt();
			int[] a = new int[m];
			int[] b = new int[m];
			int[] d = new int[m];
			long[] sum = new long[m];
			for(i=0;i<m;i++){
				String[] st = cin.next().split(",");
				a[i] = Integer.parseInt(st[0]);
				b[i] = Integer.parseInt(st[1]);
				d[i] = Integer.parseInt(st[2])/100 - 1;
				sum[i] = d[i] * (long)10000 + a[i] * 100 + b[i];
			}
			Arrays.sort(sum);
			int ret = 0;
			for(i=0;i<m;i++){
				a[i] = (int)(sum[i] %100);
				b[i] = (int)((sum[i]/100)%100);
				d[i] = (int)(sum[i]/10000);
				if(getuni(a[i])!=getuni(b[i])){
					ret += d[i];
					connect(a[i],b[i]);
				}
			}
			System.out.println(ret);
		}
	}

	int[] uni;

	int getuni(int a){
		if(uni[a]<0) return a;
		return uni[a] = getuni(uni[a]);
	}
	
	void connect(int a, int b){
		a = getuni(a);
		b = getuni(b);
		uni[a] = b;
	}
}

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

int main(void)
{
	int data[31];
	int i;
	int x;
	
	memset(data, 0, sizeof(data));
	
	for (i = 0; i < 28; i++){
		scanf("%d", &x);
		data[x] = 1;
	}
	
	for (i = 1; i <= 30; i++){
		if (!data[i]){
			printf("%d\n", i);
		}
	}
	
	return (0);
}

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

using ll = long long;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	vector<int> arr(n);
	map<int, int> freq;
	for(int& x : arr) {
		cin >> x;
		++freq[x];
	}
	
	ll all = 0;
	for(auto p : freq) {
		all += 1LL * p.second * (p.second - 1) / 2;
	}
	for(int i = 0; i < n; i++) {
		cout << all - 1LL * freq[arr[i]] * (freq[arr[i]]-1)/2 + 
				1LL * (freq[arr[i]]-2) * (freq[arr[i]]-1)/2 << '\n';
	}
}


Measured memory_bytes: 8320
import heapq
INF = 1e7
H,W=map(int, input().split())
sx, sy = map(int, input().split())
dh, dw = map(int, input().split())
sx -= 1
sy -= 1
S = [input() for _ in range(H)]
def dijkstra(sx, sy):
    D = [[INF]*(W) for _ in range(H)] #始点からの距離(重み)
    D[sx][sy] = 0
    PQ = [(0, (sx, sy))]
    heapq.heapify(PQ)
    while PQ: # PQに候補がある限り
        _, (ux, uy) = heapq.heappop(PQ) # 最小コストなノードu
        for dx in range(-2, 3):
            for dy in range(-2, 3):
                xx, yy = ux+dx, uy+dy
                if 0 <= xx < H and 0 <= yy < W and S[xx][yy]==".":
                    is_not_neighbor = int(abs(dx) + abs(dy) != 1)
                    # neighborでなければコストが1増える
                    if D[ux][uy] + is_not_neighbor < D[xx][yy]:
                        D[xx][yy] = D[ux][uy] + is_not_neighbor
                        heapq.heappush(PQ, (D[xx][yy], (xx, yy)))
    return D
D = dijkstra(sx, sy)
if D[dh-1][dw-1] >= INF:
    print(-1)
else:
    print(D[dh-1][dw-1])

Measured memory_bytes: 126136
//#define _CRT_SECURE_NO_WARNINGS
#define LOCAL_CHUNYU

//#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>	//memset
#include <ctime>
//#include <cmath>


using std::vector;
using std::sort;
using std::swap;

typedef long long LL;
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
const double eps = 1e-8;
//const double pi = acos(-1.0);

#define equ(a,b) ((fabs((a)-(b))) < (eps))
#define gth(a,b) (((a)-(b)) > (eps))
#define lth(a,b) (((a)-(b)) < (-eps))
#define gequ(a,b) (((a)-(b)) > (-eps))
#define lequ(a,b) (((a)-(b)) < (eps))



int main() {
#ifdef LOCAL_CHUNYU
	//freopen("in.txt", "r", stdin);
#endif // LOCAL_CHUNYU

//    int N;
//    scanf("%d",&N);
//    int *sample = new int[N];
//    for(int i = 0; i < N; ++i){
//        scanf("%d",sample + i);
//    }
//    sort(sample, sample + N);
//    int flag = 0;
//    for(int i = 0; i < N - 1; ++i){
//        int temp = i + 1;
//        int j;
//        for(j = temp; j < N; ++j){
//            if(sample[j] * sample[i] % 4 == 0){
//                if(j == temp)
//                    break;
//                else{
//                    swap(sample[temp], sample[j]);
//                    sort(sample + temp + 1, sample + N);
//                    break;
//                }
//
//            }
//
//        }
//        if(j == N){
//            flag = 1;
//            printf("No\n");
//            break;
//        }
//    }
//    if(flag == 0){
//        printf("Yes\n");
//    }

    int N;
    scanf("%d",&N);
    int *sample = new int[N];
    for(int i = 0; i < N; ++i){
        scanf("%d",sample + i);
    }
    int a4 = 0, a2 = 0, a1 = 0;
    int temp;
    for(int i = 0; i < N; ++i){
        temp = sample[i];
        if(temp % 4 == 0)
            a4++;
        if(temp % 2 == 0 && temp % 4 != 0)
            a2++;
        if(temp % 2 != 0)
            a1++;
    }
    if(a4 >= a1){
        printf("Yes\n");
        return 0;
    }
    if(a2 == 0 && a4 == a1 -1){
        printf("Yes\n");
        return 0;
    }
    printf("No\n");





	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;
int main() {
	long long int  a = 0, b = 0, x = 0;
	long long int  n = 0, ans = 0, count = 0;
	string s,t,u;
	vector<long long int> z;
	vector<long long int>::iterator position;
	bool q = false;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		z.push_back(a);
	}
	sort(z.begin(), z.end());
	for (int i = 0; i < n-1; i++){
		if (z.at(i) == z.at(i + 1)) {
			cout << "NO" << endl;
			break;
		}
		else if (i == n - 2)cout << "YES" << endl;
	}
		cout <<  endl;
}

Measured memory_bytes: 2420
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
typedef long long ll;

using namespace std;



signed main() {
	ll n; cin >> n;
	if (n == 5 || n == 3 || n == 7) cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
n = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if n == 1:
    print(0)
else:
    f = factorization(n)
    result = 0
    for each in f:
        shisu = each[1]
        counter = 1
        while shisu >= counter and shisu >= 0:
            shisu -= counter
            counter += 1
            result += 1
    print(result)

Measured memory_bytes: 9508
using System;

namespace MyApp
{
    class Contest
    {
        public static int Main()
        {
            string[] ar = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(ar[0].ToCharArray()[0]);
            int b = Convert.ToInt32(ar[1].ToCharArray()[0]);
            if(a > b)
            {
                Console.WriteLine(">");
            }
            if(a < b)
            {
                Console.WriteLine("<");
            }
            if(a == b)
            {
                Console.WriteLine("=");
            }
            return 0;
        }
    }
}

Measured memory_bytes: 13268
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
    char s1[200],s2[200];
    scanf("%s%s",s1,s2);
    int sum = 0;
    int l1 = strlen(s1);
    for(int i=0,j=l1-1; i<l1; i++,j--)
    {
        if(s1[i]==s2[j])
        {
            sum++;
        }
    }
    if(sum==l1)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL

struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};

typedef struct node *Node;


Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while( x != NIL ){
    y = x;
    if( z->key < x->key )
      x = x->left;
    else 
      x = x->right;
  }

  if( y == NIL )
    root = z;
  else if( z->key < y->key )
    y->left = z;
  else
    y->right = z;

}

void inorder(Node u){
  if( u != NIL ){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
}
void preorder(Node u){
  printf(" %d",u->key);
    
  if( u->left != NIL ) preorder(u->left);
  
  if( u->right != NIL ) preorder(u->right);
    

}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d",&n);

  for ( i = 0; i < n; i++ ){
    scanf("%s",com);
 
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    }
    else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}

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

int main(){
	int n;
	cin>>n;
	int a[n];
	rep(i,n)cin>>a[i];
	ll ans=0;
	rep(i,n)ans+=a[i]-1;
	puts(ans);
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] ar = new int[n];
		for(int i=0 ; i<n ; i++ )
		{
			ar[i] = sc.nextInt();
		}
		printAr(ar,-1);
		for(int j = 1; j < n ;j++)
		{
			int tar = ar[j];
			int k = j;
			while(k > 0 && tar < ar[k-1])
			{
				ar[k] = ar[k-1];
				k--;
				ar[k] = tar;
			}
			printAr(ar,j);
			
			
		}
	}
	public static void printAr(int[] a,int c){
		int i;
		for(i = 0 ; i < a.length-1 ; i++){
			System.out.print(a[i]+" ");
		}
			System.out.println(a[i]);	
	}
	
}
 

 

Measured memory_bytes: 32772
def Collatz_Problem(n):

    ans = 1
    count = []
    while True:
        if n in count:
            break
        else:
            count.append(n)
        if n%2 == 0:
            n = n/2
        else:
            n = 3*n+1
        ans += 1


    return ans

def main():
    n = int(input())
    print(Collatz_Problem(n))

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
import std.stdio, std.conv, std.string, std.array, std.math, std.regex, std.range, std.ascii, std.numeric, std.random;
import std.typecons, std.functional, std.traits,std.concurrency;
import std.algorithm, std.container;
import core.bitop, core.time, core.memory;
import std.bitmanip;
import std.regex;

enum INF = long.max/3;
enum MOD = 10L^^9+7;

//辞書順順列はiota(1,N),nextPermituionを使う


void end(T)(T v)
if(isIntegral!T||isSomeString!T||isSomeChar!T)
{
    import core.stdc.stdlib;
    writeln(v);
    exit(0);
}

T[] scanArray(T = long)()
{
    static char[] scanBuf;
    readln(scanBuf);
    return scanBuf.split.to!(T[]);
}

dchar scanChar()
{
    int c = ' ';
    while (isWhite(c) && c != -1)
    {
        c = getchar;
    }
    return cast(dchar)c;
}

T scanElem(T = long)()
{
    import core.stdc.stdlib;
    static auto scanBuf = appender!(char[])([]);

    scanBuf.clear;

    int c = ' ';
    while (isWhite(c) && c != -1)
    {
        c = getchar;
    }
    while (!isWhite(c) && c != -1)
    {
        scanBuf ~= cast(char) c;
        c = getchar;
    }
    return scanBuf.data.to!T;
}

dchar[] scanString(){
    return scanElem!(dchar[]);
}


void main()
{
  auto x = scanElem;
  if(abs(x-scanElem)<abs(x-scanElem))end("A");end("B");
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,n,a) for(int i=n;i>=a;i--)
#define FOR(i,n) for(int i=0;i<n;i++)
#define all(s) s.begin(),s.end()
#define vi vector<int>
#define vvi vector<vector<int>>
#define pcnt(n) __builtin_popcount(n)
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e18;
const double PI = acos(-1);

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string ans ="";
    while(n>0){
        n--;
        ans+=(char)(n%26+'a');
        n/=26;
    }
    reverse(all(ans));
    cout<<ans<<endl;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<int> x;
	vector<int> y;
	x.resize(n);
	y.resize(n);
	double X = 0;
	double Y = 0;
	for(int i = 0; i < n; ++i) {
		cin >> x[i] >> y[i];
		X += x[i];
		Y += y[i];
	}
	X /= n;
	Y /= n;
	auto Rand = [&] () {
		return rand() % 10000 / 10000.0;
	};
	auto calc = [&] (double X, double Y) {
		double ret = 0;
		for(int i = 0; i < n; ++i) {
			ret = max(ret, sqrt((X - x[i]) * (X - x[i]) + (Y - y[i]) * (Y - y[i])));
		}
		return ret;
	};
	double T = 10000.0;
	while(T > 0.0000001) {
		double new_X = X + T * (Rand() * 2 - 1.0);
		double new_Y = Y + T * (Rand() * 2 - 1.0);	
		if(calc(X, Y) > calc(new_X, new_Y)) {
			X = new_X;
			Y = new_Y;
		}
		T *= 0.999991;
	}
	cout << fixed << setprecision(15);
	cout << calc(X, Y) << '\n';
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

static const int N = 1000;

void trace(int A[], int n){
  int i;
  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

int main(){
  int n, i, j;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
  
  for( i = 1; i <= n; i++ ){
    A[N] = A[i];
    j = i - 1;
    while( j >= 0 && A[j] > A[N]){
      A[j + 1] = A[j];
      j = j - 1;
    }
    A[j + 1] = A[N];
    trace(A,n);
  }
  return 0;
}

Measured memory_bytes: 608
K = int(input())
S = str(input().lower())
if len(S) <= K:
    print(S)
elif len(S) > K:
    stol = list(S)
    stol[K] = "..."
    Cutlist = stol[0:K+1]
    LtoS = ''.join(map(str, Cutlist))
    print(LtoS)

Measured memory_bytes: 9068
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>

using namespace std;

//Nayeem Shahriar Joy,Applied Physics And Electronic Engineering,University of Rajshahi.




int main(void)

{
    int a,b;
    cin>>a>>b;
    cout<<a*b<<" "<<2*(a+b)<<endl;
    return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = LLONG_MAX;
const ll MOD = 1e9 + 7;

int H;
vector<int> A;

void print(int i)
{
    printf("node %d: key = %d, ", i, A[i]);
    if (i / 2 > 0) {
        printf("parent key = %d, ", A[i / 2]);
    }
    if (2 * i <= H) {
        printf("left key = %d, ", A[i * 2]);
    }
    if (2 * i + 1 <= H) {
        printf("right key = %d, ", A[i * 2 + 1]);
    }
    printf("\n");
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> H;
    A.resize(H + 1);
    for (int i = 1; i <= H; ++i) {
        cin >> A[i];
    }
    for (int i = 1; i <= H; ++i) {
        print(i);
    }
    return 0;
}


Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */


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

    int n; cin >> n;
    vector<vector<int>> f(10, vector<int>(10, 0));
    repr(i, 1, n+1) {
        int a = i; while(a>=10) { a /= 10; }
        int b = i%10;
        ++f[a][b];
    }

    ll ans = 0;
    repr(i, 1, 10) repr(j, 1, 10) ans += f[i][j] * f[j][i];
    cout << ans << endl;
    

    return 0;
}

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

int gcd(int x,int y){
    int max;
    if(x == y){
        return x;
    }else if(y % (x % y)==0){
        max = x % y;
        return max;
    }else{
        gcd(y,x % y);
    }
}

int main(){
    int x,y;
    cin >> x;
    cin >> y;
    if(x>=y)cout << gcd(x,y) << endl;
    if(y>x)cout << gcd(y,x) << endl;
    
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF (ll)(1e17+5)
#define NN (ll)(1e6+5)
int mod(string s,int a) 
{ 
    int ans=0; 
    for (int i=0;i<s.length();i++) 
         ans=(ans*10+(int)s[i]-'0')%a; 
    return ans; 
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y) 
{ 
    if (y==0) 
        return 1; 
    else if (y%2==0) 
        return power(x,y/2)*power(x,y/2); 
    else
        return x*power(x,y/2)*power(x,y/2); 
}
ll hcf(ll a,ll b) 
{ 
    if(b==0) 
        return a; 
    return hcf(b,a%b);  
}
const ll N=3005;
string s,t,Ans="";
ll dp[N][N];
ll fn(ll i,ll j)
{
    if(i<0||j<0)
     return 0;
    if(dp[i][j]!=-1)
      return dp[i][j];
    if(s[i]==t[j])
     return dp[i][j]= 1+fn(i-1,j-1);
    return dp[i][j]=max(fn(i-1,j),fn(i,j-1));  
}
void path(ll i,ll j)
{
    if(i<0||j<0)
     return;
    ll ans=fn(i,j); 
    if(s[i]==t[j])
    {
        Ans+=s[i];
        return path(i-1,j-1);
    } 
    else
    {
        if(ans==fn(i-1,j))
         return path(i-1,j);
        else
         return path(i,j-1);
    }
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE 
    	freopen("input.txt", "r", stdin); 
    	freopen("output.txt", "w", stdout); 
    	freopen("error.txt", "w", stderr); 
   #endif*/
   ll TT=1;
   //cin>>TT;
   
   while(TT--)
   {    
       cin>>s>>t;
       memset(dp,-1,sizeof(dp));
       ll ans=fn(s.length()-1,t.length()-1);
       path(s.length()-1,t.length()-1);
       reverse(Ans.begin(),Ans.end());
       cout<<Ans<<"\n";
       //cout<<ans<<" "<<ans<<"\n"; 
   }
}

Measured memory_bytes: 71040
// vim: ts=2 sw=2 sts=2
#include <bits/stdc++.h>
using namespace std;

int main() {
  char c;
  cin >> c;
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    cout << "vowel" << endl;
  else
    cout << "consonant" << endl;

}


Measured memory_bytes: 256
#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
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

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

        cout << (N + A+1) / 2 << endl;

        return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
inputList = list(map(int, input().split()))
N = inputList[0]
Y = inputList[1]

outX = outY = outZ = -1
for x in range(N+1):
    for y in range(N+1-x):
        z = N - x - y
        if 10000*x + 5000*y + 1000*z == Y:
            outX = x
            outY = y
            outZ = z

print(outX, outY, outZ)

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

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) ((a)>0 ?(a):-(a))
#define llong long long

int main(){
  int x,n; scanf("%d %d",&x,&n);
  int p[102]={0};
  rep(i,0,n){
    int q; scanf("%d",&q);
    p[q]=1;
  }
  for(int i=0;;i++){
    if(x-i>=0){
      if(p[x-i]==0){
      printf("%d",x-i);
      break;
      }
    }
    if(x+i<102){
      if(p[x+i]==0){
      printf("%d",x+i);
      break;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 1704
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;

long long dp[2005][2005];
int n, k;

long long fac[5000010];
long long inv[5000010];

long long modpow(int x, int p) {
    if(p == 0) return 1;
    if(p & 1) return (modpow(x, p-1) * x) % mod;
    long long m = modpow(x, p >> 1);
    return (m * m) % mod;
}
long long inverse(int x) {
    return modpow(x, mod - 2);
}

int cell(int i, int j) {
    return (i * k) + ((j - i) * (k - 1));
}

long long nCr(int n, int r) {
    long long num = fac[n];
    long long den = (inv[r] * inv[n - r]) % mod;
    return (num * den) % mod;
}
long long stars_bars(int n, int r) {
    return nCr(n + r - 1, r - 1);
}

int main() {
    fac[0] = inv[0] = 1;
    for(int i = 1; i <= 4100000; i++) {
        fac[i] = fac[i-1] * i;
        fac[i] %= mod;
        inv[i] = modpow(fac[i], mod - 2);
    }
    cin >> n >> k;
    if(k == 1) {
        cout << 1 << endl;
        exit(0);
    }
    for(int i = 0; i <= n; i++) {
        for(int j = i; j <= n; j++) {
            if(i == 0 && j == 0) {
                dp[0][0] = 1;
                continue;
            }
            dp[i][j] = 0;
            if(i > 0) dp[i][j] += dp[i - 1][j];
            if(j > i) {
                int slot = cell(i, j - 1) + 1;
                int cell = k - 2;
                long long opt = stars_bars(cell, slot);
                dp[i][j] += dp[i][j - 1] * opt;
            }
            dp[i][j] %= mod;
        }
    }
    dp[n][n] *= fac[n];
    dp[n][n] %= mod;
    cout << dp[n][n] << endl;
    return 0;
}


Measured memory_bytes: 96768
#include <stdio.h>
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a>=b){
		printf("1\n");
	}
	else if(b%a==0){
		printf("%d\n",b/a);
	}
	else{
		printf("%d\n",(b/a)+1);
	}
	return 0;
}


Measured memory_bytes: 2104
#define _USE_MATH_DEFINES
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    long double x,y,ans;
    cin >> a >> b >> x;
    if(x >= pow(a,2) * b / 2.0)
    {
        y = 2 * (b - x / pow(a,2));
        ans = 90 - atan(a / y) * 180 / M_PI;
        cout << setprecision(15) << ans;
    }
    else
    {
        y = 2 * x / (a * b);
        ans = 90 - fabs(atan(y / b) * 180 / M_PI);
        cout << setprecision(15) << ans;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0; return gcd(a, b, x, y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 0;
int a, b;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> a >> b;
  if(a > 0){
    cout << "Positive" << endl;;
    return 0;
  }
  if(b >= 0){
    cout << "Zero" << endl;
    return 0;
  }
  cout << ((b-a)%2 ? "Positive" : "Negative") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>
#include <vector>
#define P(a) ((a)*(a))
using namespace std;

int main(){
    double t,y,v;
    int f;
    while(cin >> v){
        t=v/9.8;
        y=4.9*t*t;
        f=ceil((y+5.0)/5.0);
        cout << f << endl;
    }
    return 0;
}

Measured memory_bytes: 1228
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

ll dp[50+1][2500+1][50+1];

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

  ll N, A;
  std::cin >> N >> A;

  std::vector< ll > vx(N, 0LL);
  for (ll i = 0; i < N; i++) {
    std::cin >> vx[i];
  }

  //std::vector< std::vector<ll> > dp(N+1, std::vector<ll>(N * 50 + 1, 0));
  //ll dp[50+1][2500+1][50+1];

  for (ll i = 0; i <= N; i++) {
    dp[i][0][0] = 1;
  }
  for (ll i = 1; i <= N; i++) {
    for (ll j = 0; j <= N * 50; j++) {
      for (ll k = 0; k <= N; k++) {
	dp[i][j][k] = dp[i-1][j][k];
	if (j - vx[i-1] >= 0) {
	  dp[i][j][k] += dp[i-1][j-vx[i-1]][k-1];
	}
      }
    }
  }



  ll ans = 0LL;
  for (ll k = 1; k <= N; k++) {
    ans += dp[N][A*k][k];
  }

  print(ans);
  return 0;
}


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

signed main(){
    int n,a=1e9,c[2][20];
    cin>>n;
    R(i,n)cin>>c[0][i];
    R(i,n)cin>>c[1][i];
    vector<vector<int>> p(1<<n,vector<int>(51,1e9));
    p[0][0]=0;
    R(B,1<<n){
        int o=0,d[n];
        R(i,n)if(!(B&1<<i))d[i]=o++;
        R(i,n){
            int k=abs(i-n+o);
            R(j,c[k%2][i]+1)p[B|1<<i][c[k%2][i]]=min(p[B|1<<i][c[k%2][i]],p[B][j]+d[i]);
        }
    }
    R(i,51)a=min(a,p[(1<<n)-1][i]);
    cout<<(a==1e9?-1:a);
}

Measured memory_bytes: 65792