akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;

namespace E___Sequence_Decomposing
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var colors = new List<int>();
            colors.Add(-1);

            for (int i = 0; i < N; i++)
            {
                var Ai = int.Parse(Console.ReadLine());
                var updateIndex = colors[colors.Count - 1] != Ai ? binarySearch(colors, Ai) : -1;
                if (updateIndex >= 0)
                {
                    colors[updateIndex] = Ai;
                }
                else
                {
                    colors.Add(Ai);
                }
            }
            Console.WriteLine(colors.Count);
        }
        static int binarySearch(List<int> list, int number)
        {
            var left = -1;
            var right = list.Count;
            while (right - left > 1)
            {
                int mid = (left + right) / 2;
                if (list[mid] < number)
                {
                    right = mid;
                }
                else
                {
                    left = mid;
                }
            }
            if (right > list.Count - 1) return -1;

            return right;
        }
    }
}


Measured memory_bytes: 17340
#include<iostream>
#include<algorithm>
using namespace std; 
int main(){
	int n;
	cin>>n;
	int x=1;
	int a[500000]={0};
	a[n]=1;
	while(a[n]!=2){
		x++; 
		if(n%2==0)
		{n=n/2;
		a[n]++;}
		else
		{n=n*3+1; 
		a[n]++;}
		//cout<<n;
	} 
	cout<<x;
}

Measured memory_bytes: 2176
#include<iostream>
#include<sstream>
#include<cstdio>
#include<fstream>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
using namespace std;
#define N 1000002
bool is_prime(int n){
	if(n<=1)return false;
	if(n==2)return true;
	if(!(n&1))return false;
	for(int x=3;x<=sqrt(n);x+=2) if(!(n%x))return false;
	return true;
}

int main(){
	int n;
	int primes[N];
	primes[0] = primes[1] = 0;
	int cnt = 1;
	primes[2] = cnt;
	for(int x=3;x<=N;++x){
		if(is_prime(x)){
			++cnt;
		}
		primes[x] = cnt;
	}
	while(scanf("%d",&n)==1){
		cout<<primes[n]<<endl;
	}
	return 0;
}

Measured memory_bytes: 5112
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template < typename T > using oset = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
// find_by_order(k) (k+1)th largest element
// order_of_key(k) no of elements <=k

typedef long long ll;
typedef long double ld;
#define endl '\n'
#define rep(i,n)  for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define ff first
#define ss second
#define pb push_back
typedef vector<ll> vll;
typedef vector<pair<ll,ll>> vpl;
const ld PI = 4*atan((ld)1);
const ll INF = LLONG_MAX;
const ll mod = 1e9+7;

// const ll N = 5000;
map<ll,ll> mp;
void Pf(ll a){
    ll f=0;
    while(a%2==0){
        a/=2;
        if(!f){
            mp[2]++;
            f=1;
        }
    }
    f=0;
    // cout << a << endl;
    for(ll i=3;i<=sqrt(a);i+=2){
        f=0;
        while(a%i==0){
            if(!f){
                mp[i]++;
                f=1;
            }
            a/=i;
        }
    }
    f=0;
    if(a>2){
         if(!f)mp[a]++;
    }
}
int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll tt=1;
        // cin >> tt;
    repA(qq,1,tt){
        ll n;cin >> n;
        vll a(n);
        ll g;
        rep(i,n){
            cin >> a[i];
            // if()
            Pf(a[i]);
        }
        ll f=0;
        trav(p,mp){
            if(p.ss>=2){
                f=1; break;
            }
        }

        if(f){
            ll ans =1;
            trav(p,mp){
                if(p.ss==n)ans *=p.ff;
            }
            if(ans==1){
                cout << "setwise coprime" << endl;
            }else{
                cout << "not coprime" << endl;
            }
        }else{
            cout << "pairwise coprime" << endl;
        }
    }
}


Measured memory_bytes: 15828
#pragma GCC optimize("Ofast", "unroll-loops")

#pragma GCC target("popcnt,abm,mmx,tune=native")

#include <bits/stdc++.h>

#define ll int64_t

#define fi first

#define se second

#define pb push_back

#define sqr(x) (ll)(x)*(x)

#define inf LLONG_MAX

#define mod 1000000007

using namespace std;

ll n, k, m, i, x;

main()
{
    [=]()
    {
        ios_base :: sync_with_stdio(false);

        cin.tie(nullptr);
    }();

    cin >> n >> k >> m;

    vector < ll > a(n);

    for (; i<m; i++)
    {
        cin >> x;

        a[--x]++;
    }

    for (auto &i:a) puts(k-m+i>0 ? "Yes" : "No");
}


Measured memory_bytes: 1408
#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let v: Vec<usize> = get!(String).chars().map(|x| x as usize - 48).collect();
    //eprintln!("{:?}", v);
    if v.len() == 1 {
        println!("0");
        return;
    }
    let mut red = 0;
    let mut blue = 0;
    for i in v.iter() {
        if *i == 0 {
            red += 1;
        } else {
            blue += 1;
        }
    }
    //eprintln!("red: {}, blue: {}", red, blue);
    println!("{}", 2 * std::cmp::min(red, blue));
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
int main(){
    int n;
    cin>>n;
    if(n%2==0){
        cout<<n/2<<endl;
    }
    else{
        cout<<n/2+1<<endl;
    }
}

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

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;
}

#define FOR(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
#define allg(a) (a).begin(), (a).end(), greater<int>()
#define MAX(a) *max_element(all(a))

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vc = vector<char>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vvi;

const int INF = 1001001001;
const int MOD = 1000000007;
const long long INFL = (1LL << 60);
const double EPS = 1e-9;

vector<bool> isSafe;
vll dp;

int main() {
  int N, M;
  cin >> N >> M;
  isSafe.assign(N + 1, true);
  rep(i, M) {
    int a;
    cin >> a;
    isSafe[a] = false;
  }

  dp.assign(N + 1, 0);
  dp[0] = 1;
  if (isSafe[1]) dp[1] = 1;
  FOR(n, 2, N + 1) {
    if (isSafe[n - 1]) dp[n] += dp[n - 1];
    if (isSafe[n - 2]) dp[n] += dp[n - 2];
    dp[n] %= MOD;
  }

  cout << dp[N] << endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
int N,i,j,k,l,P[1005];
char S[1000][1060];

int main()
{
	for(;scanf("%d\n",&N),N;)
	{
		for(i=0;i<N;i++)gets(S[i]);
		for(i=0;i<N;i++)
		{
			for(j=0;S[i][j]=='.';j++);
			P[i]=j;
		}
		for(i=0;i<N;i++)
		{
			for(j=0,l=strlen(S[i]);j<l;j++)
			{
				if('a'<=S[i][j]&&S[i][j]<='z')break;
				else if('a'<=S[i][j+1]&&S[i][j+1]<='z')
				{
					S[i][j]='+';
					for(k=i+1;k<N&&P[k]>P[i];k++);
					if(k!=N&&P[k]==P[i])
						for(k=k-1;k>i;k--)
							S[k][j]='|';
				}
				else if(S[i][j]=='.')
					S[i][j]=' ';
			}
			puts(S[i]);
		}
	}
	return 0;
}

Measured memory_bytes: 1628
#include<bits/stdc++.h>
using namespace std;
#define Maxn 100010

int n, a, b, c;
char Opt[Maxn][2], Res[Maxn];

int main()
{
	scanf("%d%d%d%d", &n, &a, &b, &c);
	if (a + b + c == 0) { puts("No"); return 0; }
	for (int i=1; i<=n; i++) scanf("%s", Opt[i]);
	for (int i=1; i<=n; i++)
	{
		if ((Opt[i][0] == 'A') && (Opt[i][1] == 'B'))
		{
			if (a + b == 0) { puts("No"); return 0; }
			if (a == 0)
			{
				Res[i] = 'A'; a++; b--;
				continue;
			}
			if (b == 0)
			{
				Res[i] = 'B'; a--; b++;
				continue;
			}
			if ((a + b + c == 2) && (a == 1) && (b == 1))
			{
				if (i == n)
				{
					Res[i] = 'A'; a++; b--;
					continue;
				}
				if (Opt[i + 1][1] == 'B') // AB
				{
					Res[i] = 'A'; a++; b--;
					continue;
				}
				else
					if (Opt[i + 1][1] == 'C')
					{
						if (Opt[i+1][0] == 'A') // AC
						{
							Res[i] = 'A'; a++; b--;
							continue;
						}
						else
						{
							Res[i] = 'B'; a--; b++;
							continue;
						}
					}
			}
			if (a > b)
			{
				Res[i] = 'B'; a--; b++;
				continue;
			}
			else
			{
				Res[i] = 'A'; a++; b--;
				continue;
			}
		}
		if ((Opt[i][0] == 'A') && (Opt[i][1] == 'C'))
		{
			if (a + c == 0) { puts("No"); return 0; }
			if (a == 0)
			{
				Res[i] = 'A'; a++; c--;
				continue;
			}
			if (c == 0)
			{
				Res[i] = 'C'; a--; c++;
				continue;
			}
			if ((a + b + c == 2) && (a == 1) && (c == 1))
			{
				if (i == n)
				{
					Res[i] = 'A'; a++; c--;
					continue;
				}
				if (Opt[i + 1][1] == 'B') // AB
				{
					Res[i] = 'A'; a++; c--;
					continue;
				}
				else
					if (Opt[i + 1][1] == 'C')
					{
						if (Opt[i+1][0] == 'A') // AC
						{
							Res[i] = 'A'; a++; c--;
							continue;
						}
						else
						{
							Res[i] = 'C'; a--; c++;
							continue;
						}
					}
			}
			if (a > c)
			{
				Res[i] = 'C'; a--; c++;
				continue;
			}
			else
			{
				Res[i] = 'A'; a++; c--;
				continue;
			}
		}
		if ((Opt[i][0] == 'B') && (Opt[i][1] == 'C'))
		{
			if (b + c == 0) { puts("No"); return 0; }
			if (b == 0)
			{
				Res[i] = 'B'; b++; c--;
				continue;
			}
			if (c == 0)
			{
				Res[i] = 'C'; b--; c++;
				continue;
			}
			if ((a + b + c == 2) && (b == 1) && (c == 1))
			{
				if (i == n)
				{
					Res[i] = 'B'; b++; c--;
					continue;
				}
				if (Opt[i + 1][1] == 'B') // AB
				{
					Res[i] = 'B'; b++; c--;
					continue;
				}
				else
					if (Opt[i + 1][1] == 'C')
					{
						if (Opt[i+1][0] == 'A') // AC
						{
							Res[i] = 'C'; b--; c++;
							continue;
						}
						else
						{
							Res[i] = 'B'; b++; c--;
							continue;
						}
					}
			}
			if (b > c)
			{
				Res[i] = 'C'; b--; c++;
				continue;
			}
			else
			{
				Res[i] = 'B'; b++; c--;
				continue;
			}
		}
	}
	puts("Yes");
	for (int i=1; i<=n; i++) printf("%c\n", Res[i]);
}

Measured memory_bytes: 4048
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;

int main(){
  int a,b;
  cin>>a>>b;
  if(a<=8 && b<=8)cout<<"Yay!"<<endl;
  else cout<<":("<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
struct pair_hash {
    template <class T1, class T2>
    size_t operator () (const pair<T1,T2> &p) const {
        auto h1 = hash<T1>{}(p.first);
        auto h2 = hash<T2>{}(p.second);
        return h1 ^ h2;  
    }
};
using Vote = pair<ll,ll>;
using Unordered_map = unordered_map<Vote, int, pair_hash>;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define showvec(arr,a,b) for(ll i=a;i<b;i++) cout<<arr[i]<<" ";
#define read_input(arr,a,b) for(ll i=a;i<b;i++) cin>>arr[i];
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define SmooothOperatorrrrr()                 \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                    \
    cout.tie(0);                   
#define deci(n) cout<<fixed<<setprecision(n)
const int mod=998244353;
const int mod2=1000000007;
#define M_PI 3.14159265358979323846
#define LL_MAX 9223372036854775807
#define MAXN 2000001
/**************************************************************************************************/
int main()
{
    SmooothOperatorrrrr();
    int d,t,s;cin>>d>>t>>s;
    double time=(double)d/s;
    if(time<=t)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}

Measured memory_bytes: 3556
<?php
$o='';
while(1){
  list($a,$b)=explode(' ',trim(fgets(STDIN)));
  if($a!='0'||$b!='0'){$o.=($a<$b)? "{$a} {$b}\n":"{$b} {$a}\n";}
  else{break;}
}
print $o;

Measured memory_bytes: 15120
N,x=map(int,input().split())
a=list(map(int,input().split()))
a_sort=sorted(a)
#print(a_sort)
ans=0
b=True
for i in range(N):
  if x-a_sort[i]>=0:
    x-=a_sort[i]
    ans+=1
  else:
    b=False
    break

if b and x>0:
  ans-=1
print(ans)

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

int main(){
  int n ;
  cin >> n ;
  vector<int> a(n) ;
  for(int i = 0 ;  i < n ; i++ ){
    cin >> a.at(i) ;
  }
  sort(a.begin() , a.end() ) ;
  cout << a.at(n-1) - a.at(0) << endl ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    ll a,b;
    vector<vector<ll> > v(n);
    for(int i=0;i<m;i++){
        cin>>a>>b;
        v[a-1].pb(b-1);
    }
    ll s,t;
    cin>>s>>t;
    s--;
    t--;
    queue<pair<ll,ll> > q;
    q.push(make_pair(s,1));
    bool maki[n]={false};
    ll num,niko;
    ll umi,hono,koto,nozo,eri,hana;
    while(!q.empty()){
        niko=q.front().first;
        num=q.front().second;
        q.pop();
        umi=v[niko].size();

        for(int i=0;i<umi;i++){
            eri=v[niko][i];
            hono=v[eri].size();
            for(int j=0;j<hono;j++){
                hana=v[eri][j];
                koto=v[hana].size();
                for(int k=0;k<koto;k++){
                    nozo=v[hana][k];
                    if(nozo==t){
                        cout << num<<endl;
                        return 0;

                    }
                    else if(maki[nozo]==false){
                        maki[nozo]=true;
                        q.push(make_pair(nozo,num+1));
                    }
                }
            }

        }
    }
    cout << -1<<endl;
    return 0;
}




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

string s;
string x[] = {"SUN", "MON", "TUE", "WED",
              "THU", "FRI", "SAT"};

int main() {
  cin >> s;
  int num = 0;
  for(int i = 0; i < 7; ++i)
    if(s == x[i]) num = i;
  cout << 7 - num << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const double PI=3.14159265358979323846;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

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

void dump(const vector<int> &v)
{
	REP(i, SZ(v)-1){ cout << v[i] << " "; }
	cout << v[SZ(v)-1] << endl;
}

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

	vector<int> V(4 * 3 * 10);

	fill(ALL(V), 0);

	REP(i, N){
		int b, f, r, v;
		cin >> b >> f >> r >> v;

		V[(b-1) * 30 + (f-1) * 10 + (r-1)] += v;
	}

	REP(k, 4){
		REP(j, 3){
			REP(i, 10){
				cout << " " << V[k * 30 + j * 10 + i];
			}
			cout << endl;
		}
		if(k < 4-1)
			cout << "####################" << endl;
	}

	return 0;
}




Measured memory_bytes: 3084
import sys

n,m=map(int,input().split())
ans=[0]*n

for i in range(m):
  s,c=map(int,input().split())
  s-=1
  if ans[s]!=0 and ans[s]!=c:
    print(-1)
    sys.exit()
    
  else:
    ans[s]=c
    
if n==3 and m==1 and ans==[0,0,0]:
  print(-1)
  sys.exit()
    
if n!=1 and ans[0]==0:
  ans[0]=1
    
for i in range(n):
  ans[i]=str(ans[i])
  
print("".join(ans))

Measured memory_bytes: 9096
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let D: usize = sc.get();
    let c: Vec<i64> = sc.vec(26);
    let s: Vec<Vec<i64>> = sc.mat(D, 26);
    let mut last = vec![0; 26];
    let mut ans = Vec::new();
    for d in 0..D {
        let mut max_score_d = 0;
        let mut max_t = 0;
        let mut score_d = 0;
        for t in 0..26 {
            score_d += s[d][t];
            last[t] = d as i64 + 1;
            for i in 0..26 {
                score_d -= c[i] * (d as i64 + 1 - last[i]);
            }
            if max_score_d < score_d {
                max_score_d = score_d;
                max_t = t;
            }
        }
        ans.push(max_t);
    }
    for d in 0..D {
        println!("{}", ans[d] + 1);
    }
}


Measured memory_bytes: 2228
#include <bits/stdc++.h>
#define ll long long int

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, m;
    cin >> n >> m;
    if (n == m)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;

}


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

int main() {
	vector<int> v(3);
	cin >> v[0] >> v[1] >> v[2];
	sort(v.begin(), v.end(), greater<int>());
	
	int res = v[0] * 10 + v[1] + v[2];
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    int N, D;
    cin >> N >> D;
    const int C = D * 2 + 1;
    cout << (N + C - 1) / C << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
using ll = long long;

int main(){
    ll a,b,ans=0,a1,b1;
    cin>>a>>b;
    if ((b-a)/2%2==0&&a%2==1) {
      ans++;
    }
    if (b-a-1>=0&&(b-a-1)/2%2==0&&a%2==0) {
      ans++;
    }
    
    for (ll i=2; b>0; i*=2) {
        a1=i/2;
        a-=a1;
        b-=a1;
        b1=0;
        if (a>0) {
        
        
        if (a%(i*2)<=i) {
            if (a%2==0&&a%(i*2)!=0) {
                b1++;
            }
        }
        }
        if (b%(i*2)<=i) {
            if (b%2==1) {
                b1++;
            }
        }
        if (b1%2==1) {
            ans+=i;
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
A = LIST()

que = deque([])
for i, a in enumerate(A):
    j = i + 1
    # 偶奇同じ
    if (n - j) % 2 == 0:
        que.appendleft(a)
    else:
        que.append(a)
print(*que)



    


Measured memory_bytes: 27204
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

x1,y1,x2,y2 = li()

vx = x2-x1
vy = y2-y1

x3,y3 = x2-vy, y2+vx
x4,y4 = x3-vx, y3-vy

print(x3,y3,x4,y4)

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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
typedef pair<int, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 1001001001;
#define mins(x, y) x = min(x, y)
#define maxs(x, y) x = max(x, y)


int main() {
    int a, b;
    cin >> a >> b;

    int ans = (3 * a + b) / 2;

    cout << ans << endl;
}



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

char board[60][60];
bool used[60][60][4];
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
string pat = "^>v<";

int main() {
    int N, M; scanf("%d%d", &N, &M);
    int x = 0, y = 0, dir = 0, gx = 0, gy = 0;
    for(int i=0; i<N; i++) {
        for(int j=0; j<M; j++) {
            scanf(" %c", &board[i][j]);
            if(pat.find(board[i][j]) != string::npos) {
                x = i, y = j;
                dir = pat.find(board[i][j]);
            }
            if(board[i][j] == 'G') {
                gx = i, gy = j;
            }
        }
    }

    used[x][y][dir] = true;
    while(1) {
        bool ok = false;
        for(int k=0; k<4; k++) {
            // printf("x = %d, y = %d, dir = %c\n", x+1, y+1, pat[dir]);
            int nd = (dir + k) % 4;
            int nx = x + dx[nd], ny = y + dy[nd];

            // 自分の右が壁でない → 右回りに方向転換
            int px = x + dx[(nd+1)%4], py = y + dy[(nd+1)%4];
            if(px >= 0 && px < N && py >= 0 && py < M && board[px][py] != '#') {
                dir = (dir + 1) % 4;
            }

            // 行き先が壁 → 左回りに
            nx = x + dx[dir], ny = y + dy[dir];
            if(nx < 0 || nx >= N || ny < 0 || ny >= M || board[nx][ny] == '#') {
                dir = (dir + 3) % 4;
                continue;
            }
            if(used[nx][ny][dir]) break;

            // printf("ok: x = %d -> %d, y = %d -> %d, dir = %d\n", x+1, nx+1, y+1, ny+1, dir);
            // とりあえず次には進めそう
            ok = true;
            used[nx][ny][dir] = true;
            x = nx, y = ny;

            // ゴールに辿り着いたら終了
            if(x == gx && y == gy) goto get_ans;

            break;
        }
        if(!ok) {
            printf("-1\n");
            return 0;
        }
    }

    get_ans:
    int ans = 0;
    for(int i=0; i<N; i++) {
        for(int j=0; j<M; j++) {
            bool ok = false;
            for(int k=0; k<4; k++) {
                ok |= used[i][j][k];
            }
            ans += ok;
        }
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 2892
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn rec(l: i64, r: i64, a: i64, ret: &mut Vec<(i64, i64, i64)>) {
    if a <= 1 {
        return;
    }

    if a % 2 == 1 {
        ret.push((l, r, a - 1));
        rec(l, r, a - 1, ret);
    } else {
        ret.push((l, l + 1, a / 2));
        ret.push((l, l + 1, 0));
        rec(l + 1, r, a / 2, ret);
    }
}

fn main() {
    input!{
        l: i64,
    }

    let mut len = 1;
    let mut t = l;
    while t > 1 {
        len += 1;
        t /= 2;
    }

    let mut ans = vec![];
    rec(0, len - 1, l, &mut ans);

    println!("{} {}", len, ans.len());
    for &(a, b, c) in ans.iter() {
        println!("{} {} {}", a + 1, b + 1, c);
    }
}


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

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define ms(a, x) memset(a, x, sizeof(a))
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
template<typename... Args> void rd(Args&... args) {((cin >> args), ...);}
template<typename... Args> void wr(Args... args) { ((cout << args << " "), ...); cout<<endl;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b,c,d;
    rd(a,b,c,d);
    int ans=0;
    ans+=min(a,d);
    d-=min(a,d);
    d-=min(b,d);
    ans-=min(c,d);
    d-=min(c,d);
    cout<<ans;
    return 0;
}



Measured memory_bytes: 3652
S = input()
res1 = res2 = 0
for i in range(len(S)):
    if (i%2 == 0 and S[i] == '0') or (i%2 == 1 and S[i] == '1'):
        res1 += 1
    if (i%2 == 0 and S[i] == '1') or (i%2 == 1 and S[i] == '0'):
        res2 += 1
print(min(res1, res2))


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
int main(){
    int n; cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int mini = p[0];
    int ans = 1;
    FOR(i,1,n){
        if(p[i] < mini){
            ans++;
            mini = p[i];
        }
    }
    cout << ans << endl;
}

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

int main()
{
  int n,l;
  string st="";
  cin>>n>>l;
 vector<string> v(n);
  for(int i=0;i<n;i++)
    cin>>v[i];
   sort(v.begin(),v.end());
  for(int i=0;i<n;i++)
    cout<<v[i];
  
  return 0;
}
  

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

int data[101];
int main()
{
	int n;
	while(cin >> n){
		if(n==0)
			break;
		for(int i=0;i<n;i++){
			cin >> data[i];
		}
		int cnt = 0;
		for(int i=0;i<n;i++){
			for(int j=n-1;j>i;j--){
				if(data[j] < data[j-1]){
					int tmp = data[j];
					data[j] = data[j-1];
					data[j-1] = tmp;
					cnt++;
				}
			}
		}
		
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                   \
  ifstream in("atcoder-problems/abc109_c.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v) \
rep(l, v.size()) { cout << v[l] << " "; } \
cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18+100;
const int MOD = 1e9 + 7;

// 最大公約数を求める関数。ユークリッドの除去法
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N, X;
  cin >> N >> X;
  
  vector<int> c(N + 1);
  rep(i, N) { cin >> c[i]; }
  c[N] = X;
  sort(c.begin(), c.end());

  ll ans = c[1] - c[0];
  rep(i, N) { ans = gcd(ans, c[i + 1] - c[i]); }

  cout << ans << endl;
}

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

int n[100005];

int main(void){
  int i,l,countR,countL,par;
  char str[1000000],s[1000000],*p;
  
  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  strcpy(s,p);
  
  l=strlen(s);
  
  i=0;
  
  while(i<l){
    countR=0,countL=0;
    while(s[i]=='R'){
      countR++;
      i++;
    }
    par=i-1;
    while(s[i]=='L'){
      countL++;
      i++;
    }
    if((countR+countL)%2==0){
      n[par]=(countR+countL)/2;
      n[par+1]=(countR+countL)/2;
    }else{
      if(countR>countL){
        if(countR%2==1){
          n[par]=(countR+countL)/2+1;
          n[par+1]=(countR+countL)/2;
        }else{
          n[par]=(countR+countL)/2;
          n[par+1]=(countR+countL)/2+1;
        }
      }else{
        if(countL%2==0){
          n[par]=(countR+countL)/2+1;
          n[par+1]=(countR+countL)/2;
        }else{
          n[par]=(countR+countL)/2;
          n[par+1]=(countR+countL)/2+1;
        }
      }
    }
  }
  
  for(i=0;i<l;i++){
    if(i==l-1){
      printf("%d\n",n[i]);
    }else{
      printf("%d ",n[i]);
    }
  }
  
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  int n1, n2, n3, n4;
  n1 = N / 1000;
  n2 = N % 1000 / 100;
  n3 = N % 1000 % 100 / 10;
  n4 = N % 1000 % 100 % 10;
  if (n1 == n2 && n2 == n3) cout << "Yes" << endl;
  else if (n2 == n3 && n3 == n4) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

int main() {
  int N, A;
  cin >> N >> A;
  if(N % 500 <= A) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int dig(ll n) {
    int i = 0;
    while(true) {
        n/=10;
        if(n == 0) return i;
        i++;
    }
}

int main(){
    ios::sync_with_stdio(false);
    const ll MAX = 1000000000000000000;
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) {
        cin >> a[i];
        if(a[i] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }

    ll ans=1;
    rep(i,n) {
        if(ans*a[i] != MAX && dig(ans)+dig(a[i]) >= 18) {
            cout << -1 << endl;
            return 0;
        }
        ans*=a[i];
        if(ans > MAX) {
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 4052
#in the name of allah
import sys
import math as mt
import bisect
input=sys.stdin.buffer.readline  
t=1
#t=int(input())
for _ in range(t):
    #n,m,k=map(int,input().split())
    #a=list(map(int,input().split()))
    #b=list(map(int,input().split()))
    n=int(input())
    ans=0
    for i in range(1,n+1):
        for j in range(i,n+1,i):
            ans+=j
    print(ans)        

Measured memory_bytes: 73400
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>

using namespace std;

int main() {
  int k,a,b,x[100];
  cin >> a >> b >> k;
  
  int j = 0;
  for(int i = 1; i <= a; i++) {
    if(a % i == 0 & b % i == 0) {
      x[j] = i;
      j++;
    }
  }
  cout << x[j-k] << endl;
}

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


auto solve(long long N, std::vector<long long> a){
    int i = 0;
    int c = 0;
    while((0 < a[i]) && (i != 1)) {
        int n = a[i] - 1;
        a[i] = -1;
        i = n;
        c++;
    }

    return (i == 1) ? c : -1;

}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    auto result = solve(N, std::move(a));
    cout << result << endl;
    return 0;
}


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

#define uni(x)      (x).resize(unique(ALL(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    string s;
    cin >> s;
    s = '#' + s;
    bool ok = true;
    for(int i = a + 1; i <= c; i++){
        ok &= !(s[i] == '#' && s[i - 1] == '#');
    }
    for(int i = b + 1; i <= d; i++){
        ok &= !(s[i - 1] == '#' && s[i] == '#');
    }
    if(d < c){
        bool ok1 = false;
        for(int i = b; i <= d; i++){
            if(s[i] == '.' && s[i + 1] == '.' && s[i - 1] == '.'){
                ok1 = true;
                break;
            }
        }
        if(ok && ok1){
            cout << "Yes";
        }else{
            cout << "No";
        }
    }else{
        cout << (ok ? "Yes" : "No");
    }
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

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

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, x, cnt = 0; cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> x;
        if((i & 1) && (x & 1)) cnt++;
    }
    cout << cnt << '\n';
    return 0;
}

Measured memory_bytes: 3596
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N, K = MAP()
h = LIST()

INF = 10**23

dp = [INF] * N
dp[0] = 0

for i in range(1, N):
    for j in range(1, K+1):
        if i - j < 0:
            continue
        dp[i] = min(dp[i], dp[i-j] + abs(h[i] - h[i-j]))

print(dp[-1])

Measured memory_bytes: 53984
#include <bits/stdc++.h>
#define sort stable_sort 
using namespace std;

int _;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int mod=1e9+7;

int n;
long long dp[1000500][2][2];


int main()
{	
	//for(scanf("%d",&_);_;_--)
	scanf("%d",&n);
	dp[0][0][0]=1;
	for(int i=1;i <= n;i++)
	{
		dp[i][0][0]=(dp[i-1][0][0] << 3)%mod;
		dp[i][1][0]=(dp[i-1][1][0]*9+dp[i-1][0][0])%mod;
		dp[i][0][1]=(dp[i-1][0][1]*9+dp[i-1][0][0])%mod;
		dp[i][1][1]=(dp[i-1][1][0]+dp[i-1][0][1]+dp[i-1][1][1]*10)%mod;
	}
	printf("%lld\n",dp[n][1][1]%mod);
	return 0;
}   	         

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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    string s; cin >> s;
    int sum = 0;
    for (auto &c: s) {
        sum += c - '0';
    }
    cout << (sum % 9 ? "No" : "Yes") << endl;
    return 0;
}


Measured memory_bytes: 3740
import bisect
N=int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) for b in B))

Measured memory_bytes: 22720
#include <stdio.h>
#include<string.h>
int main(){
    int num,i,j,u,k,value;
    int A[100][100];    

    scanf("%d",&num);
    
    /*for(i=1; i<=num; i++){
        for(j=1;j<=num; j++) A[i][j] = 0;  
    }*/
    memset(A,0,sizeof(A));

    for(i=0; i<num; i++){
        scanf("%d %d ",&u,&k);u--;
        for(j=1; j<=k; j++){
            scanf("%d",&value);value--;
            A[u][value] = 1;
        }
    }

    for(i=0; i<num; i++){
        for(j=0; j<num;j++){
            printf("%d",A[i][j]);
            if(j==num-1) printf("\n");
            else printf(" ");
        }
    }
    return 0;
}


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

int main() {

 string o,e;
  cin>>o>>e;
  
  if(o.size()==e.size()){
  for(int i=0;i<o.size();i++){
  	cout<<o[i];
  	cout<<e[i];}}
  
   else{for(int i=0;i<o.size()-1;i++){
  	cout<<o[i];
  	cout<<e[i];}cout<<o[o.size()-1]<<endl;}
  
  
}


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

int f(ll N){
	int digits=0;

	while(N>0){
		N/=10;
		digits++;
	}

	return digits;
}

int main() {
  ll n; cin >> n;
  int ans=f(n);
  for(ll i=1LL;i*i<=n;i++){
    if(n%i!=0)continue;
      const ll p=n/i;
      const int e=max(f(i),f(p));
      if(ans>e){
        ans=e;
      }

    }
  cout << ans << 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;
using namespace __gnu_pbds;

#define ll long long
#define lll __int128
#define ull unsigned long long
#define fi first
#define se second
#define db double
#define ld long double
#define lld __float128

/// order_of_key, find_by_order

template<class T, class COMP>
using custom_set = tree<T, null_type, COMP, rb_tree_tag, tree_order_statistics_node_update>;

template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class T, class U>
using ordered_map = tree<T, U, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rnd_64(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 100005;
const ll MOD = 1e9 + 7;

ll binPow(ll a, ll b)
{
    if(b == 0)
        return 1;
    if(b % 2 == 0)
    {
        a = binPow(a, b/2);
        return (a*a) % MOD;
    }
    return (a * binPow(a, b-1)) % MOD;
}

ll fact[MAXN];

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

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ll n; cin >> n;
    ll dat[n];
    for(int i = 0; i < n; i++)
    {
        cin >> dat[i];
    }
    fact[1] = 1;
    for(ll i = 2; i < n; i++)
    {
        fact[i] = (fact[i-1] + binPow(i, MOD-2)) % MOD;
    }
    ll ans = 0;
    for(int i = 1; i < n; i++)
    {
        ans += (fact[i] * (dat[i]-dat[i-1])) % MOD;
    }
    ll fct = 1;
    for(ll i = 1; i < n; i++)
    {
        fct = (fct * i) % MOD;
    }
    ans %= MOD;
    cout << (ans * fct) % MOD;
}






































/// shche ne vmerla Ykraina


Measured memory_bytes: 1920
a=gets.scan(/F*/).map &:size
x, y=gets.split.map &:to_i

x-=a.shift if a[0]>0

tx=[]
ty=[]
c=0
a.each do |e|
    if e==0
        c^=1
    else
        c==0 ? tx<<e : ty<<e
    end
end

f=->t, g do
    s={0=>true}
    t.each do |d|
        n={}
        s.each{|k, _| n[k-d]=n[k+d]=true}
        s=n
    end
    s[g]
end

puts (f[tx, x] && f[ty, y] ? "Yes" : "No")


Measured memory_bytes: 76028
#include <bits/stdc++.h>
using namespace std;
const int N=100050;
int a[N];
int main(){
	int n,m;
	scanf("%i %i",&n,&m);
	int odd=0;
	for(int i=1;i<=m;i++)scanf("%i",&a[i]),odd+=a[i]&1;
	if(odd>=3)return 0*printf("Impossible\n");
	if(n==1)return 0*printf("1\n1\n1\n");
	if(m==1)return 0*printf("%i\n2\n%i %i\n",a[1],a[1]-1,1);
	for(int i=1;i<=m;i++)if(a[i]&1){swap(a[1],a[i]);break;}
	for(int i=2;i<=m;i++)if(a[i]&1){swap(a[i],a[m]);break;}
	for(int i=1;i<=m;i++)printf("%i ",a[i]);
	printf("\n%i\n",m-(a[1]==1));
	for(int i=1;i<=m;i++){
		int x=a[i];
		if(i==1)x--;
		else if(i==m)x++;
		if(x!=0)printf("%i ",x);
	}
	printf("\n");
	return 0;
}

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

#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define rf(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
#define rb(i, b, a) for (int(i) = (b); (i) >= (a); (i)--)

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;

const int N = 1e5 + 1;
const int INF = 2e9;

string gen(string n) {
    rb(i, sz(n) - 1, 1) {
        if (n[i] == '9' || n[i] == n[i - 1] + 1)
            continue;
        n[i] = n[i] + 1;
        rf(j, i + 1, sz(n) - 1) n[j] = (char)max(n[j - 1] - 1, 48);
        return n;
    }
    if (n[0] != '9') {
        n[0] = n[0] + 1;
        rf(j, 1, sz(n) - 1) n[j] = (char)max(n[j - 1] - 1, 48);
        return n;
    }
    string res = "1";
    rf(i, 1, sz(n)) res += '0';
    return res;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    string num = "0";
    while (n--) {
        num = gen(num);
    }
    cout << num << "\n";
}

Measured memory_bytes: 256
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5*2
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

#a = cmb(n,r,mod)

H,W,A,B = map(int,input().split())
ret = 0
for i in range(H-A):
    ret += cmb(B-1+i, i, mod)*cmb(W-B-1+H-i-1, W-B-1,mod)
    
print(ret%(10**9+7))


Measured memory_bytes: 27024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

vector<long long> enumDivisor(long long num) {
  vector<long long> v;
  for (long long i = 1; i*i <= num; i++) {
    if (num % i != 0) continue;
    v.push_back(i);
    if (i * i != num) v.push_back(num / i);
  }
  return v;
};

int main() {
  long long n;
  cin >> n;
  int ans = 0;

  for (long long k : enumDivisor(n)) {
    if (k == 1) continue;
    long long tmp = n;
    while (tmp % k == 0) tmp /= k;
    if (tmp % k == 1) ans++;
  }

  ans += enumDivisor(n-1).size() - 1;

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

Measured memory_bytes: 384
import numpy as N;p=print;i=int;n=i(input());c=i(N.sqrt(n*2))
if c*c+c-n*2:p('No')
else:a=N.eye(c+1,c,0,i);t=N.triu_indices(c);a[t]=a[1:].T[t]=N.arange(n)+1;p('Yes');p(c+1);[p(c,*r)for r in a]

Measured memory_bytes: 21520
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int h,w,k;
    cin >> h >> w >> k;
    vector<string> a(h);
    REP(i,h) cin >> a[i];
    int ans=0;
    REP(mask1,(1<<h)) {
        REP(mask2,(1<<w)) {
            int cnt=0;
            REP(i,h) REP(j,w) {
                if ( !(mask1>>i&1)&&!(mask2>>j&1)&&a[i][j]=='#' ) cnt++;
            }
            if ( cnt==k ) ans++;
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3652