akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define all(a)          (a).begin(), (a).end()
#define sort(a)         sort(all(a))
#define uniq(a)         sort(a);(a).erase(unique(all(a), (a).end()))
#define reverse(a)      reverse(all(a))
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }
#define pb              push_back
#define fst             first
#define int             long long
#define INF             __LONG_LONG_MAX__

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve() {
  ll n; cin >> n;
  int a[2][101] = {{}};
  int dp[2][101] = {{}};
  rep(i, 2) {
    rep(j, n) {
      cin >> a[i][j];
    }
  }

  dp[0][0] = a[0][0];
  dp[1][0] = a[1][0] + a[0][0];
  for (int i = 1; i < n; i++) { 
    dp[0][i] = dp[0][i-1] + a[0][i];
  }
  for (int i = 1; i < n; i++) { 
    dp[1][i] = max(dp[0][i], dp[1][i-1]) + a[1][i];
  }

  outl(dp[1][n-1]);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define inlld(x) scanf("%lld", &x)
#define ind(x) scanf("%d", &x)
#define inlld2(x, y) scanf("%lld%lld", &x, &y)
#define inlld3(x, y, z) scanf("%lld%lld%lld", &x, &y, &z)
#define ind2(x, y) scanf("%d%d", &x, &y)
#define ind3(x, y, z) scanf("%d%d%d", &x, &y, &z)

const int N=1e3+5;
const int MOD=1e9+7;

typedef long long ll;
typedef long double ld;

using namespace std;

ll n, h, arr1[N], arr2[N], dp[10*N][N];

ll solve(ll i, ll j)
{
    if(i<=0)
        return 0;
    if(j>n)
        return 1e15;
    if(dp[i][j]!=-1)
        return dp[i][j];
    return min(solve(i, j+1), solve(i-arr1[j], j)+arr2[j]);
}

int main()
{
    inlld2(h, n);
    for(ll a=1; a<=n; a++)
        inlld2(arr1[a], arr2[a]);
    // memset(dp, -1, sizeof(dp));
    for(ll a=0; a<=h; a++)
        for(ll b=n+1; b>=1; b--)
        {
            if(a==0)
                dp[a][b]=0;
            else if(b>n)
                dp[a][b]=1e15;
            else if(a-arr1[b]<=0)
                dp[a][b]=min(dp[a][b+1], arr2[b]);
            else
                dp[a][b]=min(dp[a][b+1], dp[a-arr1[b]][b]+arr2[b]);
        }
    printf("%lld\n", dp[h][1]);
    return 0;
}

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

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

    ll l, r;
    cin >> l >> r;

    ll s = l % 2019, t = r % 2019;

    if (r >= l + 2018 || s >= t)
    {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 1e12;

    rep(i, s, t) rep(j, i + 1, t + 1)
    {
        ans = min(ans, (ll)(i * j) % 2019);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int p=sc.nextInt();//a-b
    int q=sc.nextInt();//b-c
    int r=sc.nextInt();//c-a

    int min=Math.min(p+q,r+q);
        min=Math.min(min,p+r);
        min=Math.min(min,q+r);
        min=Math.min(min,r+p);
        min=Math.min(min,q+p);

    System.out.println(min);
  }
}


Measured memory_bytes: 22996
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	decimal[] GD => Strs.Select(decimal.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	static T[] ConstantArray<T>(int n, T val) { var a = new T[n]; for (var i = 0; i < n; i++) a[i] = val; return a; }
	static T[] MakeArray<T>(int n, Func<int, T> f) { var a = new T[n]; for (var i = 0; i < n; i++) a[i] = f(i); return a; }
	const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var S = Str.Split('/').Select(int.Parse).ToArray();
		int m = S[1], d = S[2];
		WriteLine(m <= 4 ? "Heisei" : "TBD");
	}
}


Measured memory_bytes: 13268
#!/usr/bin/env python3
import sys

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
        
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]
        
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())
    
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def solve(N: int, M: int, K: int, A: "List[int]", B: "List[int]", C: "List[int]", D: "List[int]"):
    return


def main():
    N, M, K = map(int, input().split())
    connection = [[] for _ in range(N)]
    uf = UnionFind(N)
    for i in range(M):
        a, b = map(lambda x: int(x) - 1, input().split())
        connection[a].append(b)
        connection[b].append(a)
        uf.union(a, b)

    for i in range(K):
        c, d = map(lambda x: int(x) - 1, input().split())
        if uf.same(c, d):
            connection[c].append(d)
            connection[d].append(c)

    ans = []
    for i in range(N):
        ans.append(uf.size(i) - len(connection[i]) - 1)
    L = [str(i) for i in ans]
    print(" ".join(L))


if __name__ == '__main__':
    main()


Measured memory_bytes: 42512
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using msi=map<string,int>;
using mii=map<int,int>;
//using pii=pair<int,int>;
using vlai=valarray<int>;
using ll=long long;
using pii=pair<ll,ll>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1e9
#define EPS 1e-9
#define MOD (1e9+7)
void get(){}template<class H,class...T>void get(H&h,T&...t){cin>>h;get(t...);}
#define dcl(...) int __VA_ARGS__;get(__VA_ARGS__);


int main(){
    dcl(h,w,k);
    rep(i,h+1)rep(j,w+1){
        if(w*i+h*j-i*j*2==k){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 256
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
ll n,x,y,z,a[MAXN],b[MAXN],c[MAXN];
ll ans,res;
vector<P> v;
multiset<int> ms;
ll res1[MAXN],res2[MAXN];
int main()
{
    scanf("%lld%lld%lld",&x,&y,&z);
    n=x+y+z;
    for(ll i=1;i<=n;i++) 
    {
        scanf("%lld%lld%lld",&a[i],&b[i],&c[i]);
        res+=a[i];
        v.push_back(P(b[i]-a[i],c[i]-a[i]));
    }
    sort(v.begin(),v.end(),greater<P>());
    ll s=0;
    for(ll i=0;i<y;i++) 
    {
        s+=v[i].F;
        ms.insert(v[i].S-v[i].F);
    }
    auto it=ms.end();
    res1[0]=s;
    for(ll i=y;i<y+z;i++)
    {
        s+=v[i].F;
        if(it!=ms.end()&&(v[i].S-v[i].F>=*it))
        {
            s+=v[i].S-v[i].F;
            ms.insert(v[i].S-v[i].F);
        }
        else
        {
            ms.insert(v[i].S-v[i].F);
            it--;s+=*it;
        }
        res1[i-y+1]=s;
    }
    ms.clear();s=0;
    for(ll i=n-1;i>=y+z;i--) ms.insert(v[i].S);
    it=ms.end();
    res2[0]=0;
    for(ll i=y+z-1;i>=y;i--)
    {
        if(it!=ms.end()&&(v[i].S>=*it))
        {
            s+=v[i].S;
            ms.insert(v[i].S);
        }
        else
        {
            ms.insert(v[i].S);
            it--;s+=*it;
        }
        res2[y+z-i]=s;
    }
    for(ll i=0;i<=z;i++) ans=max(ans,res+res1[i]+res2[z-i]);
    printf("%lld\n",ans);
    return 0;
}



Measured memory_bytes: 8820
a, b = input().split()
l = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "1"]
if l.index(a) > l.index(b):
    print("Alice")
elif l.index(a) == l.index(b):
    print("Draw")
else:
    print("Bob")

Measured memory_bytes: 38384
#include<bits/stdc++.h>
#include<vector>
#define int long long
#include<string>
#define float long double
using namespace std;
   signed main()
 {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a=0;
  string s,t;
  cin>>s>>t;
  for(int i=0;i<3;i++)
  {
      if(s[i]==t[i])
        a++;
  }
  cout<<a;
}


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

class Program
{
    const int MOD = 998244353;
    public void Slove()
    {   
        var input = Console.ReadLine();
        int len = input.Length;

        int red = 0;
        int blue = 0;
        int[] dp = new int[len * 2 + 1];
        dp[0] = 1;
        foreach(var i in Enumerable.Range(1, len * 2))
        {
            if(i - 1 < len)
            {
                if(input[i - 1] == '2')
                {
                    red += 1;
                }
                else if(input[i - 1] == '1')
                {
                    red += 1;
                    blue ++;
                }
                else
                    blue++;
            }
            if(i > 1 && i - 1 <= len)
            {
                if(input[i - 2] == '2')
                {
                    red += 1;
                }
                else if(input[i - 2] == '0')
                {
                    blue++;
                }
            }
            foreach(int j in Enumerable.Range(0, red + 1).Reverse())
            {
                if(j < i - blue)
                {
                    dp[j] = 0;
                    break;
                }
                if(j != 0)
                    dp[j] += dp[j - 1];
                if(dp[j] >= MOD)
                    dp[j] %= MOD;
            }
            //Console.WriteLine($"red:{red} blue:{blue}");
            //Console.WriteLine(string.Join(",", dp));
        }
        Console.WriteLine(dp[red]);

    }
    static void Main(string[] args)
    {
        var p = new Program();
        p.Slove();
    }
}


Measured memory_bytes: 38864
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
int main(){
	int n, t, a; int i,j;
	cin >> n >> t;
	int x[100000]; int mi[100000]; int ma[100000] = {}; vector<int> s;
	for (i = 0; i < n; i++) {
		cin >> a; x[i] = a;
	}
	mi[0] = x[0]; ma[n - 1] = x[n - 1];
	for (i = 1; i < n; i++) {
		mi[i] = min(mi[i - 1], x[i]);
		ma[n - 1 - i] = max(ma[n - i], x[n - 1 - i]);
	}
	int cma = -1; int memo;
	for (i = 0; i < n; i++) {
		if (cma < ma[i] - mi[i]) {
			cma = ma[i] - mi[i];
			s.clear();
			s.push_back(mi[i]); s.push_back(ma[i]); memo = mi[i];
		}
		else if (cma == ma[i] - mi[i]) {
			if (mi[i] < memo) {
				s.push_back(mi[i]), s.push_back(ma[i]); memo = mi[i];
			}
		}
	}
	int len = s.size();
	int out = 0; int check = 0;
	for (i = 0; i < len/2; i++) {
		int count=0; bool f=true;
		for (j = check; j < n; j++) {
			if (i < len / 2 - 1 && s[2 * (i + 1)] == x[j])break;
			if (f&&s[2 * i + 1] == x[j]) {
				f = false; count++;
			}
			if (s[2 * i] == x[j])f = true;
		}
		check = j;
		out += count;
	}
	cout << out << endl;
	return 0;
}

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

int main(){
	int n;cin>>n;
	string s;cin>>s;
	int cnt1[26];
	int cnt2[26];
	memset(cnt1,0,sizeof cnt1);
	memset(cnt2,0,sizeof cnt2);
	for(int i=0;i<n;i++){
		cnt1[s[i]-'a']++;
	}
	int mx=0;
	for(int i=0;i<n;i++){
		int now=0;
		cnt2[s[i]-'a']++;
		cnt1[s[i]-'a']--;
		for(int j=0;j<26;j++){
			if(cnt1[j]&&cnt2[j])now++;
		}
		mx=max(mx,now);
	}
	cout<<mx;
	return 0;
}

Measured memory_bytes: 3616
#include<stdio.h>
#include<stdlib.h>

void insert(int src[],int num)
{
	int i,k;
	for(i=1;i<num;i++)
	{
		int v=src[i];
		int j=i-1;
		while(j>=0&&src[j]>v)
		{
			src[j+1]=src[j];
			j--;
		}
		src[j+1]=v;
		for(k=0;k<num-1;k++)printf("%d ",src[k]);
		printf("%d\n",src[num-1]);
	}
}

int main()
{
	int N,i;
	int *data;
	scanf("%d",&N);
	data=(int *)malloc(sizeof(int)*N);
	
	for(i=0;i<N;i++)scanf("%d",&data[i]);
	
	for(i=0;i<N-1;i++)printf("%d ",data[i]);
	printf("%d\n",data[N-1]);
	insert(data,N);
	
	free(data);
	return 0;
}

Measured memory_bytes: 600
/// Updated! https://www.youtube.com/watch?v=U07_n9xGIlM
#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define dbug printf("I am here\n");
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const int maxn = 2e5+100;

const ll inf = 1e18;

int main()
{
    fast;
    set < int > st;
    int n; cin >> n;
    for(int i = 1; i<=n; i++){
        int p; cin >> p;
        st.insert(p);
    }
    if(st.size() == n)cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}
/*



*/



Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector <int> vec(N, 0);
  for(int i=0; i<N; i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(), vec.end());
  double ans=0;
  ans=vec.at(0)*pow(2, 1-N);
  for(int i=1; i<N; i++){
    ans+=vec.at(i)*pow(2,i-N);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 4180
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();


int main() {
	int a, b;
  	cin >> a >> b;
  	if (a > b) swap(a, b);
  	while(b--) {
    	cout << a;
    }
  	cout << endl;
    return 0;
}



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

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

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

	int X, Y, Z;
	cin >> X >> Y >> Z;

	cout << (X - Z) / (Y + Z) << "\n";

	return 0;
}

Measured memory_bytes: 256
// IO
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm
#include <algorithm>
#include <cmath>
#include <numeric>

// container
#include <vector>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>

// others
#include <random>
#include <limits>
#include <functional>
#include <ctime>
#include <cassert>

// type alias
using lint = long long;
using ldouble = long double;
template <class T>
using greater_priority_queue = std::priority_queue<T, std::vector<T>, std::greater<T>>;


/* ----- class ----- */

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

template <class Cost = int>
using Graph = std::vector<std::vector<Edge<Cost>>>;


/* ----- debug ----- */

#if __has_include("../setting/source/debug.hpp")
#include "../setting/source/debug.hpp"
#endif


/* ----- short functions ----- */

template <class T>
inline T sq(T a) { return a * a; }

template <class T>
inline T iceil(T n, T d) { return (n + d - 1) / d; }

template <class T>
T gcd(T a, T b) {
    while (b > 0) {
        a %= b;
        std::swap(a, b);
    }
    return a;
}

template <class T, class U>
T ipow(T b, U n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

// 0-indexed
template <class T, class U>
inline T kthbit(T a, U k) { return (a >> k) & 1; }

template <class T, class U>
inline T mask(T a, U k) { return a & ((1 << k) - 1); }

template <class T>
std::map<T, int> compress(std::vector<T>& v) {
    std::sort(v.begin(), v.end());
    v.erase(std::unique(v.begin(), v.end()), v.end());

    std::map<T, int> rev;
    for (int i = 0; i < v.size(); ++i) rev[v[i]] = i;
    return rev;
}

template <class T>
T Vec(T v) { return v; }

template <class T, class... Ts>
auto Vec(size_t l, Ts... ts) {
    return std::vector<decltype(Vec<T>(ts...))>(l, Vec<T>(ts...));
}


/* ----- constants ----- */

// const int INF = std::numeric_limits<int>::max() / 3;
// const lint INF = std::numeric_limits<lint>::max() / 3;
// const ldouble PI = acos(-1);
// const ldouble EPS = 1e-10;
// std::mt19937 mt(int(std::time(nullptr)));


using namespace std;

int main() {
    int M, D;
    cin >> M >> D;

    int ans = 0;
    for (int m = 1; m <= M; ++m) {
        for (int d = 1; d <= D; ++d) {
            int d1 = d / 10;
            int d2 = d % 10;
            if (d1 >= 2 && d2 >= 2 && d1 * d2 == m) {
                ++ans;
            }
        }
    }

    cout << ans << endl;
    return 0;
}


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

int main()
{
	string str;

	cin >> str;

	int count_one = 0;

	if (str[0] == '1')
	{
		count_one++;
	}
	
	if (str[1] == '1')
	{
		count_one++;
	}

	if (str[2] == '1')
	{
		count_one++;
	}

	cout << count_one << endl;
}


//int main()
//{
//	int a, b;
//
//	cin >> a >> b;
//
//	int c = a * b;
//
//	if (c % 2 == 0)
//	{
//		cout << "Even" << endl;
//	}
//	else
//	{
//		cout << "Odd" << endl;
//	}
//}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int m,f,r;
	scanf("%d%d%d",&m,&f,&r);
	while(m!=-1||f!=-1||r!=-1){
		if(m==-1||f==-1)printf("F\n");
		else if(m+f>=80)printf("A\n");
		else if(m+f>=65)printf("B\n");
		else if(m+f>=50)printf("C\n");
		else if(m+f>=30)if(r>=50)printf("C\n");
			else printf("D\n");
		else printf("F\n");
		scanf("%d%d%d",&m,&f,&r);
	}
	return 0;
}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
const long long  modn = 1e9+7;
map<long long ,long long>dpn;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x << endl;
long long Dpn(long long xn)
{
    if(dpn[xn])return dpn[xn];
    else
    {
        return dpn[xn] = ((Dpn(xn/2)+Dpn((xn-1)/2)+Dpn((xn-2)/2)) )%modn;
    }
}
int main()
{
    dpn[0] = 1;
    dpn[1] = 2;
    long long nn;
    cin>>nn;
    cout<<Dpn(nn);
    return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10000000)

N = int(input())
edges = [[] for i in range(N+1)]
alledges = []
for i in range(N-1):
    a, b = map(int, input().split())
    alledges.append((a, b))
    edges[a].append(b)
    edges[b].append(a)

def dfs(node, parent):
    used = {col[(node, parent)]}
    curcol = 1
    for n in edges[node]:
        if n == parent: continue

        while curcol in used: curcol += 1

        col[(node, n)] = curcol
        col[(n, node)] = curcol

        dfs(n, node)

        used.add(curcol)
        
col = {}
start = max(range(1, N+1), key = lambda x : len(edges[x]))

for i, n in enumerate(edges[start]):
    col[(start, n)] = i + 1
    col[(n, start)] = i + 1
    dfs(n, start)



done = set()
print(len(edges[start]))
for e in alledges:
    print(col[e])


Measured memory_bytes: 129820
#!/usr/bin/env python3
s = input()
t = 0
d = {t:0}
for i in (ord(x)-ord('a') for x in s) :
	t ^= 1 << i
	d[t] = min(d[t] if t in d else 1000000, min((d[t^(1<<j)] for j in range(26) if t^(1<<j) in d))+1)
print(d[t] if d[t] else 1)


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

int main(void){
    int n,m;
	int ans = 0;
    cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> m;
		for(int j = 0; j < 32; j++){
			if((m & 1) == 1) break; 
			ans++;
			m = m >> 1;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 384
// Problem : C - Vacation
// Contest : AtCoder - Educational DP Contest
// URL : https://atcoder.jp/contests/dp/tasks/dp_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include "bits/stdc++.h"
using namespace std;
#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
#define pb push_back
#define nl cout<<"\n"
#define endl "\n"
#define all(c) (c).begin(),(c).end()
#define trav(a,x) for(auto a = x.begin() ; a != x.end() ; a++)
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll>
#define vll vector<ll>
#define f first
#define s second
typedef long long ll;
typedef unsigned long long ull ;
typedef long double ld;

inline ll max(ll a,ll b) {return ((a>b)?a:b);}
inline ll min(ll a,ll b) {return ((a>b)?b:a);}
inline ll gcd(ll a ,ll b) {if(b==0) return a; a%=b;return gcd(b,a);}
ll power(ll x, ll y){if(y == 0) return 1; ll a = power(x,y/2);if (y % 2 == 0) return a * a; else return x * a * a; }
ll powermod(ll x, ll ex , ll md) {ll ans = 1ll;while (ex > 0) {if (ex & 1ll) ans = (ans * x) % md; ex >>= 1ll;x = (x * x) % md;}return ans;}

const ll inf = 1e18 + 9;
const ll mod = 1e9 + 7;
const ld PI = acos(-1);
const ld eps = 1e-9;

const ll N = 1e6 + 1;
ll n ;
ll a[N];
ll b[N];
ll c[N];
ll dp[N][3] ; // 0 - task1 , 1 - task2 , 2 - task3;
void solve(){
	cin >> n;
	rep(i , n) cin >> a[i + 1] >> b[i + 1] >> c[i + 1] ;
	dp[1][0] = a[1];
	dp[1][1] = b[1];
	dp[1][2] = c[1];
 	for(ll i = 2 ; i <= n; i++){
		dp[i][0] = a[i] + max(dp[i - 1][1] , dp[i - 1][2]);
		dp[i][1] = b[i] + max(dp[i - 1][0] , dp[i - 1][2]);
		dp[i][2] = c[i] + max(dp[i - 1][0] , dp[i - 1][1]);
	}
	cout << max({dp[n][0] , dp[n][1] , dp[n][2]});
}
int main(){
    IOS;
    cout << fixed << setprecision(20);
    ll NTC=1;
    // cin>>NTC;
    ll PTC=0;
    while(PTC++<NTC){
        // cout<<"Case #"<<PTC<<":"<<' ';
        solve();
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}


Measured memory_bytes: 10496
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }.groupBy { it }

    var cnt = 0

    aa.entries.forEach {
        if (it.value.size < it.key) {
            cnt += it.value.size
        } else if (it.value.size > it.key) {
            cnt += it.value.size - it.key
        }
    }

    println(cnt)
}


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

using namespace std;

typedef long long LL;

const int mod=1e9+7;

map<LL,LL>mp;

LL n,k;

LL qsm(LL a,LL b) 
{
	LL res=1;
	while(b) {
		if(b&1) res=res*a%mod;
		b>>=1;
		a=a*a%mod;
	}
	return res;
}

int main()
{
	
	cin>>n>>k;
	
	for(int i=k;i>=1;i--) {
		LL res=0;
		res=qsm(k/i,n);
		int bei=2;
		while(bei*i<=k) res-=mp[bei*i],bei++;
		mp[i]=res%mod;
	}
	//cout<<"----"<<mp[1]<<'\n';
	LL sum=0;
	for(LL i=1;i<=k;i++) {
		sum=(sum+(LL)i*mp[i]%mod)%mod;
	}
	cout<<sum%mod<<'\n';
	
	return 0;
}

//12927461


Measured memory_bytes: 9848
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   ff   first
#define   ss   second
#define   pii  pair<int,int>
using namespace std;

bool check_prime(int n){
  for (int i=2;i*i<=n;i++){
      if (!(n%i)) return false;
  } return true;
}

inline void solve(){
    int n; cin>>n; 
    while (true){
        if (check_prime(n)) break;
        n++;
    } cout << n << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 3604
import java.util.Scanner;

public class Main{
    public static void main(String[]args){
        Scanner scn = new Scanner(System.in);
        
        int r = scn.nextInt();
        int c = scn.nextInt();
        int [][]rc = new int[r+1][c+1];
        int sum =0;
        
        for(int i=0;i<r;i++){
            for(int j=0;j<c;j++){
                rc[i][j]=scn.nextInt();
            }
        }
        
        for(int i=0;i<r;i++){
            for(int j=0;j<c;j++){
                rc[i][c]+=rc[i][j];
            }
        }
        

        for(int i=0;i<r;i++){
            for(int j=0;j<c;j++){
                rc[r][j]+=rc[i][j];
                sum+=rc[i][j];
            }
        }
        
        rc[r][c]=sum;

        for(int i=0;i<=r;i++){
            for(int j=0;j<=c;j++){
                if(j==c){
                    System.out.print(rc[i][j]+"\n");
                }else{
                    System.out.print(rc[i][j]+" ");
                }                               
            }
        }        
        
        
        
    }
}

Measured memory_bytes: 39464
#include <bits/stdc++.h>
#define endl '\n'
#define PB push_back
#define PF push_front
#define MP make_pair
#define fi first
#define se second
#define all(v) v.begin(),v.end()
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
 
const int INF = 1e9 + 7;
const ll LINF = 1e18 + 14;

int main(){
    ios_base::sync_with_stdio(false); //cin.tie(nullptr); cout.tie(nullptr);
    ll n, m;
    cin >> n >> m;
    priority_queue<ll> q;
    for (int i = 0; i < n; i++){
        int t;
        cin >> t;
        q.push(t);
    }

    for (int i = 0; i < m; i++){
        ll v = q.top();
        q.pop();
        v /= 2;
        q.push(v);
    }
    ll ans = 0;
    while (!q.empty()){
        ans += q.top();
        q.pop();
    }
    cout << ans;
    return 0;
}  


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    ll sum = 0;
    for(int i = 1; i <= n; i++)
    {
        if((i % 3 == 0) || (i % 5 == 0))
        {

        }
        else
        {
            sum += i;
        }
    }
    cout << sum << "\n";
    return 0;
}


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

const long long int MOD = 1e9 + 7;
long long int mypow(long long int x,long long int n)
{
	long long int res = 1;
	while(n>0)
	{
		if(n%2==1)
		{
			res = ((res%MOD)*(x%MOD)%MOD);
			res%=MOD;
		}
		x = ((x%MOD)*(x%MOD)%MOD)%MOD;
		x%=MOD;
		n/=2;
	}
	return res;
}
long long int f[2000001];

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

	long long int res = 0;
	long long int n,m;

	cin >> n >> m;

	f[0] = 1;

	for(long long int i=1;i<=2000000;i++)
	{
		f[i] = ((f[i-1]%MOD)*(i%MOD)%MOD)%MOD;
		f[i]%=MOD;
	}

	/*
	long long int val = f[m];
	val = ((val%MOD) * (mypow(f[m-n],MOD-2)%MOD)%MOD);
	val%=MOD;
	res = ((val%MOD)*(val%MOD)%MOD)%MOD;
	res%=MOD;
	*/
	for(long long int a=0;a<=n;a++)
	{
		long long int val = f[n];
		val = ((val%MOD)*(mypow(f[n-a],MOD-2)%MOD)%MOD);
		val%=MOD;
		val = ((val%MOD)*(mypow(f[a],MOD-2)%MOD)%MOD);
		val%=MOD;
		val = ((val%MOD)*(mypow(f[m-a],MOD-2)%MOD)%MOD);
		val%=MOD;
		val = ((val%MOD)*(f[m]%MOD)%MOD)%MOD;
		val%=MOD;
		long long int val2 = 1;
		val2 = ((val2%MOD)*(f[m-a]%MOD)%MOD)%MOD;
		val2%=MOD;
		val2 = ((val2%MOD)*(mypow(f[m-n],MOD-2)%MOD)%MOD);
		val2%=MOD;	
		val2 = ((val2%MOD)*(val2%MOD)%MOD)%MOD;
		val2%=MOD;
		val = ((val%MOD)*(val2%MOD)%MOD);
		val%=MOD;
		//cout << a << ' ' << val << ' '<< val2 << '\n';
		if(a%2==1)
		{
			res = ((res%MOD) - (val%MOD)%MOD)%MOD;
			res%=MOD;
			if(res<0)
			{
				res += MOD;
			}
		}	
		else
		{
			res = ((res%MOD) + (val%MOD)%MOD)%MOD;
			res%=MOD;
		}						
	}

	cout << res << '\n';

	return 0;
}

Measured memory_bytes: 19260
#include <iostream>

int main()
{
  char x;
  std::cin >> x;

  if (x - 'a' >= 0 && x - 'a' < 26) {
    std::cout << 'a' << std::endl;
  } else {
    std::cout << 'A' << std::endl;
  }

  return 0;
}


Measured memory_bytes: 3640
import java.io.*;
import java.lang.*;
import java.util.*;
class Graph{ 
    private int V;   // No. of vertices 
    private ArrayList<Integer> adj[]; // Array  of lists for Adjacency List Representation  
    public Graph(int v, int X, int Y){ 
        V = v; 
        adj = new  ArrayList[v]; 
        for (int i=0; i<v; ++i) adj[i] = new ArrayList<Integer>(); 
        for(int i=0;i<v-1;i++){
            adj[i].add(i+1);
            adj[i+1].add(i);
        }
        adj[X-1].add(Y-1);
        adj[Y-1].add(X-1);
    }  
    public int[] BFS(int s){ 
        // Mark all the vertices as not visited
        boolean visited[] = new boolean[V]; 
        int[] dist=new int[V];
        // Create a queue for BFS 
        LinkedList<Integer> queue = new LinkedList<Integer>(); 
        // Mark the current node as visited and enqueue it 
        visited[s]=true; 
        dist[s]=0;
        queue.add(s); 
        while (queue.size() != 0){ 
            s = queue.poll(); 
            Iterator<Integer> i = adj[s].listIterator(); 
            while (i.hasNext()){ 
                int n = i.next(); 
                if (!visited[n]){ 
                    visited[n] = true; 
                    dist[n]=dist[s]+1;
                    queue.add(n); 
                } 
            } 
        }
        return dist;
    } 
}
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] s=br.readLine().split(" ");
        int N=Integer.parseInt(s[0]);
        int X=Integer.parseInt(s[1]);
        int Y=Integer.parseInt(s[2]);
        Graph g=new Graph(N,X,Y);
        int[] f=new int[N];
        for(int i=0;i<N;i++){
            int[] dist=g.BFS(i);
            for(int j=0;j<N;j++) f[dist[j]]++;
        }
        for(int i=1;i<N;i++) System.out.println(f[i]/2);
    }
}

Measured memory_bytes: 91372
n = gets.to_i
a = gets.split.map(&:to_i)

sum = 0

1.upto(a.size-1) do |i|
  if a[i] < a[i-1]
    diff = a[i-1] - a[i]
    sum += diff
    a[i] += diff
  end
end

puts sum

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

int main() {
    string S;
    cin >> S;
    ll N = S.size();
    ll lindex = 0;
    ll rindex = N-1;
    ll ans =0;
    while(lindex<rindex){
        if(S[lindex] != S[rindex]){
            if(S[lindex] == 'x'){
                ans++;
                lindex++;
                continue;
            }
            if(S[rindex] =='x'){
                ans++;
                rindex--;
                continue;
            }
            cout << -1 << endl;
            return 0;

        }else{
            lindex++;
            rindex--;
        }

    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3736
<?php
    $get = trim(fgets(STDIN));
    // $get = "44 44";
    $vars = explode(" ",$get);
    
    $a = $vars[0];
    $b = $vars[1];
    
    switch (true) {
        case $a < $b:
            $return = "a < b";
            break;
        case $a > $b:
            $return = "a > b";
            break;
        case $a == $b:
            $return = "a == b";
            break;
        default:
           $return = "crazy";
            break;
    }
    print($return);
?>

Measured memory_bytes: 15276
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i, n) {
        cin >> a[i];
    }
    sort(a, a+n);

    int c = 0;
    int t = 0;
    rep(i, n) {
        if(t < a[i]) {
            c++;
            t = a[i];
        }
    }

    int ans;

    if(c%2 == 0) {
        ans = c-1;
    }
    else {
        ans = c;
    }

    cout << ans;
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;

int main()
{
    vector<ll>vec;
    ll a;
    ll n;
    ll ans = 1;

    cin >> n;
    while(n--) {
        cin >> a;
        vec.push_back(a);
    }

    sort(vec.begin(), vec.end());

    for (int i = 0; i < vec.size() - 1; i++) {
        if (vec[i] != vec[i + 1]) {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 888
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
n=N()
edge=[[] for i in range(n+1)]
for i in range(n-1):
    a,b=map(int,input().split())
    edge[a].append(b)
    edge[b].append(a)
INF=float("inf")
ma=[INF]*(n+1)
mi=[-INF]*(n+1)
k=N()
vp=LL(k)
for v,p in vp:
    ma[v]=p
    mi[v]=p

import sys
sys.setrecursionlimit(10**6)
def dfs(v,d,hi,lo):
    dep[v]=d
    ma[v]=min(ma[v],hi)
    mi[v]=max(mi[v],lo)
    hi=ma[v]
    lo=mi[v]
    for i in edge[v]:
        if dep[i]==-1:
            hi,lo=dfs(i,d+1,hi+1,lo-1)
            ma[v]=min(ma[v],hi)
            mi[v]=max(mi[v],lo)
            hi=ma[v]
            lo=mi[v]
    return hi+1,lo-1
for i in range(2):
    dep=[-1 for i in range(n+1)]
    dfs(v,0,p,p)
for i,j in zip(mi,ma):
    if i>j or (i-j)%2==1:
        print("No")
        break
else:
    print("Yes")
    for i in mi[1:]:
        print(i)

Measured memory_bytes: 132984
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int [] x = new int [n];
        int ans = 0;
        for(int i = 0; i < n; i++){
            x[i] = sc.nextInt();
            ans += 2*Math.min( Math.abs(0-x[i]), Math.abs(k-x[i]) );
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 21716
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
typedef long long ll;

using namespace std;
char a[100010];
char b[100010];
int main()
{
    cin >> (a+1);
    int len = strlen(a+1);
    bool ok = false;
    int ji = 0;
    int cha = 0;
    for(int i = 1; i <= len; i++)
    {
        if(a[i] != 'x')b[ji++] = a[i];
    }
    for(int i = 0; i < ji; i++)
    {
        if(b[i] != b[ji-i-1])ok = true;
    }
    int ij = 0;
    int biao;
    for(int i = 0; i <= len; i++)
    {
        if(a[i] != 'x')ij++;
        if(ij == len/2)biao = ij;
    }
    int you = 1;
    if(!ok)
    for(int i = 1;;)
    {
        if(a[i] == a[len-you+1]){i++;you++;}
        if(a[i] != a[len-you+1] && a[i] == 'x'){i++;cha++;}
        if(a[i] != a[len-you+1] && a[len-you+1] == 'x'){you++;cha++;}
        if(i >= len-you+1)break;
    }
    if(!ok)cout << cha << endl;
    else cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 384
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 c = sc.nextInt();
		if(a+b+c>=22) System.out.println("bust");
		else System.out.println("win");
	}
}

Measured memory_bytes: 21972
#include<iostream>
#include<string>
using namespace std;
int n,m;
int sum[100001];
char b[100001];
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>b[i];
        sum[i]=sum[i-1];
        if(b[i]=='C'&&b[i-1]=='A')sum[i]++;
    }
    while(m--)
    {
        int l,r;
        cin>>l>>r;
        int ans=sum[r]-sum[l-1];
        if(b[l]=='C'&&b[l-1]=='A')ans--;
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 1280
import java.util.Scanner;

public class Main {

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

    int N = sc.nextInt();
    String s = sc.next();

    if (s.substring(0, N/2).equals(s.substring(N/2, N))) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }    
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

ll n, m;
vector<int> e[100000];
vector<ll> l[100000], r[100000];
int par[100000];
ll dp[100000];

void dfs(int v) {
    rep(i,e[v].size()) {
        if (e[v][i] == par[v]) continue;
        par[e[v][i]] = v;
        dfs(e[v][i]);
    }
}

void dfp(int v) {
    rep(i,e[v].size()) {
        if (e[v][i] == par[v]) continue;
        dfp(e[v][i]);
    }
    ll add = 1;
    rep(i,e[v].size()) {
        if (e[v][i] == par[v]) continue;
        add = add * dp[e[v][i]] % m;
    }
    dp[v] = (1 + add) % m;
    rep(i,e[v].size()) {
        if (i != 0) {
            l[v][i] = l[v][i-1];
        }
        if (e[v][i] == par[v]) continue;
        l[v][i] = l[v][i] * dp[e[v][i]] % m;
    }
    for (int i = (int)e[v].size()-1; i >= 0; i--) {
        if (i != (int)e[v].size()-1) {
            r[v][i] = r[v][i+1];
        }
        if (e[v][i] == par[v]) continue;
        r[v][i] = r[v][i] * dp[e[v][i]] % m;
    }
}

void dfr(int v, ll pre) {
    dp[v] = (dp[v] - 1 + m) % m;
    dp[v] = dp[v] * pre % m;

    rep(i,e[v].size()) {
        if (e[v][i] == par[v]) continue;
        ll nxt = 1;
        if (i != 0) nxt = nxt * l[v][i-1] % m;
        if (i != e[v].size()-1) nxt = nxt * r[v][i+1] % m;
        nxt = nxt * pre % m;
        nxt = (nxt + 1) % m;
        dfr(e[v][i], nxt);
    }
}

int main() {
    cin >> n >> m;
    rep(i,n-1) {
        int a, b;
        cin >> a >> b; a--; b--;
        e[a].push_back(b);
        r[a].push_back(1);
        l[a].push_back(1);
        e[b].push_back(a);
        l[b].push_back(1);
        r[b].push_back(1);
    }
    dfs(0);
    dfp(0);
    dfr(0, 1);
    rep(i,n) cout << dp[i] << endl;
}



Measured memory_bytes: 24576
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
        int a,b,c,x,y;
        cin >> a>> b>>c>> x >>y;
        int p=max(x,y);int ans=1000000000;
        for(int i=0; i<=2*p; i+=2) {
          if((x-(i/2))>=0&&(y-(i/2))>=0){
            ans=min(ans,i*c+(x-(i/2))*a+(y-(i/2))*b);
          }
          else if((x-(i/2))<0&&(y-(i/2))>=0){
             ans=min(ans,i*c+(y-(i/2))*b);
          }
          else if((x-(i/2))>=0&&(y-(i/2))<0){
            ans=min(ans,i*c+(x-(i/2))*a);
          }
          else{
            ans=min(ans,i*c);
          }
        }
        cout <<ans <<endl;
}


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

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<string> blue(n);
    for (int i = 0; i < n ; i++){
        cin >> blue[i];
    }
    int m;
    cin >> m;
    vector<string> red(m);
    for (int i = 0; i < m; i++){
        cin >> red[i];
    }

    int ans = 0;
    auto calc = [&](string s){
        int buf = 0;
        for (string t: blue){
            if (t==s) buf++;
        }
        for (string t: red){
         if (t==s) buf--;
        }
        return buf;
    };

    for (string t: blue){
        ans = max(ans, calc(t));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
 long long int a,flag,tmp_count;
 flag=0;
 tmp_count=1;
 long long int tmp_max=1;
 vector<string> v;
 vector<string> ans;
 cin>>a;
 for(int i=0;i<a;i++){
 	string tmp;
 	cin>>tmp;
 	v.push_back(tmp);
 }
sort(v.begin(),v.end());
v.push_back("ZZZZ");
for(int i=0;i<a;i++){
  if(v[i]==v[i+1]){
  	tmp_count++;
  	if(tmp_count>=tmp_max){
  	  tmp_max=tmp_count;
  	}
  }else{
  	tmp_count=1;
  }
}
tmp_count=1;
for(int i=0;i<a;i++){
  if(v[i]==v[i+1]){
  	tmp_count++;
  }else{
  	tmp_count=1;
  }
if(tmp_max==tmp_count){
    ans.push_back(v[i]);
  	tmp_count=1;
 } 
}
for(int i=0;i<ans.size();i++){
	cout<<ans[i]<<endl;
}

}


Measured memory_bytes: 15984
#include<bits/stdc++.h>
	using namespace std;
	typedef long long ll;
	#define PI 3.14159265358979
	#define EPS 1e-8
	#define mod  1000000007
	#define fi first
	#define se second
	#define mp make_pair
	#define pb push_back
 
	const ll INF=1e18;	
	const int N=1e5+50;
 
	ll dp[405][405];
	vector<ll> pref,v;
	
	ll solve(ll i,ll j)
	{
		if(i>j)
			return 0;
		if(i==j)
		{
			return 0;
		}
		
		if(dp[i][j]!=-1)
		{
			return dp[i][j];
		}
		ll ans=INF;
		ll val=pref[j];
		if(i>0)
		{
			val-=pref[i-1];
		}
		
		for(ll k=i;k<j;k++)
		{
			ans=min(ans,solve(i,k)+solve(k+1,j)+val);
		}
		//cout<<i<<" "<<j<<" "<<ans<<endl;
		return dp[i][j]=ans;
	}
	
	int main()
	{
		ios_base::sync_with_stdio(false);
		cin.tie(NULL);cout.tie(0);
		
		ll n;
		cin>>n;
		v= vector<ll> (n);
		pref=vector<ll>(n);
		for(ll i=0;i<n;i++)
		{
			cin>>v[i];
			pref[i]=v[i];
			if(i)
			{
				pref[i]+=pref[i-1];
			}
		}
		
		for(ll i=0;i<=n;i++)
		{
			for(ll j=0;j<=n;j++)
			{
				dp[i][j]=-1;
			}
		}
		
		cout<<solve(0,n-1);
		
	}


Measured memory_bytes: 4888
#include "bits/stdc++.h"
using namespace std;

const int N=2e5+20;

int n,a[N],x;

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		x^=a[i];
	}

	for(int i=0;i<n;i++) printf("%d ",x^a[i]);
}

Measured memory_bytes: 4532
#include <stdio.h>
int main(void){
    // Your code here!
    
    int a, b, c;
    scanf("%d%d%d",&a,&b,&c);
    if(a >= b && a >= c){
        printf("%d", b + c);
    }
    else if(b >= a && b >= c){
        printf("%d", a + c);
    }
    else if(c >= a && c >= b){
        printf("%d", a + b);
    }
}


Measured memory_bytes: 128
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int n[3];
char c[3]={'+','-','*'};

int fun(int a,int b){
	
	n[0]=a+b;
	n[1]=a-b;
	n[2]=a*b;
	int maxn=n[0];
	int i,ans=0;
	for(i=0;i<3;i++){
		if(n[i]>maxn){
		maxn=n[i];
		
		}
	}
	return maxn;
}
int main()
{
	int a,b;
	cin>>a>>b;
	int ans=fun(a,b);
	cout<<ans;

 return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Pair = pair<int, int>;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define INF 1000000007
#define SEP " "

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


Measured memory_bytes: 3600
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#define int long long
#define mod 1000000007
using namespace std;

int dp[200][64];
signed main() {
	int n; cin >> n;
	dp[0][63] = 1;
	for (int i = 0; i < n + 5; i++) {
		for (int j = 0; j < 64; j++) {
			int x = 0, y = 0, z = 0, w = j;
			x = w % 4; w /= 4; y = w % 4; w /= 4; z = w % 4;
			if (j == 36 || j == 24 || j == 33) { 
				dp[i][j] = 0; continue; }
			for (int k = 0; k < 4; k++) {
				dp[i + 1][k * 16 + z * 4 + y] += dp[i][j];
				if (x == 0 && y == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				else if (x == 0 && z == 1 && k == 2) {
					dp[i + 1][k * 16 + z * 4 + y] -= dp[i][j];
				}
				dp[i + 1][k * 16 + z * 4 + y] %= mod;
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < 64; i++) {
		ans += dp[n][i];
	}
	cout << ans%mod << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>    
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//using namespace __gnu_pbds; 
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb  push_back
#define show(x) cout<<(#x)<<" : "<<x<<endl;
typedef long long ll; 
#define fill(a,val) memset(a,val,sizeof(a))
#define mp  make_pair
#define ff  first
#define ss  second
#define pii pair<ll,ll>
#define sq(x) ((x)*(x))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define int long long 
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
const ll MOD     = 1000*1000*1000+7;
const ll INF     = 1ll*1000*1000*1000*1000*1000*1000 + 7;
const ll MOD2    = 998244353;
const ll N       = 1000 * 100 + 10;
const ll N2      = 70;
//const ld PI  = 3.141592653589793;
//template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);} 
ll power(ll x,ll y,ll p = LLONG_MAX ){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
ll lcm(ll a , ll b){return (a*b)/gcd(a,b);}
void solve(){
  #ifndef ONLINE_JUDGE    
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif
}
signed main()
{
    fastio();
    //cout<<fixed<<setprecision(20);
    //CHECK for LONG LONG and LONG DOUBLE
    //*comment for all except cc/cf   
    ll x; 
    cin>>x; 
    ll n=-118,res,res2;
    while(n<120){
      bool ok=1;
      ll m=-119;
      while(m<119){
      ll ans=(ll)pow(n,5)-(ll)pow(m,5);
      if(ans==x){
        ok=0;
        res=n;
        res2=m;
        break; 
      }
      m++;
      }
      if(ok==0){
        break; 
      }
      n++;
    }
    cout<<res<<" "<<res2<<endl; 
    return 0;
}
    

Measured memory_bytes: 4028