akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))
#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define all(x) (x).begin(),(x).end()
#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))
#define _end '\n'
#define Out(x) cout<<(x)<<_end
template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

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

    int n[3];
    int ans = 0;

    cin >> n[0] >> n[1] >> n[2];

    if (n[0] == n[1] && n[1] == n[2]) {
        Out(0);
    } else {
        sort(n, n + 3);

        while (1) {
            if (n[0] < n[1] && n[1] < n[2]) {
                n[0]++;
                n[1]++;
                ans++;
            } else if (n[0] < n[1] && n[1] == n[2]) {
                n[0] += 2;
                ans++;

                if (n[2] < n[0]) swap(n[0], n[2]);
            } else if (n[0] == n[1] && n[1] < n[2]) {
                n[0]++;
                n[1]++;
                ans++;
            } else if (n[0] == n[1] && n[1] == n[2]) {
                break;
            }
        }

        Out(ans);
    }

    return 0;
}


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

using namespace std;

struct UnionFind {
    vector<int> par;
    UnionFind(int N) : par(N) {
        for(int i = 0; i < N; i++) par[i] = i;
    }
    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }
    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    int root(int x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
};

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> P(N);
  for(int i = 0; i < N; i++) cin >> P[i], P[i]--;
  UnionFind uf(N);
  for(int i = 0; i < M; i++) {
    int x, y; cin >> x >> y;
    x--, y--;
    uf.unite(x, y);
  }
  int ret = 0;
  for(int i = 0; i < N; i++) {
    if (uf.same(i, P[i])) {
      ret++;
    }
  }
  cout << ret << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)

int d[6];
void init() {
	rep(i,6) {
		d[i] = i + 1;
	}
}
void north() {
	int buf = d[0];
	d[0] = d[1];
	d[1] = d[5];
	d[5] = d[4];
	d[4] = buf;
}
void south() {
	rep(i,3) {
		north();
	}
}
void east() {
	int buf = d[0];
	d[0] = d[3];
	d[3] = d[5];
	d[5] = d[2];
	d[2] = buf;
}
void west() {
	rep(i,3) {
		east();
	}
}
void right() {
	int buf = d[1];
	d[1] = d[2];
	d[2] = d[4];
	d[4] = d[3];
	d[3] = buf;
}
void left() {
	rep(i,3) {
		right();
	}
}
int main() {
	int n;
	while(1) {
		cin >> n;
		if(n == 0) break;
		init();
		string s;
		int ret = 1;
		rep(i,n){ 
			cin >> s;
			if(s[0] == 'N') north();
			else if(s[0] == 'W') west();
			else if(s[0] == 'E') east();
			else if(s[0] == 'S') south();
			else if(s[0] == 'R') right();
			else left();
			ret += d[0];
		}
		cout << ret << endl;
	}
	return 0;
}

Measured memory_bytes: 1208
S = input()
kisu = []
gusu = []
for i in range(len(S)):
    if i == 0:
        kisu.append(S[i])
    elif i == 1:
        gusu.append(S[i])
    elif i%2 == 0:
        kisu.append(S[i])
    else:
        gusu.append(S[i])
if kisu.count("R")+kisu.count("U")+kisu.count("D") == len(kisu):
    if gusu.count("L")+gusu.count("U")+gusu.count("D") == len(gusu):
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

using namespace std;

using ll = long long;

#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FORE(i, a, b) for(int i=(a);i<=(b);++i)
#define rep(i, n) for(int i=0;i<(n);++i)
#define repe(i, n) for(int i=0;i<=(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define SP cout<<fixed<<setprecision(10)
typedef pair<int, int> P;
const ll inf = (ll) 1e18;
const int mod = (int) 1e9 + 7;

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

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

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

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

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	ll x;
	cin >> n >> x;
	ll a[n], b[n];
	rep(i, n) {
		cin >> a[i];
		b[i] = a[i];
	}
	
	ll ans = inf;
	rep(i, n) {
		rep(j, n) {
			b[j] = min(b[j], a[(j - i + n) % n]);
		}
		ll time = x * i;
		rep(j, n) {
			time += b[j];
		}
		ans = min(ans, time);
	}
	
	cout << ans << endl;
	
	return 0;
}

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

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

  int cnt = 0;
  int div_cnt;
  for (int i = 1; i < N + 1; i++)
  {
    div_cnt = 0;
    for (int j = 1; j < i + 1; j++)
    {
      if (i % j == 0 && i % 2 == 1){
        div_cnt += 1;
      }
    }
    if (div_cnt == 8) cnt += 1;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3644
def ext_euc(a, b):
    # return x, y, gcd(a, b) s.t. ax + by = gcd(a, b)
    if b == 0:
        return 1, 0, a
    y, x, v = ext_euc(b, a % b)
    y -= (a // b) * x
    return x, y, v


def mod_inv(a, mod):
    x, _, _ = ext_euc(a, mod)
    return x % mod


def comb(n, k, mod):
    if k >= n // 2:
        return comb(n, n - k, mod)
    ret = 1
    for i in range(k):
        ret *= n - i
        ret *= mod_inv(k - i, mod)
        ret %= mod
    return ret


def main():
    MOD = 10 ** 9 + 7
    N, M, K = list(map(int, input().split(' ')))
    ans = comb(N * M - 2, K - 2, MOD)
    ans *= ((N ** 2) * (M - 1) * M * (M + 1) + (M ** 2) * (N - 1) * N * (N + 1)) // 6
    ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 9276
a,b,c,k=map(int,input().split())
ans=a
if k-a<=0:
    print(k)
    exit()
if k-a-b<=0:
    print(ans)
    exit()
if k-a-b-c<0:
    ans=ans+(k-a-b)*(-1)
    print(ans)
else:
    ans=ans-c
    print(ans)

Measured memory_bytes: 9120
formula = input().split()
stack = []

for x in formula:
    if x.isdigit():
        stack.append(x)
    else:
        second_num = stack.pop()
        first_num = stack.pop()
        tmp = eval(first_num + x + second_num)
        stack.append(str(tmp))

print(int(stack.pop()))


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

int main(){
  int H,W;
  cin >> H >> W;
  string campas[10101];
  for(int i = 0; i < H; i++){
    cin >> campas[i];
  }
  for(int i = 1; i < H-1; i++){
    for(int j = 1; j < W-1 ;j++){
      int cnt = 0;
      if(campas[i][j] != '#')continue;
      if(campas[i][j-1] == '#')cnt++;
      if(campas[i][j+1] == '#')cnt++;
      if(campas[i-1][j] == '#')cnt++;
      if(campas[i+1][j] == '#')cnt++;
      
      if(cnt == 0){
	cout << "No" <<endl;
	return 0;
      }
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=100100;
int n;
struct point
{
    int pos,num;
}a[N];
bool cmp(point x,point y)
{
    return x.pos<y.pos;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i].pos);
        a[i].num=i;
    }
    sort(a+1,a+n+1,cmp);
    for(int i=1;i<=n;i++)
    printf("%d ",a[i].num);
    return 0;
}


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

const long double pi = 3.14159265358979323846;

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

    long double a, b, h, m;
    cin >> a >> b >> h >> m;
    long double hdeg = h * 30.0 + m / 60.0 * 30.0;
    long double mdeg = m * 6.0, deg = abs(hdeg - mdeg);
    long double cosDeg = cos(deg * pi / 180.0);
    long double sq1 = a * a, sq2 = b * b;
    long double ans = sqrt(sq1 + sq2 - 2.0 * a * b * cosDeg);
    cout << fixed << showpoint;
    cout << setprecision(20);
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 4120
#include<stdio.h>
#include<math.h>

#define pi 3.1415926535

int main(void){
  int a,b,h,m;
  scanf("%d%d%d%d",&a,&b,&h,&m);

  double angle = 11*pi*m/360 - pi*h/6;
  double l = sqrt(a*a+b*b-2*a*b*cos(angle));

  printf("%.9lf",l);
  return 0;
}

Measured memory_bytes: 2520
#include<stdio.h>
int main(){
  int w,h,n,i;
  scanf("%d%d%d",&w,&h,&n);
  int mass[n+1][3];
  int left=0,right=w,up=h,down=0;
  for(i=0;i<n;i++){
    scanf("%d%d%d",&mass[i][0],&mass[i][1],&mass[i][2]);
    if(mass[i][2]==1){
      if(left<mass[i][0])
        left=mass[i][0];
    }
    else if(mass[i][2]==2){
      if(right>mass[i][0])
        right=mass[i][0];
    }
    else if(mass[i][2]==3){
      if(down<mass[i][1])
        down=mass[i][1];
    }
    else{
      if(up>mass[i][1])
        up=mass[i][1];
    }
  }
  if(up-down<0 || right-left<0)
    puts("0");
  else
    printf("%d\n",(up-down)*(right-left));
  return 0;
}


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

using namespace std;

int main(){
        int n,ans=0;
        string s;

        cin>>n>>s;

        for(int i=0; i<1000; i++){
                int ch_digit=0,ch_val=i;
                char ch_num[3];
                ch_num[2]='0'+ch_val%10;
                ch_val/=10;
                ch_num[1]='0'+ch_val%10;
                ch_val/=10;
                ch_num[0]='0'+ch_val%10;
                ch_val/=10;

                for(int j=0; j<n; j++){
                        if(s[j]==ch_num[ch_digit]){
                                ch_digit++;
                        }
                        if(ch_digit==3){
                                ans++;
                                break;
                        }
                }
        }

        cout<<ans<<endl;

        return 0;
}


Measured memory_bytes: 3692
#include<iostream>
#include<vector>
#include<cstdlib>
#include <cmath>

#define INF 100000000
template<class T> inline bool chmax(T& a, T b)
{ if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b)
{ if (a > b) { a = b; return 1; } return 0; }

using namespace std;

int main(){
  int i,j,k,n,d,a[100];
  cin >>n;
  if(n==1)cout <<1<<endl;
  else cout << n*n*n<<endl;


    return 0;
}

Measured memory_bytes: 256
/* ****revpro**** */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl	   '\n'
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)    
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mii	    map<ll,ll>
using namespace std;

#define N  100005
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		ll n;
		cin>>n;
		cout<<(n)*(n-1)/2;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 200001;
struct node
{
    int id;
    int c;
}stu[maxn];
int Hash[maxn];
bool cmp(node a,node b)
{
    return a.c<b.c;
}
int main()
{
    int N,K;
    int count;
    int num;
    while(~scanf("%d%d",&N,&K))
    {
        memset(Hash,0,sizeof(Hash));
        count = 0;
        for(int i=0;i<N;i++)
        {
            cin>>num;
            stu[i].id = num;
            if(!Hash[num]) count++;
            Hash[num]++;
        }
        for(int i=0;i<N;i++)
        {
            stu[i].c = Hash[stu[i].id];
        }
        //cout<<count<<endl;
        int Hash1[maxn];
        memset(Hash1,0,sizeof(Hash1));
        int result = 0;
        if(count<=K)
        result = 0;
        else
        {
            sort(stu,stu+N,cmp);
            for(int i=0;i<N;i++)
            {
                if(count<=K) break;
                if(!Hash1[stu[i].id])
                {
                    //cout<<stu[i].id<<":"<<stu[i].c<<endl;
                    result+=stu[i].c;
                    Hash1[stu[i].id] = 1;
                    count--;
                }
            }
        }
        cout<<result<<endl;
    }
    return 0;
}


Measured memory_bytes: 3328
import std.stdio;
import std.string;
import std.format;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.concurrency;
import std.traits;
import std.uni;
import std.regex;
import core.bitop : popcnt;
alias Generator = std.concurrency.Generator;

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

void main() {
  double L;
  scanln(L);
  writefln("%0.8f", (L/3)^^3);
}

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


void times(alias fun)(long n) {
  // n.iota.each!(i => fun());
  foreach(i; 0..n) fun();
}
auto rep(alias fun, T = typeof(fun()))(long n) {
  // return n.iota.map!(i => fun()).array;
  T[] res = new T[n];
  foreach(ref e; res) e = fun();
  return res;
}

T ceil(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  // `(x+y-1)/y` will only work for positive numbers ...
  T t = x / y;
  if (y > 0 && t * y < x) t++;
  if (y < 0 && t * y > x) t++;
  return t;
}

T floor(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  T t = x / y;
  if (y > 0 && t * y > x) t--;
  if (y < 0 && t * y < x) t--;
  return t;
}

ref T ch(alias fun, T, S...)(ref T lhs, S rhs) {
  return lhs = fun(lhs, rhs);
}
unittest {
  long x = 1000;
  x.ch!min(2000);
  assert(x == 1000);
  x.ch!min(3, 2, 1);
  assert(x == 1);
  x.ch!max(100).ch!min(1000); // clamp
  assert(x == 100);
  x.ch!max(0).ch!min(10); // clamp
  assert(x == 10);
}

mixin template Constructor() {
  import std.traits : FieldNameTuple;
  this(Args...)(Args args) {
    // static foreach(i, v; args) {
    foreach(i, v; args) {
      mixin("this." ~ FieldNameTuple!(typeof(this))[i]) = v;
    }
  }
}

void scanln(Args...)(auto ref Args args) {
  enum sep = " ";
  enum n = Args.length;
  enum fmt = n.rep!(()=>"%s").join(sep);

  string line = readln.chomp;
  static if (__VERSION__ >= 2074) {
    line.formattedRead!fmt(args);
  } else {
    enum argsTemp = n.iota.map!(
      i => "&args[%d]".format(i)
    ).join(", ");
    mixin(
      "line.formattedRead(fmt, " ~ argsTemp ~ ");"
    );
  }
}

// fold was added in D 2.071.0
static if (__VERSION__ < 2071) {
  template fold(fun...) if (fun.length >= 1) {
    auto fold(R, S...)(R r, S seed) {
      static if (S.length < 2) {
        return reduce!fun(seed, r);
      } else {
        return reduce!fun(tuple(seed), r);
      }
    }
  }
}

// popcnt with ulongs was added in D 2.071.0
static if (__VERSION__ < 2071) {
  ulong popcnt(ulong x) {
    x = (x & 0x5555555555555555L) + (x>> 1 & 0x5555555555555555L);
    x = (x & 0x3333333333333333L) + (x>> 2 & 0x3333333333333333L);
    x = (x & 0x0f0f0f0f0f0f0f0fL) + (x>> 4 & 0x0f0f0f0f0f0f0f0fL);
    x = (x & 0x00ff00ff00ff00ffL) + (x>> 8 & 0x00ff00ff00ff00ffL);
    x = (x & 0x0000ffff0000ffffL) + (x>>16 & 0x0000ffff0000ffffL);
    x = (x & 0x00000000ffffffffL) + (x>>32 & 0x00000000ffffffffL);
    return x;
  }
}


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

  int a,b,c,x;
  int main(){
    cin>>a>>b>>c>>x;
    int cnt = 0;

    for (int i = 0; i <= a; i++) {
      for (int j = 0; j <= b; j++) {
        for (int k = 0; k <= c; k++) {
          if (i*500+j*100+k*50==x) {
            cnt++;
          }
        }
      }
    }
    cout << cnt << endl;
    return 0;
  }


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

using namespace std;

int main(){
    int k, x;
    cin >> k >> x;
    for (int i = k-1; i >= 0; i--){
        cout << (x-i) << " ";
    }
    for (int i = 1; i < k; i++){
        cout << (x+i) << " ";
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int area = a*b;
        int length =2*(a+b);
        System.out.println(area + " " + length);
    }
}


Measured memory_bytes: 26216
#include<bits/stdc++.h>
using namespace std;
int n,a[200001];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for(int i=2;i<=n;i++)if(a[i]==a[i-1])
	{
		puts("NO");
		return 0;
	}
	puts("YES");
	return 0;
}


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

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

using namespace std;

int N, T;
vector<int> A;

int diff[100000];

void solve() {
	int max = A[N - 1], min = 0;
	diff[N - 1] = 0;
	
	for (int i = N - 2; i >= 0; --i) {
		diff[i] = MAX(max - A[i], 0);
		max = MAX(max, A[i]);
		min = MIN(min, A[i]);
	}
	
	int max_diff = 0;
	int count = 0;
	for (auto& d : diff) {
		if (d > max_diff) {
			count = 1;
			max_diff = d;
		}
		else if (d == max_diff) {
			count += 1;
		}
	}
	
	cout << count;
}

int main() {
	while (cin >> N >> T) {
		A.resize(N);
		for (int i = 0; i < N; ++i) {
			cin >> A[i];
		}
		
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 1152
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    int[][string] dic;
    string[] list;
    list ~= "";
    while(true){
	string s = readln();
	if(stdin.eof())break;
	auto s1 = s.split();
	dic[s1[0]] ~= to!int(s1[1]);
	list ~= s1[0];
    }
    list.sort;
    for(int i=1;i<list.length;i++){
	if(list[i-1] != list[i]){
	    writeln(list[i]);
	    writeln(dic[list[i]].sort.to!(string[]).join(" "));
	}
    }
}

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

using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll D;
    cin>>D;
    if(D==25){
      cout<<"Christmas"<<endl;
    }
    if(D==24){
      cout<<"Christmas Eve"<<endl;
    }
    if(D==23){
      cout<<"Christmas Eve Eve"<<endl;
    }
    if(D==22){
      cout<<"Christmas Eve Eve Eve"<<endl;
    }

}


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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

#define N 10000001
// #define N 200

int div_count[N];

void init() {
	div_count[1] = 1;

	for (int i = 2; i < N; i++)
		div_count[i] = 2;

	for (int i = 2; i*i < N; i++) {
		
		for (int j = i*i; j < N; j += i) {
			if (j == i*i)
				div_count[j]++;
			else
				div_count[j] += 2;
		}
	}

	// for (int i = 0; i < N; i++)
	// 	cout << "(" << i << ")" << div_count[i] << " ";
	// cout << endl;
}

ll solve(int n) {
	init();

	ll ans = 0;
	for (int i = 1; i <= n; i++)
		ans += (ll)i * (ll)div_count[i];

	return ans;
}

int main() {

	IOS

	int n;
	cin >> n;

	cout << solve(n);

	return 0;
}

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

#define rep(i,n) for(ll i=0;i<n;i++)
#define repm(i,m,n) for(ll i=m;i<n;i++)
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define YesNo(a) (a)?cout<<"Yes"<<endl:cout<<"No"<<endl
#define YESNO(a) (a)?cout<<"YES"<<endl:cout<<"NO"<<endl
#define INF (2e9)
#define PI (acos(-1))
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007

typedef long long ll;

int n;

int main(){
  cin >> n;
  
  cout << (n-1)/2 + 1 << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB emplace_back
#define PF emplace_front
#define FILL(a,b) memset(a,b,sizeof(a))
#define lwb lower_bound
#define upb upper_bound
using namespace std;
int vis[200005],n,a[200005];
void get(int p,int k){
	FOR(i,1,k)p=a[p];
	cout<<p;exit(0);
}
void dfs(int p,int k){
	if(!k){
		cout<<p;exit(0);
	}
	if(vis[p]){
		int len=vis[p]-k;
		k%=len;
		get(p,k);
	}else{
		vis[p]=k;
		dfs(a[p],k-1);
	}
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int k;
	cin>>n>>k;
	FOR(i,1,n)cin>>a[i];
	dfs(1,k);
	RE 0;
}




Measured memory_bytes: 6776
def main():
    s = input()
    alphabet = "".join([chr(i) for i in range(97, 97 + 26)])
    if len(s) < 26:
        for i in alphabet:
            if i not in s:
                print(s + i)
                exit()
    else:
        if s == "zyxwvutsrqponmlkjihgfedcba":
            print(-1)
        else:
            for i in reversed(range(26)):
                for j in reversed(range(i + 1, 26)):
                    if s[i] < s[j]:
                        print(s[:i] + s[j])
                        exit()


if __name__ == '__main__':
    main()


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

#define rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

ll mod=1000000007;

const ll INF = 1LL << 60;

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

int main() {
  int x,y,z;cin >> x >> y >> z;
  swap(x,y);
  swap(x,z);
  cout << x << ' '<< y<<' '<<z<<endl;
}

Measured memory_bytes: 256
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd
# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# import re
# import array
# import copy
# import functools
# import operator

# import collections
# import itertools
# import bisect
# import heapq


# from heapq import heappush
# from heapq import heappop
# from queue import PriorityQueue as pq

# # from itertools import accumulate
# # from collections import deque
# import random


def main():
    n = int(input())
    # l=[["",0,0] for i in range(n)]
    l=[]
    # eprint(l)
    for i in range(n):
        s,m=input().split()
        m = -int(m)
        l.append([s,m,i+1])
        # l[i][0]=s
        # l[i][1]=m
        # l[i][2]=i+1
    # eprint(l)
    l.sort()
    # eprint(l)
    for x in l:
        print(x[2])

if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <set>
#include <map>
#include <list>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

#define mod (1e9 + 7)
#define PI 3.1415926535897932
#define rep(i, n) for (int i = 0; i < n; i++)
#define repe(i, j, n) for (int i = j; i < n; i++)
#define repi(i, n) for (int i = 0; i <= n; i++)
#define repie(i, j, n) for (int i = j; i <= n; i++)
#define all(x) x.begin(), x.end()
#define println() cout << endl
#define P pair<int, int>
#define fi first
#define se second

typedef long long ll;


void solve1() {
    int n; cin >> n;
    vector<string> s(n);
    set<string> ss;
    map<string, int> m;
    rep(i,n) {
        cin >> s[i];
        ss.insert(s[i]);
    }

    sort(all(s));
    int maxnum = -1;
    for(auto itr = ss.begin(); itr != ss.end(); itr++) {
        int num = upper_bound(all(s), *itr) - lower_bound(all(s), *itr);
        m.insert(make_pair(*itr, num));
        maxnum = max(num, maxnum);
    }

    for (auto itr = ss.begin(); itr != ss.end(); itr++)
    {
        if(m[*itr] == maxnum) {
            cout << *itr << endl;
        }
    }
}

int main()
{
    solve1();
}


Measured memory_bytes: 40676
from bisect import bisect_left, bisect_right


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    idx = [[] for _ in range(int(2e5+1))]
    for i in range(N):
        idx[A[i]].append(i)
    pos = 0
    empty = []
    visited = set()
    while pos == 0 or pos % N != 0:
        empty.append(pos)
        visited.add(pos % N)
        a = A[pos % N]
        nxt = bisect_right(idx[a], pos % N) % len(idx[a])
        npos = idx[a][nxt] + (pos//N) * N
        if npos <= pos:
            npos += N
        pos = npos + 1
    goal = N * K % pos
    cur = empty[max(0, bisect_right(empty, goal) - 1)]
    #print(cur, goal)
    ans = []
    seen = set()
    while cur < goal:
        i = cur % N
        a = A[i]
        nxt = bisect_right(idx[a], cur % N) % len(idx[a])
        ncur = idx[a][nxt] + (cur//N) * N
        if ncur <= cur:
            ncur += N
        if ncur < goal:
            cur = ncur + 1
        else:
            ans += [a]
            cur = cur + 1
    print(*ans)


if __name__ == "__main__":
    main()


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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<'\n';exit(0);}

void solve() {
  string a; cin >> a;
  if(a == "a") drop("vowel");
  if(a == "e") drop("vowel");
  if(a == "i") drop("vowel");
  if(a == "o") drop("vowel");
  if(a == "u") drop("vowel");
  cout << "consonant" << '\n';
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}


Measured memory_bytes: 3656
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<60);
const ld pi=acosl((ld)1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};


struct UnionFind {
  vector< int > data;
 
  UnionFind(int sz) {
    data.assign(sz, -1);
  }
 
  bool unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }
 
  int find(int k) {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }
 
  int size(int k) {
    return (-data[find(k)]);
  }
};


void solve(){
  ll n;cin>>n;
  ll k,l;cin>>k>>l;
  UnionFind uf1(n);
  UnionFind uf2(n);
  rep(i,k){
    ll a,b;cin>>a>>b;
    a--;b--;
    uf1.unite(a,b);
  }
  rep(i,l){
    ll a,b;cin>>a>>b;
    a--;b--;
    uf2.unite(a,b);
  }

  map<pair<ll,ll>,ll>mp;
  rep(i,n){
    mp[make_pair(uf1.find(i),uf2.find(i))]++;
  }
  rep(i,n){
    cout<<mp[make_pair(uf1.find(i),uf2.find(i))]<<endl;
  }
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
	cout<<setprecision(30);
	solve();
}


Measured memory_bytes: 13568
#include <stdio.h>          // printf(), scanf()
#include <math.h>           // round()
#define N 2

int
main(int argc, char** argv)
{
	double x[N][N + 1];

	while (scanf("%lf %lf %lf %lf %lf %lf", &x[0][0], &x[0][1], &x[0][2], &x[1][0], &x[1][1], &x[1][2]) != EOF)
	{
		int i, j, k;
		for (k = 0; k < N; ++k)
		{
			double p = x[k][k];
			for (j = k; j < N + 1; ++j)
				x[k][j] /= p;

			for (i = 0; i < N; ++i)
			{
				if (i != k)
				{
					double d = x[i][k];
					for (j = k; j < N + 1; ++j)
						x[i][j] -= d * x[k][j];
				}
			}
		}

		x[0][N] = round(x[0][N] * 1000) / 1000;
		x[1][N] = round(x[1][N] * 1000) / 1000;
		printf("%.3f %.3f\n", x[0][N], x[1][N]);
	}

	return 0;
}

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

const int MAXN = 100005;

// tree
vector<int> adjList[MAXN];
int size[MAXN];         // [i] = size of subtree rooted as node i
int par[MAXN];          // [i] = parent node of node i
int height[MAXN];       // [i] = distance of root to node i

int segcount;                // number of segments
int seg[MAXN];               // [i] = segment of node i
int segroot[MAXN];           // [s] = root node of segment s
int segdepth[MAXN];          // [i] = number of segments node i has to pass to reach root
int segitempos[MAXN];        // [i] = position of node i in its segment
vector<int> segitem[MAXN];   // [s] = list of node in segment s;

int get_size(int x, int p) {
    par[x] = p, size[x] = 1;
    
    for (vector<int>::iterator it = adjList[x].begin(); it != adjList[x].end(); ++it) {
        if (*it == p) continue;
        
        size[x] += get_size(*it, x);
    }

    return size[x];
}

void build(int x, int _seg, int _depth = 0, int _height = 0) {
    height[x] = _height;
    
    seg[x] = _seg;
    segdepth[x] = _depth;
    
    segitempos[x] = segitem[_seg].size(); segitem[_seg].push_back(x);
    
    // find special child
    int largest = -1;
    for (vector<int>::iterator it = adjList[x].begin(); it != adjList[x].end(); ++it) {
        if (*it == par[x]) continue;
        if (largest == -1 || size[largest] < size[*it]) largest = *it;
    }
    if (largest == -1) return;
    
    build(largest, _seg, _depth, _height + 1);
    
    for (vector<int>::iterator it = adjList[x].begin(); it != adjList[x].end(); ++it) {
        if (*it == largest || *it == par[x]) continue;
        
        segroot[++segcount] = x;
        build(*it, segcount, _depth + 1, _height + 1);
    }
}

int lca (int a, int b) {
    if (a == b) return a;

    if (seg[a] == seg[b]) {         // same segment
        if (height[a] < height[b])
            return a;
        else
            return b;
    }

    if (segdepth[a] > segdepth[b])          // segment a is above segment b
        return lca(segroot[seg[a]], b);
    else if (segdepth[a] < segdepth[b])     // segment a is under segment b
        return lca(a, segroot[seg[b]]);
    else                                    // same depth
        return lca(segroot[seg[a]], segroot[seg[b]]);
}

int main () {

    int N, Q;
    scanf("%d",&N);

    for (int u = 0, M; u < N; u++) {
        scanf("%d",&M);
        for (int i = 0, v; i < M; i++) {
            scanf("%d",&v);
            adjList[u].push_back(v);
        }
    }
    
    int root = 0;
    get_size(root, -1);
    build(root, segcount);
    
    scanf("%d", &Q);
    for (int i = 0, u, v; i < Q; ++i) {
        scanf("%d%d", &u, &v);

        printf("%d\n",lca(u,v));
    }

    return 0;
}

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

N, M, Q = [int(x) for x in input().split()]
L = [0] * M
R = [0] * M
p = [0] * Q
q = [0] * Q
for i in range(M):
    L[i], R[i] = [int(x) for x in input().split()]
for j in range(Q):
    p[j], q[j] = [int(x) for x in input().split()]

train = [[0 for i in range(N + 1)] for _ in range(N + 2)]

for i in range(M): # すべての列車について
    train[L[i]][R[i]] += 1

for col in range(1, N + 1):
    for row in range(col, 0, -1):
        train[row][col] += train[row][col - 1] + train[row + 1][col] - train[row + 1][col - 1]

for j in range(Q):
    print(train[p[j]][q[j]])


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

#define int long long

#define inf 1000000007LL
#define mod 1000000007LL

#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
#define rfor(i, s, t) for(int i = (t) - 1; i >= (s); i--)

int k[334334];
int t[334334];

int d[334334];

int now = 0;
void func(int x, int w) {
  if(w == 1) {
    if(x - k[x] < 0) {
      now++;
    }
    else {
      if(t[x - k[x]]) {
        now++;
      }
      t[x - k[x]]++;
    }
    k[x]++;
  }
  else {
    k[x]--;
    if(x - k[x] < 0) {
      now--;
    }
    else {
      t[x - k[x]]--;
      if(t[x - k[x]]) {
        now--;
      }
    }
  }
}

signed main() {
  int n, m;
  cin >> n >> m;
  rep(i, n) {
    k[i] = 0;
    t[i] = 0;
  }
  rep(i, n) {
    cin >> d[i];
    d[i]--;
    func(d[i], 1);
  }
  rep(i, m) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    func(d[x], -1);
    d[x] = y;
    func(d[x], 1);
    cout << now << endl;
  }
}


Measured memory_bytes: 7808
#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;

ll N, X;
ll len[55];
ll pat[55];

ll rec(ll n, ll x) {
  if(n==0) return 1;
  
  if(x==1) {
    return 0;
  }else if(1<x && x<=1+len[n-1]) {
    return rec(n-1, x-1);
  }else if(x==1+len[n-1]+1) {
    return pat[n-1]+1;
  }else if(1+len[n-1]+1<x && x<=1+len[n-1]+1+len[n-1]) {
    return pat[n-1]+1+rec(n-1, x-1-len[n-1]-1);
  }else if(x==len[n]) {
    return pat[n];
  }
  
  return 0;
}

int main(void) {
  cin >> N >> X;
  ll i, j;
  
  len[0]=1;
  pat[0]=1;
  for(i=1; i<=N; i++) {
    len[i]=1+len[i-1]+1+len[i-1]+1;
    pat[i]=pat[i-1]+1+pat[i-1];
  }
  
  pt(rec(N, X));
  
}


Measured memory_bytes: 256
a = []
b = []
flag = 0
while True:
    H,W = map(int,raw_input().split())
    if H == 0 and W == 0:
        break
    a.append(H)
    b.append(W)
    flag+=1

for k in range(0,flag):
    head = ""
    naka = ""
    for i in range(b[k]):
        head+="#"
        if i == 0 or i == b[k]-1:
            naka+="#"
        else:
            naka+="."
    for j in range(a[k]):
        if j == 0 or j == a[k]-1:
            print head
        else:
            print naka
    print ""


Measured memory_bytes: 4664
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

struct state {
    string pref, suff;
    ll cost;

    int hash() {
        ll res = 0;
        for (int i=0;i<pref.length();i++) {
            res = (res*41+pref[i]-'a'+1)%1000000007;
        }
        for (int i=0;i<suff.length();i++) {
            res = (res*43+suff[i]-'a'+1)%1000000007;
        }
        return res;
    }
};

bool cmp(state a, state b) {
    return a.cost>b.cost;
}

bool chk(state a) {
    string x = a.pref, y = a.suff;
    reverse(x.begin(), x.end());
    reverse(y.begin(), y.end());
    return a.pref==x&&a.suff==y;
}

string s[55];
ll w[55];
priority_queue<state, vector<state>, decltype(&cmp)> pq(cmp);
map<int, ll> dist;
set<int> dead;

int main() {
    ios_base::sync_with_stdio(0);
    int n; cin >> n;
    for (int i=0;i<n;i++) cin >> s[i] >> w[i];

    for (int i=0;i<n;i++) {
        state now = {s[i], "", w[i]};
        pq.push(now);
        dist[now.hash()] = w[i];
    }
    while (pq.size()) {
        state now = pq.top(); pq.pop();
        //cout << now.pref << " | " << now.suff << " " << now.cost << endl;
        dead.insert(now.hash());
        if (chk(now)) {
            cout << now.cost << endl;
            return 0;
        }

        string cur = now.pref+now.suff;
        for (int i=0;i<n;i++) {
            int ok = 1;
            string t = s[i];
            if (now.pref.length()>0) reverse(t.begin(), t.end());
            int len = min(cur.length(), t.length());

            for (int p=0;p<len;p++) {
                if (cur[p]!=t[p]) ok = 0;
            }
            if (ok) {
                string a = cur.substr(len);
                string b = t.substr(len);
                state x = {a, b, now.cost+w[i]};
                if (now.pref.length()==0) {
                    swap(x.pref, x.suff);
                }
                int hsval = x.hash();
                if (dist.find(hsval)==dist.end()||dist[hsval]>x.cost) {
                    if (dead.find(hsval)==dead.end()) {
                        dist[hsval] = x.cost;
                        pq.push(x);
                    }
                }
            }
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 3720
#include <stdio.h>

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

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

    long long bestScores[N+1];
    long long blackScores[N+1];
    // white scores is always 0.
    bestScores[0] = 0;
    blackScores[0] = 0;
    for (int i=1; i<=N; i++) {
        if (ai[i] > 0) {
            bestScores[i] = bestScores[i-1] + ai[i];
        } else {
            bestScores[i] = bestScores[i-1];
        }
        blackScores[i] = blackScores[i-1] + ai[i];
    }

    long long maxBlackDiff = -100000000000001L;
    long long maxWhiteDiff = -100000000000001L;
    for (int i=1; i<=N-K+1; i++) {
        long long best = bestScores[i+K-1] - bestScores[i-1];
        long long black = blackScores[i+K-1] - blackScores[i-1];
        long long white = 0;

        long long blackDiff = black - best;
        long long whiteDiff = white - best;
        if (blackDiff > maxBlackDiff) {
            maxBlackDiff = blackDiff;
        }
        if (whiteDiff > maxWhiteDiff) {
            maxWhiteDiff = whiteDiff;
        }
    }
    
    long long result = 0;
    if (maxBlackDiff > maxWhiteDiff) {
        result = bestScores[N] + maxBlackDiff;
    } else {
        result = bestScores[N] + maxWhiteDiff;
    }

    printf("%lld\n", result);
  
	return 0;
}


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

int main(){
	int n;
	cin>>n;
	int a[n+1],b[n+1]; 
	
	for(int i=1;i<=n;i++){
		b[i]=0;
	}
	
	for(int i=2;i<=n;i++){
		cin>>a[i];
		b[a[i]]++;
	}
	
	for(int i=1;i<=n;i++)
		cout<<b[i]<<" ";
		
	return 0;
}

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

    vector<ll> A(n);
    rep(i, n) cin >> A[i];
    
    ll INF = 1LL<<61;
    ll left = -INF, right = INF;

    sort(all(A));
    while (right - left > 1) {
        ll mid = (left + right) / 2;
        ll sum = 0;
        rep(i, n) {
            if (A[i] > 0) {
                ll l2 = -1, r2 = n;
                while (r2 - l2 > 1) {
                    ll m = (r2 + l2) / 2;
                    if (A[i] * A[m] <= mid) {
                        l2 = m;
                    }
                    else {
                        r2 = m;
                    }
                }
                sum += r2;
            }
            else if (A[i] < 0) {
                ll l2 = -1, r2 = n;
                while (r2 - l2 > 1) {
                    ll m = (r2 + l2) / 2;
                    if (A[i] * A[m] <= mid) {
                        r2 = m;
                    }
                    else {
                        l2 = m;
                    }
                }
                sum += n - r2;
            }
            else if (mid >= 0) {
                sum += n;
            }
            
            if (A[i] * A[i] <= mid) sum--;
        } 

        sum /= 2;
        if (sum >= K) right = mid;
        else left = mid;
    }

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

Measured memory_bytes: 4764
#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;

int main(void){
    double r,x,y;

	cin >> r;

    x = r * r * M_PI;

    y = r * 2 * M_PI;
    
    /* cout << x  << endl; */

    cout << setprecision(6) << setiosflags(ios::fixed) << x;

    cout << " " ;
 
    cout << setprecision(6) << setiosflags(ios::fixed) << y << endl;

	return 0;
}

Measured memory_bytes: 3276
object Main {
  def main(args: Array[String]): Unit = {
    val s = new Main()
    s.solve()
    s.out.flush()
  }
}

class Main {
  import java.io._
  import java.util.StringTokenizer

  import scala.collection.mutable
  import scala.util.Sorting
  import math.{abs, max, min}
  import mutable.{ArrayBuffer, ListBuffer}
  import scala.reflect.ClassTag

  val MOD = 1000000007
  val out = new PrintWriter(System.out)

  def solve(): Unit = {
    val N = ni()
    val A = na(N)

    def powMod(x: Int, n: Int, m: Int): Int = {
      def step(x: Long, n: Int, stack: Long): Long = {
        n match {
          case 0 => stack
          case _ => step(x * x % m, n / 2, if (n % 2 == 1) stack * x % m else stack)
        }
      }
      step(x, n, 1).toInt
    }

    val NN = N + 1
    val F = Array.ofDim[Long](NN + 1)
    F(0) = 1
    rep(NN) { i =>
      F(i + 1) = F(i) * (i + 1) % MOD
    }
    val I = Array.ofDim[Long](F.length)
    I(NN) = powMod(F(NN).toInt, MOD - 2, MOD)

    // x! = x(x-1)!
    // x!I(x!) ≡ (x-1)!I((x-1)!)
    // I((x-1)!) ≡ I(x!) * x   MODがでかいので(x-1)!はMODと素
    rep_r(NN) { i =>
      I(i) = I(i + 1) * (i + 1) % MOD
    }

    def rev(x: Int) = {
      I(x) * F(x - 1)
    }

    /**
      * i = 0 には簡単のため1ではなく0が入っている
      * i = 1 に 1/2が入っている
      */
    val cum = Array.ofDim[Long](N + 1)
    rep(cum.length - 1, 1) { i =>
      cum(i) = (cum(i - 1) + rev(i + 1)) % MOD
    }

    var ans = 0L
    rep(N) { i =>
      val l = i
      val r = N - 1 - i
      val cnt = (1 + cum(l) + cum(r)) * F(N) % MOD
      ans = (ans + A(i) * cnt) % MOD
    }

    out.println(ans)
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = _

    def next(): String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next().toInt
    def nextLong(): Long = next().toLong
    def nextChar(): Char = next().charAt(0)
  }
  val sc = new InputReader(System.in)
  def ni(): Int = sc.nextInt()
  def nl(): Long = sc.nextLong()
  def nc(): Char = sc.nextChar()
  def ns(): String = sc.next()
  def ns(n: Int): Array[Char] = ns().toCharArray
  def na(n: Int): Array[Int] = map(n)(_ => ni())
  def nal(n: Int): Array[Long] = map(n)(_ => nl())
  def nm(n: Int, m: Int): Array[Array[Char]] = map(n) (_ => ns(m))
  def rep(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = offset
    val N = n + offset
    while(i < N) { f(i); i += 1 }
  }
  def rep_r(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = n - 1 + offset
    while(i >= offset) { f(i); i -= 1 }
  }

  def map[@specialized A: ClassTag](n: Int)(f: Int => A): Array[A] = {
    val res = Array.ofDim[A](n)
    rep(n)(i => res(i) = f(i))
    res
  }

  def sumL(as: Array[Int]): Long = {
    var s = 0L
    rep(as.length)(i => s += as(i))
    s
  }
}

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

char s[15];
int n,m;

int main(){
	scanf("%s",s);
	n=strlen(s);
	for(int i=0;i<n;i++) if(s[i]=='o') m++;
	m+=15-n;
	if(m>=8) puts("YES");
	else puts("NO");
	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=Integer.parseInt(in.next()),q=Integer.parseInt(in.next());
		mylist A[]=new mylist[n];
		for(int i=0;i<n;i++)A[i]=new mylist();
		
		for(int i=0;i<q;i++){
			int query=Integer.parseInt(in.next());
			
			switch(query){
			case 0:
				int t1=Integer.parseInt(in.next()),x=Integer.parseInt(in.next());
				A[t1].add(x);
				break;
				
			case 1:
				int t2=Integer.parseInt(in.next());
				if(A[t2].size==0)out.println();
				else{
					node NOW=A[t2].END.next;
					for(int j=0;j<A[t2].size-1;j++){
						out.print(NOW.v+" ");
						NOW=NOW.next;
					}
					out.println(NOW.v);
				}
				break;
				
			case 2:
				int t3=Integer.parseInt(in.next()),t4=Integer.parseInt(in.next());
				A[t3].END.prev.next=A[t4].END;
				A[t3].END.next.prev=A[t4].END.prev;
				A[t4].END.prev.next=A[t3].END.next;
				A[t4].END.prev=A[t3].END.prev;
				A[t4].size+=A[t3].size;
				A[t3].clearlist();
				break;
			}
		}
		out.flush();
	}

}

class node{
	int v;
	node prev,next;
}

class mylist{
	int size;
	node END;
	
	mylist(){
		END=new node();
		END.prev=END;
		END.next=END;
		size=0;
	}
	
	void add(int x){
		node NEW=new node();
		{
			NEW.v=x;
			NEW.next=END;
			NEW.prev=END.prev;
		}
		{
			NEW.prev.next=NEW;
			NEW.next.prev=NEW;
		}
		size++;
	}
	
	void clearlist(){
		END.prev=END;
		END.next=END;
		size=0;
	}
}



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

int main(){
	while(1){
	int x, y, z;
	cin >> x >> y;
	if( x == 0 && y == 0) break;
	if( x > y ){ z = x; x = y; y = z; cout << x << " " << y << endl; }else{ cout << x << " " << y << endl; }
	}
return 0;
}

Measured memory_bytes: 1160
mod = pow(10, 9)+7

n = int(input())
a_list = list(map(int, input().split()))
a_sum = sum(a_list)
a_sq = sum(map(pow, a_list, [2]*n))

a = (a_sum**2//2)%mod
b = (a_sq//2%mod)
print((a-b)%mod)

Measured memory_bytes: 31764