akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <utility>
#include <tuple>
#include <cstdio>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <cmath>
#define _GLIBCXX_DEBUG
using namespace std;
const long long INF = 1LL << 60;
int main() {
    int N,M,C;
    cin >> N >> M >> C;
    //
    vector<int> B(M);

    for(int i=0;i<M;i++){
        cin >> B[i];
    }
    //
    vector<vector<int>> A(N, vector<int>(M));

    for(int i=0;i<N;i++){
        for(int j=0;j<M;j++){
            cin >> A[i][j] ;
        }
    }
    //
    int cnt=0;
    long long total=0;
    for(int i=0;i<N;i++){
        total =0;
        for(int j=0;j<M;j++){
            total = total + A[i][j]*B[j];
        }
        total = total + C;
        if(total > 0){
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3584
#include<stdio.h>
int main()
{
	long long a,b;
	char c;
	long long op(long long a,long long b,char c);
	scanf("%lld %c %lld",&a,&c,&b);
	op(a,b,c);
	printf("%lld",op(a,b,c));
	return 0;
}
long long op(long long a ,long long b ,char c )
{
	int sum=0;
	if(c=='+')sum = a+b;
    if(c=='-') sum = a+(-b);
	return(sum);
}

Measured memory_bytes: 128
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace NotFounds
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Program().Solve(new MyInputStream(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(MyInputStream cin)
        {
            var x = cin.ReadInt();
            var a = cin.ReadInt();
            var b = cin.ReadInt();
            WriteLine((x - a) % b);
        }
    }

    public class MyInputStream
    {
        private readonly System.IO.TextReader _stream;
        private char separator = ' ';
        private Queue<string> inputStream;
        public MyInputStream(System.IO.TextReader s, char separator = ' ')
        {
            this.separator = separator;
            this._stream = s;
            inputStream = new Queue<string>();
        }
        public string Read()
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
        public string ReadLine() { return _stream.ReadLine(); }
        public int ReadInt() { return int.Parse(Read()); }
        public long ReadLong() { return long.Parse(Read()); }
        public double ReadDouble() { return double.Parse(Read()); }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read(); return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt(); return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong(); return ret;}
    }
}


Measured memory_bytes: 11348
n = int(input())
ps = list(map(int, input().split()))

cnt = 0
for i in range(n - 1):
    if ps[i] == i + 1:
        ps[i], ps[i + 1] = ps[i + 1], ps[i]
        cnt += 1
        
if ps[n - 1] == n:
    cnt += 1
print(cnt)

Measured memory_bytes: 20508
#include <cstdio>
#include <iostream>

using namespace std;

int main()
{
	int K, S;
	cin >> K >> S;
	int ans = 0;

	for (int X = 0; X <= K; X++)
	{
		for (int Y = 0; Y <= K; Y++)
		{
			int Z = S - X - Y;
			if (Z < 0 || Z > K) continue;
			ans++;
		}
	}

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		int ret = 0;
		for(int i = 0 ; i < S.length() ; ++i){
			if(S.charAt(i) != T.charAt(i)){
				++ret;
			}
		}
		System.out.println(ret);
	}
}


Measured memory_bytes: 41168
N,K= map(int, input().split())
list = list(map(int, input().split())) #Hiを入力

list.sort()
if N>=K:
    while K>=1:
        del list[-1]
        K=K-1
else:
    list.clear()

x=0
for i in list:
    x=x+i

print(str(x))


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

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

class Sol{
	public void Solve(){
		Sum = new long[N+1];
		for(int i=0;i<N;i++) Sum[i+1] = Sum[i] + A[i];
		
		long min = (long)1e18;
		for(int i=2;i<=N-2;i++){
			int l1 = 1, r1 = i;
			int l = 1, r = i;
			if(i == 2){
				l1 = 1; r1 = 1;
			} else if(Sum[l] > Sum[i] - Sum[l]){
				l1 = 1; r1 = 1;
			} else {
				while(r - l > 1){
					int c = (l + r) / 2;
					if(Sum[c] <= Sum[i] - Sum[c]){
						l = c;
					} else {
						r = c;
					}
				}
				l1 = l; r1 = r;
			}
			
			int l2 = i + 1, r2 = N;
			
			l = i + 1; r = N;
			if(Sum[l] - Sum[i]> Sum[N] - Sum[l]){
				l2 = i + 1; r2 = i + 1;
			} else {
				while(r - l > 1){
					int c = (l + r) / 2;
					if(Sum[c] - Sum[i]<= Sum[N] - Sum[c]){
						l = c;
					} else {
						r = c;
					}
				}
				l2 = l; r2 = r;
			}
			
			
//Console.WriteLine("i:{0}, {1} {2} {3} {4}",i,l1,r1,l2,r2);			
			
			
			long[] v = new long[4];
			long Inf = (long) 1e18;
			long ma = 0, mi = 0;
			v[0] = Sum[l1]; v[1] = Sum[i] - Sum[l1]; v[2] = Sum[l2] - Sum[i]; v[3] = Sum[N] - Sum[l2];
			ma = -Inf; mi = Inf;
			for(int j=0;j<4;j++){
				ma = Math.Max(ma, v[j]);
				mi = Math.Min(mi, v[j]);
			}
			min = Math.Min(min, ma - mi);
			
			v[0] = Sum[r1]; v[1] = Sum[i] - Sum[r1]; v[2] = Sum[l2] - Sum[i]; v[3] = Sum[N] - Sum[l2];
			ma = -Inf; mi = Inf;
			for(int j=0;j<4;j++){
				ma = Math.Max(ma, v[j]);
				mi = Math.Min(mi, v[j]);
			}
			min = Math.Min(min, ma - mi);
			
			v[0] = Sum[l1]; v[1] = Sum[i] - Sum[l1]; v[2] = Sum[r2] - Sum[i]; v[3] = Sum[N] - Sum[r2];
			ma = -Inf; mi = Inf;
			for(int j=0;j<4;j++){
				ma = Math.Max(ma, v[j]);
				mi = Math.Min(mi, v[j]);
			}
			min = Math.Min(min, ma - mi);
			
			v[0] = Sum[r1]; v[1] = Sum[i] - Sum[r1]; v[2] = Sum[r2] - Sum[i]; v[3] = Sum[N] - Sum[r2];
			ma = -Inf; mi = Inf;
			for(int j=0;j<4;j++){
				ma = Math.Max(ma, v[j]);
				mi = Math.Min(mi, v[j]);
			}
			min = Math.Min(min, ma - mi);
			
		}
		Console.WriteLine(min);
	}
	
	long[] Sum;
	
	
	int N;
	long[] A;
	public Sol(){
		N = ri();
		A = rla();
	}

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


Measured memory_bytes: 32348
// C++11
#include <algorithm>
#include <array>
#include <bitset>
#include <chrono>
#include <cmath>
#include <iostream>
#include <numeric>
#include <random>
#include <set>
#include <unordered_set>
#include <vector>
#include <list>

using namespace std;

#define LOCAL 1

#if LOCAL
#define pv(val) cerr << #val << '=' << (val) << endl
#define pvn(name, val) cerr << name << '=' << (val) << endl
#define pl cerr << '@' << __LINE__ << endl
#else
#define pv(val)
#define pvn(name, val)
#define pl
#endif

template <class T>
ostream& operator<<(ostream& os, vector<T> const& vec) {
  if (vec.empty()) {
    os << "{}";
  } else {
    os << '{';
    for (size_t i = 0; i < vec.size() - 1; i++) os << vec[i] << ", ";
    os << vec.back() << '}';
  }
  return os;
}

template <class T, size_t S>
ostream& operator<<(ostream& os, array<T, S> const& arr) {
  if (arr.empty()) {
    os << "{}";
  } else {
    os << '{';
    for (size_t i = 0; i < arr.size() - 1; i++) os << arr[i] << ", ";
    os << arr.back() << '}';
  }
  return os;
}

int main(void) {
  int H, W;
  cin >> H >> W;

  vector<string> S(H);
  int nBlack = 0;
  for(int i = 0; i < H; i++) {
    cin >> S[i];
    nBlack += count(S[i].begin(), S[i].end(), '#');
  }

  if(S[0][0] == '#') cout << -1 << endl;
  
  vector<vector<int>> d(H);
  for(auto& r : d) r.resize(W, -1);
  d[0][0] = 0;

  list<pair<int, int>> q;
  q.push_back({0, 0});
  array<pair<int, int>, 4> dxy = {
    pair<int, int>{-1, 0}, {1, 0}, {0, -1}, {0, 1}
  };
  while(!q.empty()){
    auto t = q.front();
    q.pop_front();

    for(auto dd : dxy){
      int ny = t.first + dd.first, nx = t.second + dd.second;
      int cy = t.first, cx = t.second;
      if(ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
      if(S[ny][nx] == '#') continue;
      if(d[ny][nx] != -1) continue;
      d[ny][nx] = d[cy][cx] + 1;
      q.push_back({ny, nx});
    }
  }
  pv(d[H-1][W-1]);
  if (d[H - 1][W - 1] == -1)
    cout << -1 << endl;
  else {
    cout << H * W - nBlack - d[H - 1][W - 1] - 1 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18

using namespace std;

int main(void){
  string s;
  cin >> s;
  
  ll n = s.size();
  vector<ll> sum(n + 1, 0);
  ll t = 1;
  for (int i = 0; i < n; i++){
    if (i != 0)
      t = t * 10 % 2019;
    sum[n - i - 1] = (sum[n-i] + t * (s[n-i-1] - '0')) % 2019;
  }

  

  vector<ll> c(2019, 0);
  for (int i = 0; i < n + 1; i++){
    c[sum[i]]++;
  }

  ll ans = 0;
  for (int i = 0; i < 2019; i++){
    ans += c[i] * (c[i] - 1)/2;
  }
  cout << ans << endl;
  
  
  

  return 0;
}


Measured memory_bytes: 5072
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
using ll = long long;


int main(){
    ll n,x,ans=0;
    cin >> n >> x;
    vector<ll> a(n);
    for(ll i=0;i<n;i++) cin >> a[i];
    for(ll i=0;i<n-1;i++){
        if(a[i]+a[i+1]>x){
            ans+=(a[i]+a[i+1]-x);
            if(x-a[i]>0)    a[i+1]=x-a[i];
            else a[i+1]=0;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr=limii()
cnt=0
if n==1:
    print(1)
    exit()

if arr[0]<arr[1]:
    temp=0
elif arr[0]==arr[1]:
    temp=1
else:
    temp=2
    
for i in range(n-1):
    if temp==0:
        if arr[i]<= arr[i+1]:
            pass
        else:
            cnt+=1
            temp=1
    elif temp==1:
        if arr[i]<arr[i+1]:
            temp=0
        elif arr[i]==arr[i+1]:
            pass
        else:
            temp=2
    else:
        if arr[i]>=arr[i+1]:
            pass
        else:
            cnt+=1
            temp=1
print(cnt+1)
    
    
    
    
    

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

#define pb push_back
#define mp make_pair
#define ll long long
#define inf 10e8

using namespace std;

int inDegree[100005];
bool visited[100005];
int dp[100005];

void init(int *a, int size){
	for (int i = 0; i <= size; ++i)
	{
		a[i] = 0;
	}
}

void init(bool *a, int size){
	for (int i = 0; i <= size; ++i)
	{
		a[i] = false;
	}
}

void dfs(vector<int> *g, int a){
	visited[a] = true;
	// vector<int>::iterator it;
	// for(it = g[a].begin(); it !=g[a].end(); it++){
	for (int i = 0; i < g[a].size(); ++i){
		inDegree[g[a][i]]--;
		dp[g[a][i]] = max(dp[g[a][i]], 1+dp[a]);
		if (inDegree[g[a][i]] == 0)
		{
			dfs(g, g[a][i]);
		}
	}
}

void addEdge(vector<int> adj[], int start, int end/*, int wt*/){
	// printf("pusing start %d in end %d\n", start, end);
	adj[start].pb(end);
	inDegree[end]++;
	// adj[end].pb(start);
}

void printGraph(vector<int> g[], int nodes){
	printf("nodes \n");
	for (int i = 0; i <= nodes; ++i)
	{
		for (int j = 0; j < g[i].size(); ++j)
		{
			printf("%d, %d \n",i, g[i][j]);
		}
	}
}

void takeEntry(vector<int>*g/*, int nodes*/){
	int start, end;
	scanf("%d%d", &start, &end);
	addEdge(g, start, end);
	// printGraph(g, nodes);
}

// EDIT INPUT IN graphInput.txt

int main(int argc, char const *argv[])
{
	int nodes, edges,  wt;
	
	cin>>nodes>>edges;


	init(inDegree, nodes+1);
	init(dp,  nodes+1);
	init(visited,  nodes+1);

	vector<int> g[nodes+1];

	// vector<pair<int, int> >	adj[nodes+1];
	
	for (int i = 0; i < edges; ++i)
	{
		takeEntry(g /*, nodes*/);
	}

	// printGraph(g, nodes);

	for (int i = 1; i <= nodes; ++i){
		if (!visited[i] && inDegree[i] ==0){
			dfs(g, i);
		}		
	}	
	int nax = -1;
	for (int i = 1; i <= nodes; ++i)
	{
		if (dp[i] > nax)
		{
			nax = dp[i];
		}
	}
	printf("%d\n", nax);
	return 0;
}




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

using namespace std;



int main(){
	long long int N, M;
	cin >> N >> M;
	vector<int>D(26, 0);
	for( int i = 0; i < N; i++ ){
		for( int j = 0; j < M; j++ ){
			char c;
			cin >> c;
			D[c - 'a']++;
		}
	}
	int v4 = 0, v2 = 0, v1 = 0;
	for( int i = 0; i < 26; i++ ){
		v4 += D[i] / 4;
		D[i] %= 4;
		v2 += D[i] / 2;
		D[i] %= 2;
		v1 += D[i];
	}

	if( N % 2 == 0 && M % 2 == 0 ){
		if( v1 == 0 && v2 == 0 ){
			cout << "Yes" << endl;
		} else{
			cout << "No" << endl;
		}
	} else if( N % 2 == 1 && M % 2 == 1 ){
		if( v1 == 1 && N / 2 + M / 2>= v2 ){
			cout << "Yes" << endl;
		} else{
			cout << "No" << endl;
		}
	} else{
		if( v1 == 0 ){
			if( ( N % 2 == 1 && M / 2 >= v2 ) || ( M % 2 == 1 && N / 2 >= v2 ) ){
				cout << "Yes" << endl;
			} else{
				cout << "No" << endl;
			}
		} else{
			cout << "No" << endl;
		}
	}

}


Measured memory_bytes: 256
public class Main {
	public static void main(String args[]) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int N = sc.nextInt();

		int cnt = 0;
		int tmp = 0;
		int s = 1;
		boolean t = false;
		for (int i = 0; i < N ;i++) {
			tmp = sc.nextInt();
			if (s == tmp) {
				s++;
				t = true;
			} else {
				cnt++;
			}
		}

		if (t) {
			System.out.print(cnt);
		} else {
			System.out.print(-1);
		}

	}
}


Measured memory_bytes: 64836
n,k = map(int,input().split())
li = []
for i in range(n):
    a,b = map(int,input().split())
    li.append((a,b))
li.sort(key = lambda x:x[0])
count = 0

for i in range(10**5):
    count += li[i][1]
    if count >= k:
        print(li[i][0])
        break


Measured memory_bytes: 18192
#include <stdio.h>

int main(void)
{
    int H,W,i,j,k,l;
    char a[101][101] = {'\0'};
    char *o[101];
    char *p;
    int is_removed = 0;

    scanf("%d %d", &H, &W);
    for(i=0;i<H;i++) {
        scanf("%s", a[i]);
        o[i] = a[i];
    }
    /* remove col */
    for(j=0,l=0;j<W;j++) {
        is_removed = 1;
        for(i=0;i<H;i++) {
            o[i][l] = o[i][j];
            if ('.' != o[i][l]) {
                is_removed = 0;
            }
        }
        if(is_removed == 0) l++;
    }

    /* remove row */
    for(i=0;i<H;i++) {
        p = o[i];
        for(j=0;j<l;j++,p++) {
            if('.' != *p) break;
        }
        if(j != l) {
            o[i][l] = '\0';
            printf("%s\n",o[i]);
        }
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int k;
        cin >> k;
        if(k == 0)
            return 0;

        int ret = 0;
        for(int i=0; i<k*(k-1)/2; ++i){
            int tmp;
            cin >> tmp;
            ret += tmp;
        }
        ret /= k-1;
        cout << ret << endl;
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

int n,m,a[100010],imos[100010];

int sum,cnt;

bool isOK(int x){
	sum = cnt = 0;
	for(int i = 0;i < n;i++){
		int ind = lower_bound(a,a + n,x - a[i]) - a;
		cnt += n - ind;
		sum += imos[n] - imos[ind] + (n - ind) * a[i];
	}
	return cnt <= m;
}

signed main(){
	cin >> n >> m;
	for(int i = 0;i < n;i++) cin >> a[i];
	sort(a,a + n);
	for(int i = 0;i < n;i++) imos[i + 1] = imos[i] + a[i];
	int ok = INF,ng = 0;
	while(ok - ng > 1){
		int mid = (ok + ng) / 2;
		if(isOK(mid)) ok = mid;
		else ng = mid;
	}
	isOK(ok);
	cout << sum + ng * (m - cnt) << endl;
}

Measured memory_bytes: 1792
sum = [0,0,0,0]
while 1:
    try:
        num, blood = (str(x) for x in input().split(','))
        index = 0
        if blood == "B":
            index = 1
        elif blood == "AB":
            index = 2
        elif blood == "O":
            index = 3
        sum[index] += 1
    except EOFError:
        break
for i in sum :
    print(i)


Measured memory_bytes: 5568
let () =
    let _ = stdin.ReadLine()
    let aarr = stdin.ReadLine().Split()
               |> Array.map int
    aarr
    |> Array.groupBy (fun a -> a % 2)
    |> Array.choose (fun (k, arr) -> if k = 1 then Some(Array.length arr) else None)
    |> (fun arr -> (Array.isEmpty arr) || arr.[0] % 2 = 0)
    |> function | true -> "YES" | false -> "NO"
    |> printfn "%s"

Measured memory_bytes: 19784
#include<iostream>
using namespace std;
int i; 
string a;
int main(){
	cin>>a;
	i=-1;
	do{
		i++;
	}while((a.find((i+'a')) >= 0 && a.find((i + 'a')) < a.size()) &&26>i);
	if(i>25){
		cout<<"None";
	}else{
		cout<<(char)(i+97);
	}
	return 0; 
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  signed y,m,d;
  scanf("%d/%d/%d",&y,&m,&d);
  //cout<<y<<" "<<m<<" "<<d<<endl;
  if(m>4) cout<<"TBD"<<endl;
  else cout<<"Heisei"<<endl;
  
  return 0;
}


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

ls = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(ls[k - 1])

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    class A_165_WeLoveGolf
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            // 整数の入力
            long K = long.Parse(Console.ReadLine());
            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            long A = inputLongArray[0];
            long B = inputLongArray[1];
            string result = "";
            for (int i = 0; i < B - A + 1; i++)
            {
                if ((A + i) % K == 0)
                {
                    result = "OK";
                    break;
                }
                else
                {
                    result = "NG";
                }
                
            }

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


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

int main()
{
  string s;
  cin >> s;
  cout << ((s[0]==s[1] &&s[2] == s[3] && s[0]!=s[2]) ||\
          (s[0]==s[2] &&s[1] == s[3] && s[0]!=s[3]) ||\
          (s[0]==s[3] &&s[2] == s[1] && s[0]!=s[1]) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

int abs(int a){
	return a > 0 ? a : -a;
}

bool cmp(int a, int b){
	return abs(a) > abs(b);
}

using std::sort;
const int mod = 1000000007l;
int n, k, a[1000010];
int pos = 0, neg = 0;

int main(){
	scanf("%d%d", &n, &k);
	for(int i = 1; i <= n; ++i){
		scanf("%d", a + i);
		if(a[i] >= 0)
		++pos;
		else
		++neg;
	}
	
	if(n == k){
		long long int p = 1;
		for(int i = 1; i <= n; ++i)
		p *= (a[i] + mod) % mod,
		p %= mod;
		printf("%lld", (p + mod) % mod);
		return 0;
	}
	
	sort(a + 1, a + n + 1, cmp);
	
	/*
	for(int i = 1; i <= n; ++i)
	printf("%d ", a[i]);
	puts("");
	*/
	
	if(!pos){
		long long int p = 1;
		if(k % 2)
		for(int i = n; k; --i, --k)
		p *= a[i] + mod, 
		p %= mod;
		else for(int i = 1; i <= k; ++i)
		p *= a[i] + mod, 
		p %= mod;
		printf("%lld", (p + mod) % mod);
		return 0;
	}
	
	long long int ps = 0, min_ps = 1,
	              ng = 0, max_ng = 1,
	              pos1 = -1, pos2 = -1;
	long long int p = 1;
	for(int i = 1; i <= k; ++i){
		if(a[i] >= 0)
		p *= min_ps,
		++ps,
		min_ps = a[i];
		else
		p *= max_ng + mod,
		++ng,
		max_ng = a[i]; 
		p %= mod;
	}
	
	if(ng % 2 == 0){
		
		printf("%lld", (p * (max_ng + mod) % mod * min_ps % mod + mod) % mod);
		return 0;
	}
	
	if(ng)
	for(int i = k + 1; i <= n; ++i)
	if(a[i] >= 0){
		pos1 = min_ps * a[i];
		break;
	}
	
	if(ps)
	for(int i = k + 1; i <= n; ++i)
	if(a[i] < 0){
		pos2 = max_ng * a[i];
		break;
	}
	
	if(pos1 >= 0)
	printf("%lld", ( (pos1 > pos2 ? pos1 : pos2) % mod * p % mod + mod ) % mod);
	else
	printf("%lld", (pos2 % mod * p % mod + mod) % mod );
	return 0;
}

Measured memory_bytes: 2520
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<62;
const LL INF=1<<17;



int main(){
    int n;cin >> n;
    for (int i = 0; i < n; i++) {
        int a;cin >> a;
        if(a%2){
            puts("first");
            return 0;
        }
    }
    puts("second");
    return 0;
}



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

int main() {
	int N, M, K;
	cin >> N >> M >> K;
	vector<long long> A(N), B(M);
	long long sum = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		sum += A[i];
	}
	for (int i = 0; i < M; i++) cin >> B[i];
	int MAX = 0, ai = N - 1, now = N;
	for (int i = 0; i < M; i++) {
		sum += B[i];
		now++;
		while (sum > K && ai >= 0) {
			sum -= A[ai];
			ai--;
			now--;
		}
		if (sum > K) break;
		MAX = max(MAX, now);
	}
	sum = 0;
	for (int i = 0; i < M; i++) sum += B[i];
	now = M;
	int bi = M - 1;
	for (int i = 0; i < N; i++) {
		sum += A[i];
		now++;
		while (sum > K && bi >= 0) {
			sum -= B[bi];
			bi--;
			now--;
		}
		if (sum > K) break;
		MAX = max(MAX, now);
	}

	cout << MAX << endl;
}

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
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 main()
{
    double result{0};
    double a; cin >> a;
    double b; cin >> b;
    double h; cin >> h;
    double m; cin >> m;
    double c2 = a*a + b*b - 2*a*b*cos((60*h+m)*PI/360 - m*PI/30);
    result = sqrt(c2);

    cout << fixed << setprecision(10) << result << endl;
    return 0;
}

Measured memory_bytes: 4172
#include <stdint.h>

#include <algorithm>
#include <bitset>
#include <functional>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

uint64_t dp[100000][13];
uint64_t rem_count_table[13][13];  // rem_count_table[N][k] = count(x % 13 == k)
                                   // x: [10N, 10(N+1))

void gen_rem_count_table() {
  for (int N = 0; N < 13; N++) {
    for (int x = 10 * N; x < 10 * (N + 1); x++) {
      rem_count_table[N][x % 13]++;
    }
  }
}

uint64_t calc(string &s, int result_rem) {
  for (int i = 0; i < s.size(); i++) {
    if (i == 0) {
      if (s[i] == '?') {
        for (int k = 0; k < 13; k++) {
          dp[i][k] = k < 10 ? 1 : 0;
        }
      } else {
        for (int k = 0; k < 13; k++) {
          dp[i][k] = (k == (s[i] - '0')) ? 1 : 0;
        }
      }
      continue;
    }
    if (s[i] == '?') {
      for (int k = 0; k < 13; k++) {
        for(int t = 0; t < 13; t++){
          dp[i][k] += rem_count_table[t][k] * dp[i-1][t];
          dp[i][k] %= 1000000007;
        }
      }
    } else {
      for(int t = 0; t < 13; t++){
        int k = (t * 10 + (s[i] - '0')) % 13;
        dp[i][k] += rem_count_table[t][k] * dp[i-1][t];
        dp[i][k] %= 1000000007;
      }
    }
  }
  return dp[s.size() - 1][result_rem];
}

int main(int argc, char *argv[]) {
  string s;
  std::cin >> s;
  gen_rem_count_table();
  cout << calc(s, 5) << endl;

  return 0;
}


Measured memory_bytes: 10624
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static  ll INF = 1e9;
using namespace std;

signed main(){
	ll a,b;
	cin>>a>>b;
	if((a+b)%2==0)cout<<(a+b)/2<<endl;
	else cout<<"IMPOSSIBLE"<<endl;
	return 0;
}


Measured memory_bytes: 768
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define int long long
#define INF 1000000007ll
using namespace std;

inline int my_pow(int x,int y)
{
	if(y==0ll) return 1ll;
	if(y==1ll) return x;
	int res=my_pow(x,y/2ll);
	if(y%2ll==0ll) return (res*res)%INF;
	else return (((res*res)%INF)*x)%INF;
}

inline int func(int x,int y)
{
	int res=1ll,res2=1ll;
	for(int i=1;i<=y;i++){
		res*=(x-i+1ll);res%=INF;
		res2*=i;res2%=INF;
	}
	res*=my_pow(res2,INF-2ll);res%=INF;
	return res;
}

signed main()
{
	ios::sync_with_stdio(false);
	int n,a,b;
	cin>>n>>a>>b;
	int num1=my_pow(2,n)-1ll;
	int num2=func(n,a);
	int num3=func(n,b);
	num1-=num2;num1-=num3;
	num1%=INF;
	if(num1<0ll) num1+=INF;
	cout<<num1<<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 repbtw(i, a, b) for (int i = a; i <= (int)(b); i++)
#define all(v) v.begin(), v.end()
#define pr(x) cout << x << endl


int main()
{
    int n, m;
    cin >> n >> m;
    vector<vector<int>> paths(n, vector<int>(0));
    vector<int> mark(n);
    vector<bool> visited(n, false);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        paths.at(a-1).push_back(b-1);
        paths.at(b-1).push_back(a-1);
    }
    queue<int> vq;
    vq.push(0);
    visited.at(0) = true;
    while(!vq.empty()){
        int now = vq.front();
        vq.pop();
        for(auto nxt : paths.at(now)){
            if(!visited.at(nxt)){
                visited.at(nxt) = true;
                mark.at(nxt) = now;
                vq.push(nxt);
            }
        }
    }
    pr("Yes");
    repbtw(i, 1, n-1) pr(mark.at(i) + 1);
    
    return 0;
}



Measured memory_bytes: 10296
import java.util.Scanner;

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

		int n = scanner.nextInt(); // 入力する数字の個数を設定
		boolean[][] a; // 特定多数の数字を入れるため配列aを設定
		a = new boolean[4][13];

		for (int i = 0; i < n; i++) {
			String mark = scanner.next();
			int runk = scanner.nextInt();

			if (mark.equals("S")) {
				a[0][runk - 1] = true;

			}
			if (mark.equals("H")) {
				a[1][runk - 1] = true;

			}
			if (mark.equals("C")) {
				a[2][runk - 1] = true;

			}
			if (mark.equals("D")) {
				a[3][runk - 1] = true;
			}
			

		}
		for (int i = 0; i < 13; i++) {
			if (a[0][i]) {
			} else {
				System.out.println("S " + (i + 1));
			}
		}

		for (int i = 0; i < 13; i++) {
			if (a[1][i]) {
			} else {
				System.out.println("H " + (i + 1));
			}
		}
		for (int i = 0; i < 13; i++) {
			if (a[2][i]) {
			} else {
				System.out.println("C " + (i + 1));
			}
		}
		for (int i = 0; i < 13; i++) {
			if (a[3][i]) {
			} else {
				System.out.println("D " + (i + 1));
			}
		}
		scanner.close();

	}
}



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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

ll dp[110][110][500];

int main() {
    ll N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N), w2(N);
    rep(i, N) cin >> w[i] >> v[i];
    rep(i, N) w2[i] = w[i] - (w[0] - 1);

    rep(i, N) {
        rep(j, N) {
            rep(k, 500) {
                if (j > 0 && dp[i][j][k] == 0) continue;

                chmax(dp[i + 1][j][k], dp[i][j][k]);
                if (k - w2[i] >= 0 && (w[0] - 1) * (j + 1) + k <= W) {
                    chmax(dp[i + 1][j + 1][k], dp[i][j][k - w2[i]] + v[i]);
                }
            }
        }
    }

//    rep(i, N + 1) {
//        cout << "i:" << i << endl;
//        rep(j, N + 1) {
//            cout << "j:" << j << endl;
//            rep(k, 10) cout << dp[i][j][k] << " ";
//            cout << endl;
//        }
//        cout << endl;
//    }

    ll ans = 0;
    rep(j, N + 1) {
        rep(k, 500) chmax(ans, dp[N][j][k]);
    }

    cout << ans << endl;
}

Measured memory_bytes: 43264
#include<stdio.h>

int G[101][101];

int main()
{
    int n, i, j, a, b, e;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
		for(j = 1; j <= n; j++){ G[i][j] = 0; } }

    for(i = 1; i <= n; i++){ scanf("%d %d", &a, &e);
		for(j = 1; j <= e; j++){ scanf("%d", &b); G[a][b] = 1; } }

    for(i = 1; i <= n; i++){ printf("%d", G[i][1]);
	for(j = 2; j <= n; j++){ printf(" %d", G[i][j]); }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 1068
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#define debug(x) cout<<x<<"\n";
#define sc scanf
#define Max(a,b) ((a)>(b)?(a):(b))
typedef long long ll;
const int N=1e5+10;
const ll inf=0x3f3f3f3f3f3f;
using namespace std;
char arr[110][110];
int main()
{	
	int n,m;
	while(sc("%d%d",&n,&m)==2)
	{
		for(int i=0;i<n;i++)
		sc("%s",arr[i]);
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<2;j++)
			printf("%s\n",arr[i]);
		}
	}
	return 0;
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define all(x) (x).begin(),(x).end()
#define print(x) if(x)cout<<"YES\n";else cout<<"NO\n";
#define f(i,x,y) for(ll i=x;i<=y;i++)
#define rf(i,x,y) for(ll i=x;i>=y;i--)
#define pb push_back
#define F first
#define S second
using namespace std;
ll res[1000000 + 1];
ll dp[1000000 + 1];
void scieve(ll n = 1000000)
{
  for (ll i = 2; i <= n; i++)
  {
    if (dp[i] == 0)
    {
      for (ll j = i * 2; j <= n; j += i)
      {
        if (i != j / i)
          dp[j] += (1 + dp[j / i]);
        else
          dp[j]++;
      }
    }
  }
}
int main()
{
// #ifndef HP
//   freopen("in.txt", "r", stdin);
//   freopen("out.txt", "w", stdout);
// #endif

  fastio;
  int t = 1;
  scieve();
  //cin >> t;
  while (t--)
  {
    ll n;
    cin >> n;
    res[0] = 0;
    res[1] = 0;
    res[2] = 1;
    for (ll i = 3; i <= n; i++)
    {
      res[i] = res[i - 1] + dp[i - 1] + 2;
    }
    cout << res[n];
  }
}


Measured memory_bytes: 19260
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	c := make([]int, 5)
	ss := "MARCH"

	for i := 0; i < n; i++ {
		s := scanString()[0]
		for j := 0; j < 5; j++ {
			if ss[j] == s {
				c[j]++
			}
		}
	}

	ans := 0
	for i := 0; i < 5; i++ {
		for j := i + 1; j < 5; j++ {
			for k := j + 1; k < 5; k++ {
				ans += c[i] * c[j] * c[k]

			}
		}
	}

	fmt.Fprintln(wr, ans)
}


Measured memory_bytes: 1536
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
#include <list>
#include <set>
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
using namespace std;
using ll = long long;
const int INF = 1e9 + 1;
ll MOD = 1e9+7;


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

    ll N, K, Q;
    cin >> N >> K >> Q;
    vector<ll> A(N,-Q+K);
    
    REP(i, Q){
        ll tmp;
        cin >> tmp;
        A[tmp-1]++;
    }
    REP(i, N){
        cout << (A[i] > 0 ? "Yes" : "No") << endl;
    }
    return 0;
}


Measured memory_bytes: 1408
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long inf = 1ll << 61;
const long long mod = 998244353;

signed main() {
	int n;double d, x; cin >> n >> d >> x;
	double ans = 0;
	double f = d + (2 * (double)n - 1)*x / 2;
	ans += f;
	rep(i,n-1){
		f = f*(n - i + 1) / (n - i);
		ans += f;
	}
	printf("%.14lf\n", ans);
}

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


int main() {
  ll n; ll p; cin>>n>>p;
  if(n==1){cout<<p;}
  else{
    int a=1;
    while(pow(a+1,n)<=p){
      a++;
    }
    //cout<<a;
    for(int i=a; i>=1; i--){
      ll b= pow(i,n);
      if(p%b==0){cout<<i;break;}
    }
  }
}

Measured memory_bytes: 4092
a = []
b = []

for i in 0..2

    a[i],b[i] = gets.split.map(&:to_i)

end

c = []
i = 0

[0, 1].repeated_permutation(4) do |bits|
    c[i] = bits 
    i += 1
end



d = []

for i in 0..15

    d[i] = 0

    if c[i].count(1) == 2 

        for j in 0..3

            if c[i][j] == 0

                if a.count(j+1)+b.count(j+1) != 1

                    d[i] = 1

                end

            else

                if a.count(j+1)+b.count(j+1) != 2

                    d[i] = 1

                end
            
            end

        end

    else

        d[i] = 1

    end

end

if d.inject(:+) == 15

    puts 'YES'

else

    puts 'NO'

end

                

            







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

int main(){
  int n;
  cin >> n;
  if(n >=400 && n <=599)  {cout << "8";}
  if(n >= 600&& n <=799)  {cout << "7";}
  if(n >=800 && n <=999)  {cout << "6";}
  if(n >=1000 && n <=1199){cout << "5";}
  if(n >=1200 && n <=1399){cout << "4";}
  if(n >=1400 && n <=1599){cout << "3";}
  if(n >= 1600&& n <=1799){cout << "2";}
  if(n >= 1800&& n <=1999){cout << "1";}
  return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<climits>
#include<cmath>

using namespace std;

void show( int arr[], unsigned int size )
{
	cout<<arr[0]<<flush;
	for( unsigned int i=1; i<size; i++ ){
		cout<<' '<<arr[i]<<flush;
	}
	cout<<endl;
}


int merge( int arr[], int arr_s, int lft, int md, int rgt)
{
	int cntr=0;

	int left_s=md-lft, right_s=rgt-md, *left=new int[left_s+1], *right=new int[right_s+1]; //????????????????????¨???????????????????????????

	for( int i=0; i<left_s; i++ ){
		left[i]=arr[lft+i];
	}
	for( int i=0; i<right_s; i++ ){
		right[i]=arr[md+i];
	}

	left[left_s]=INT_MAX;
	right[right_s]=INT_MAX;
	
	for( int i=0, j=0, k=lft ; k<rgt; k++, cntr++ ){
		if( left[i] <= right[j] ){
			arr[k]=left[i];
			++i;
		}else{
			arr[k]=right[j];
			++j;
		}
	}
	return cntr;
}

int mergeSort(int arr[], int arr_s, int lft, int rgt)
{
	static int cntr=0;
	
	if( lft+1 < rgt ){
		int md= (lft + rgt)/2;
		mergeSort(arr, arr_s, lft, md);
		mergeSort(arr, arr_s, md, rgt);
		cntr+= merge(arr, arr_s, lft, md, rgt);
	}
	return cntr;
}

int main()
{
	int *arr, arr_s;
	cin>>arr_s;
	arr=new int[arr_s];
	for( int i=0; i<arr_s; i++ ){
		cin>>arr[i];
	}

	int cnt=mergeSort( arr, arr_s, 0, arr_s );
	show( arr, arr_s );
	cout<<cnt<<endl;
}

Measured memory_bytes: 63932
#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
#define pll              pair <long long,long long>
#define pb               push_back
#define ll               long long
#define ff               first
#define ss               second
#define D(x)             cerr<<#x " = "<<(x)<<endl
#define vll              vector <ll>
#define IOS              ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl             '\n'   
using namespace std;
int main()
{
    IOS
     // freopen("input.txt","r",stdin);
     // freopen("output.txt","w",stdout);
     // freopen("error.txt","w",stderr);
    ll n,m,k;
    cin>>n>>m>>k;
    vector<ll>a(n);
    vector<ll>b(m);
    ll pb[m];
    for(ll i=0;i<n;i++)
        cin>>a[i];
    for(ll i=0;i<m;i++)
        cin>>b[i];
    ll ans=0;
    ll sum=0;
    for(ll i=0;i<m;i++)
    {
        sum+=b[i];
        if(sum<=k)
        {
            ans=max(ans,i+1);
        }
        pb[i]=sum;
    }
    sum=0;
    for(ll i=0;i<n;i++)
    {
        sum+=a[i];
        ll rem = k-sum;
        if(rem>=0)
        {
            ans=max(ans,i+1);
        }
        if(rem<=0)
            break;
        ll l=0,r=m-1;
        while(l<=r)
        {
            ll mid =(l+r)/2;
            if(pb[mid]<=rem)
            {
                ans=max(ans,mid+1+i+1);
                l=mid+1;
            }
            else
            {
                r=mid-1;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 7944
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000000LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int MAX = 2100000;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
long long COM(int n, int k){
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

int main() {
  COMinit();
  int x, y;
  cin >> x >> y;
  ll cx = 0, cy = 0;
  ll res;


  while(true){
    if(x == 0 && y == 0) break;
    if(x < 0 || y < 0 || x > 2*y) break;

    if(x < 2*y){
      x--; y -= 2;
      cy++;
    } else if(x == 2 * y){
      cx = y;
      x = 0; y = 0;
      break;
    }
  }

  if(x != 0 || y != 0) res = 0;
  else{
    res = COM(cx+cy, min(cx, cy));
  }
  cout << res % MOD << ln;
}
  


Measured memory_bytes: 49408
n = int(input())
a = []

maxx = 0
submax = 0

for i in range(n):
    k = int(input())
    if k > maxx:
        submax = maxx
        maxx = k
    elif k > submax:
        submax = k

    a.append(k)

for i in range(n):
    if a[i] == maxx:
        print(submax)
    else:
        print(maxx)

Measured memory_bytes: 12532
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int n;
  cin>>n;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  sort(rall(a));
  a.pb(0);
  //cout<<a;
  int d;
  rep(i,n){
    if(a[i]==i+1){
      //cout<<"yoko"<<endl;
      for(d=0;a[i]==a[i+1];++i) ++d;
      break;
    }else if(a[i]!=a[i+1]){
      if(a[i+1]==i+1){
	int f1=0,f2=0;
	if((a[i]-a[i+1])%2){
	  //cout<<"bokoA"<<endl;
	  f1=1;
	}
	  //cout<<"bokoB"<<i<<endl;
	  for(++i;a[i]==a[i+1];++i) ++f2;
	  f2=1-f2%2;
	  d=f1||f2;
	break;
      }else if(a[i+1]<i+1){
	//cout<<"tate"<<endl;
	d=a[i]-(i+1);
	break;
      }
    }
  }
  //cout<<d<<endl;
  cout<<(d%2?"First":"Second")<<endl;
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << endl; }
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  ll count_4 = 0;
  ll count_2 = 0;
  ll count_1 = 0;
  rep(i, n){
    ll a;
    cin >> a;
    if(a%4==0){
      count_4++;
    }
    else if(a%2==0){
      count_2++;
    }
    else{
      count_1++;
    }
  }
  if(count_1<=count_4+1){
    if(count_2>0&&count_1==1+count_4){
      print("No");
    }
    else{
      print("Yes");
    }
  }
  else{
    print("No");
  }
}

Measured memory_bytes: 3576
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    String op = str[1];
    int b = Integer.parseInt(str[2]);
    System.out.println(str[1].equals("+")?a+b:a-b);
  }
}

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

void solver() {
    int N = input(), K = input();
    vector< double > p(N + 1);
    
    range(i, 1, N + 1) {
        double d;
        cin >> d;
        
        p[i] = (d + 1) / 2;
        p[i] += p[i - 1];
    }
    
    double ans = 0;
    range(i, K, N + 1) {
        chmax(ans, p[i] - p[i - K]);
    }
    
    cout << ans << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 1792