akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ff      first
#define ss      second
#define ll      int
#define ull     unsigned long long
#define mod     1000000007
#define vi      vector<ll>
#define ppi     pair<ll,pair<ll,ll>>
#define pb      push_back
#define mp      make_pair
#define str     string
#define pi      2*acos(0.0)
#define pr(a,x,n) for(int i=x;i<n;i++){cout<<a[i]<<" ";}
#define p(a)    cout<<a;
#define sp(x,y) fixed<<setprecision(y)<<x
#define w(x)    ll x; cin>>x; while(x--)
#define e       cout<<'\n';
#define all(v)  v.begin(), v.end()
#define test    cout<<"BECOME_EXPERT_FAST"<<endl;
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
int32_t main() {
	kehsihba();
	ll n,m;cin>>n>>m;
	str s;
	cin>>s;
	for(int i=0;i<n;i++){
		if(i==(m-1)){
			if(s[i]>='a' and s[i]<='z'){cout<<s[i];}
			else{cout<<(char)((s[i]-'A')+'a');}
		}
		else{
			cout<<s[i];
		}
	}
}







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

#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pipipii = pair<ll, pair<int, pii>>;

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'000'000'001;
constexpr ll LLINF = 4'000'000'000'000'000'001;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    --a, --b, --c, --d;
    string s;
    cin >> s;
    for(int i = a; i < c-1; ++i){
        if(s[i] == '#' && s[i+1] == '#'){
            cout << "No\n";
            return 0;
        }
    }
    for(int i = b; i < d-1; ++i){
        if(s[i] == '#' && s[i+1] == '#'){
            cout << "No\n";
            return 0;
        }
    }
    if(c > d){
        for(int i = b-1; i < d; ++i){
            if(s[i] == '.' && s[i+1] == '.' && s[i+2] == '.'){
                cout << "Yes\n";
                return 0;
            }
        }
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    return 0;
}

Measured memory_bytes: 592
import java.util.*;


public class Main {

	static void log(String s) {
		System.out.println(s);
	}

	static void log(int i) {
		System.out.println(i);
	}

	/**
	 * @param args
	 */
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		String ans;
		
		if(a < 100 || a > 999) {
			ans = "No";
		}
		else if (a-(a % 100) == 700) {
			ans = "Yes";
		}
		else if ( (a%100)-(a%10) == 70) {
			ans = "Yes";
		}
		else if ( (a%10)-7 == 0) {
			ans = "Yes";
		}
		else
			ans = "No";
		
		sc.close();
		log( ans );

	}
}	


Measured memory_bytes: 27036
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <utility>

using namespace std;

int main() {
  int a[3];
  for (int i = 0; i < 3; i++) {
    cin >> a[i];
  }
  sort(a, a + 3);
  if (a[0] == 5 && a[1] == 5 && a[2] == 7) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9+21;
const long long LINF = (long long) 1e18;
const long double PI = 2 * acos((long double)0);
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
#define Mahmud main()
#define endl "\n"
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define alla(arr,n) arr,arr+n
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define pb push_back
///Debug
#define dbg1(x) std::cerr<<#x<<"="<<(x)<<endl;
#define dbg2(x,y) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<endl;
#define dbg3(x,y,z) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<','<<#z<<"="<<(z)<<endl;
#define dbgArr(arr,n) cerr<<#arr<<"=["; printArray(arr,n,0,93); cerr<<endl;
///traversing
#define rep(n) for(int i=0;i<n;++i)
#define trv(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();++i)
///necessary functions
inline ll Int()
{
    ll _x=0,_tmp=1;
    char _tc=getchar();
    while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
    if( _tc == '-' ) _tc=getchar(), _tmp = -1;
    while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
    return _x*_tmp;
}
inline long double Double()
{
    long double d;
    scanf("%Lf",&d);
    return d;
}
ll lcm(ll a,ll b)
{
    return a/__gcd(a,b)*b;
}
int ton(string x)
{
    int y;
    std::istringstream ss(x);
    ss >> y;
    return y;
}
template<typename T>
string tostring(T x)
{
    ostringstream ss;
    ss << x ;
    return ss.str();
}

///Current Code vars
#define N 100010
long long n,k,c,d;
int arr[N+1],brr[N+1];
///Current Code functions

string s;

void solve()
{
    n = Int(), k =Int();
    for(int i=0;i<n;++i)
    {
        arr[i] = Int();
    }
    sort(arr,arr+n,greater<int>());
    int ans = 0;
    for(int i=0;i<k;++i) 
        {
            cerr<<arr[i]<<" ";
            ans += arr[i];
        }
        cout<<ans<<endl;
}

int Mahmud
{
    // ios_base::sync_with_stdio(0); //cin.tie(0);
  //#ifdef _LOCAL_
    //freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
  //while(1)
    solve();
  //#ifdef _LOCAL_
    //printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
  //#endif
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1e9+7;
void solve()
{
    ll a, b, n;
    cin>>a>>b>>n;
    if(n>=b)
    n=b-1;
    cout<<floor((a*n)/b);
}
int main()
{
    ll test=1;
    //cin>>test;
    while(test--)
        solve();
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define sd(mark) scanf("%d",&mark)
#define ss(mark) scanf("%s",&mark)
#define slld(mark) scanf("%lld",&mark)
#define clr(mark) memset(mark,0,sizeof(mark))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define sz(x) (int((x).size()))
#define PII pair<int,int>
#define PIL pair<int,long long>
#define PLL pair<long long,long long>
#define PIS pair<int,string>
#define MII map<int,int>
#define LL long long
#define rep(i,a,n) for (int i=(a);i<(n);i++)
#define per(i,a,n) for (int i=(n)-1;i>=(a);i--)
#define FILEIO(name) \
    freopen(name".in", "r", stdin); \
    freopen(name".out", "w", stdout);
#define INF 2000000000 // 2 * 10^9
#define INFLL 1000000000000000000LL  // 10^18
#define mod 1000000007

#define N 1012345

vector<int> e,o,rsa,rsb;

void solve()
{
    int n,m,a,i;
    sd(n);
    sd(m);
    for(i=0;i<m;++i)
    {
        sd(a);
        if(a&1) o.PB(a);
        else    e.PB(a);
    }
    if(n==1)
    {
        printf("1\n1\n1\n");
        return;
    }
    if(m==1)
    {
        printf("%d\n",a);
        printf("2\n");
        printf("%d 1\n",a-1);
        return;
    }
    if(o.size()>2)
    {
        printf("Impossible\n");
        return;
    }
    int f,l;
    if(o.size()>=1)
        f = o[0];
    else
    {
        f = e.back();
        e.pop_back();
    }
    if(o.size()==2)
        l = o[1];
    else
    {
        l = e.back();
        e.pop_back();
    }
    rsa.PB(f);
    if(f>1) rsb.PB(f-1);
    for(i=0;i<e.size();++i)
    {
        rsa.PB(e[i]);
        rsb.PB(e[i]);
    }
    rsb.PB(2);
    rsa.PB(l);
    if(l>1) rsb.PB(l-1);
    for(i=0;i<rsa.size();++i)
        printf("%d ",rsa[i]);
    printf("\n");
    printf("%d\n",rsb.size());
    for(i=0;i<rsb.size();++i)
        printf("%d ",rsb[i]);
    printf("\n");
}

int main()
{
    int t = 1;
    //scanf("%d",&t);
    while(t--)
    {
        solve();
    }
}



Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int n, i, j;

	scanf("%d" ,&n);

	printf("%d\n" ,n * (n - 1) / 2 - n / 2);
	for (i = 1; i <= n; i++)
		for (j = i + 1; j <= n; j++)
			if (i + j != n + (1 - n % 2))
				printf("%d %d\n" ,i, j);
	return 0;
}

Measured memory_bytes: 128
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, H, W = LI()
    AB = [LI() for _ in range(N)]

    ans = len([(A, B) for A, B in AB if A >= H and B >= W])
    print(ans)

if __name__ == '__main__':
    resolve()


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

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

  vector<vector<int>> date(N, vector<int>(D));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < D; j++) {
      cin >> date.at(i).at(j);
    }
  }

  int ans = 0;

  for (int i = 0; i < N - 1; i++) {
    for (int j = 1; j < N; j++) {
      if (i >= j) continue;
      int X = 0;
      for (int k = 0; k < D; k++) {
        int Y = date.at(i).at(k) - date.at(j).at(k);
        X += Y * Y;
      }
      int Z = floor(sqrt(X));
      if (Z * Z == X) ans++;
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
//g++ main.cpp -I /usr/local/include/ac-library
#include<cmath>
#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
using namespace atcoder;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
#define ALL(a) a.begin(), a.end()
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    int n,m;
    cin >> n>> m;
    vector<ll> av,bv;
    rep(i,n){
        ll a;
        cin >> a;
        av.push_back(a);
    }
    rep(i,m){
        ll b;
        cin >> b;
        bv.push_back(b);
    }
    vector<ll> ans=convolution(av,bv);
    rep(i,ans.size()){
        cout<<ans[i]<<endl;
        if(i==ans.size()-1){
            cout<<endl;
        }else{
            cout<<" ";
        }
    }
    return 0;
}

Measured memory_bytes: 28464
#include <iostream>

using namespace std;

//
const int MAX = 25;
const int NIL = -1;

struct Node {
    int parent = NIL;
    int left = NIL;
    int right = NIL;
};

Node T[MAX];
int D[MAX], H[MAX];

//
void setDepth(int u, int d) {
    D[u] = d;
    if (T[u].left != NIL) setDepth(T[u].left, d + 1);
    if (T[u].right != NIL) setDepth(T[u].right, d + 1);
}

int setHeight(int u) {
    int hl = 0, hr = 0;
    if (T[u].left != NIL) {
        hl = setHeight(T[u].left) + 1;
    }
    if (T[u].right != NIL) {
        hr = setHeight(T[u].right) + 1;
    }
    return H[u] = max(hl, hr);
}

void print(int u) {

    cout << "node " << u << ": ";
    cout << "parent = " << T[u].parent << ", ";

    if (T[u].parent == NIL) {
        cout << "sibling = " << -1 << ", ";
    } else if (T[T[u].parent].left != u) {
        cout << "sibling = " << T[T[u].parent].left << ", ";
    } else {
        cout << "sibling = " << T[T[u].parent].right << ", ";
    }

    if (T[u].left == NIL && T[u].right == NIL) {
        cout << "degree = " << 0 << ", ";
    } else if (T[u].left == NIL || T[u].right == NIL) {
        cout << "degree = " << 1 << ", ";
    } else {
        cout << "degree = " << 2 << ", ";
    }

    cout << "depth = " << D[u] << ", ";
    cout << "height = " << H[u] << ", ";

    if (T[u].parent == NIL) {
        cout << "root";
    } else if (T[u].left == NIL && T[u].right == NIL) {
        cout << "leaf";
    } else {
        cout << "internal node";
    }

    cout << endl;
}

//
int main() {

    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int id;
        cin >> id;
        cin >> T[id].left;
        cin >> T[id].right;
        T[T[id].left].parent = T[T[id].right].parent = id;
    }

    for (int i = 0; i < n; i++) {
        if (T[i].parent == NIL) {
            setDepth(i, 0);
            setHeight(i);
            break;
        }
    }

    for (int i = 0; i < n; i++) {
        print(i);
    }
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> l(n);
  rep(i, n) cin >> l[i];
  int ans = 0;
  rep(i, n) rep(j, i) rep(k, j) {
    if (l[i] == l[j] || l[j] == l[k] || l[k]== l[i])
      continue;
    if (l[i]+l[j] > l[k] && l[j]+l[k] > l[i] && l[k]+l[i] > l[j])
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn = 1e6 + 7;

int n, m, k;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); //C++关同步
    int a, b, c;
    cin >> a >> b >> c;
    cout << c << ' ' << a << ' ' << b << '\n';


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
typedef long long ll;
using namespace std;
int main(){
    int n;
    cin>>n;
    int x[n],y[n];
    vector<int> a(n);
    rep(i,0,n-1){
        cin>>x[i]>>y[i];
        a[i] = i;
    }
    double ans = 0.0;
    ll cnt = 0;
    do{
        double hoge = 0.0;
            rep(i,0,n-2){
                double hogex = (x[a[i]]-x[a[i+1]])*(x[a[i]]-x[a[i+1]]);
                double hogey = (y[a[i]]-y[a[i+1]])*(y[a[i]]-y[a[i+1]]);
                hoge += sqrt(hogex + hogey);
            }
            //cout<<hoge<<endl;
            ans += hoge;
            cnt++;
    }while(next_permutation(a.begin(),a.end()));
    ans = ans / (double)cnt;
    printf("%.14f\n",ans);
    return 0;
}

Measured memory_bytes: 256
use v5.18;
use warnings;
use utf8;
use Data::Dumper;
use List::Util qw( min max );
use Test::More;

sub line { chomp(my $str = <>); $str; }
sub split_line { (split / /, line) }

main();

sub main {
  my $rabbit_num = line;
  my $relations = [ split_line ];
  say solve($relations);
}

sub solve {
  my ($relations) = @_;
  my $relation_map = {};
  for my $i (0 .. $#{ $relations }) {
    my $rabbit_id = $i + 1;
    my $favorite_rabbit = $relations->[$i];
    $relation_map->{$rabbit_id} = $favorite_rabbit;
  }
  warn Dumper $relation_map;
  my $counter = {};
  while ( my ($key, $val) = each %$relation_map ) {
    my $rabbit_id = min $key, $val;
    my $favorite_rabbit = max $key, $val;
    if ($relation_map->{$favorite_rabbit} == $rabbit_id &&
      $relation_map->{$rabbit_id} == $favorite_rabbit) {
      $counter->{$rabbit_id} = 1;
    }
  }
  scalar keys %$counter;
}



Measured memory_bytes: 75212
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef _DEBUG
#define LOCAL
#endif

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

template<typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

const int MAX = 1e5 + 41;
const int MOD = 1e9 + 7;

int mul(int a, int b) {
	return (ll) a * b % MOD;
}

int add(int a, int b) {
	a += b;
	if (a >= MOD) a -= MOD;
	return a;
}

int ans;
char s[MAX];
int n;

void solve() {
	vi cnt(26, 0);
	fi(0, n - 1) {
		int c = s[i] - 'a';
		cnt[c]++;
	}
	ans = 1;
	fi(0, sz(cnt) - 1) {
		ans = mul(ans, cnt[i] + 1);
	}
	ans--;
	if (ans < 0) ans += MOD;
	printf("%d\n", ans);
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif

	scanf("%d", &n);
	scanf("%s", s);	
	solve();

	exit();
	return 0;
}





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

public class Main {
	public void maain(){

	}

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????

		//1???????????\????????¢
	       StringBuilder buider = new StringBuilder();

	       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String n = br.readLine();
        int key = 0;
        int kari = 0;


        //2???????????\????????¢
        String[] input2 = br.readLine().split(" ");

        //???????????????
        int[] num = new int[Integer.parseInt(n)];

        for(int set = 0; set < num.length; set++){
        	num[set] = Integer.parseInt(input2[set]);
        }

        //???????????????????????¨???
        for(int out = 1;out  <  num.length; out++){
        	key = num[out];
        	kari = out -1;
        	//???????????\
        	for(int set = 0; set < num.length; set++){
        		buider.append(num[set]);
        		if(set != num.length -1){
        			buider.append(" ");
        		}
        	}
        	System.out.println(buider.toString());

        	//????????¢?????????
        	buider.setLength(0);

        	//????????????
        	while(kari >= 0 && num[kari] > key){
        		num[kari + 1] = num[kari];
        		kari--;
        	}

        	//while?????\???????????´???
        	num[kari + 1] = key;
        }

        //??????????????¢??¨???
    	for(int set = 0; set < num.length; set++){
    		buider.append(num[set]);
    		if(set != num.length -1){
    			buider.append(" ");
    		}
    	}
    	System.out.println(buider.toString());
	}
}

Measured memory_bytes: 26108
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
using namespace std;


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

    map<string, int> dict;
    int maxcounter = 0;

    for(int i=0; i<N; ++i){
        string s;
        cin >> s;

        if(dict.count(s) > 0){
            dict[s] += 1;
        }else{
            dict[s] = 1;
        }
        maxcounter = max(maxcounter, dict[s]);
    }

    for(auto word_counter: dict){
        if(word_counter.second == maxcounter){
            cout << word_counter.first << endl;
        }
    }

}

Measured memory_bytes: 19216
#include <cstdio>

const int N = 200001;
const int MOD = (int)1e9 + 7;

int fact[N], inv_fact[N];

int ways(int a, int b)
{
    return 1LL * fact[a + b] * inv_fact[a] % MOD * inv_fact[b] % MOD;
}

int main()
{
    inv_fact[1] = 1;
    for (int i = 2; i < N; ++ i) {
        inv_fact[i] = 1LL * (MOD - MOD / i) * inv_fact[MOD % i] % MOD;
    }
    fact[0] = inv_fact[0] = 1;
    for (int i = 1; i < N; ++ i) {
        fact[i] = 1LL * fact[i - 1] * i % MOD;
        inv_fact[i] = 1LL * inv_fact[i - 1] * inv_fact[i] % MOD;
    }
    int n, m, a, b;
    scanf("%d%d%d%d", &n, &m, &a, &b);
    int result = ways(n - 1, m - 1);
    for (int j = 0; j < b; ++ j) {
        result += MOD - 1LL * ways(n - a - 1, j) * ways(a - 1, m - j - 1) % MOD;
        if (result >= MOD) {
            result -= MOD;
        }
    }
    printf("%d\n", result);
}


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

int main() {
  int n;
  cin >> n;
  int one, ten, hun, tho;
  one = n % 10;
  ten = (n / 10) % 10;
  hun = (n / 100) % 10;
  tho = (n / 1000) % 10;
  
  if ((one == ten && ten == hun) || (ten == hun && hun == tho)) {
  	cout << "Yes" << endl;
  }
  else {
  	cout << "No" <<endl;
  }
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#include <map> // pair
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int ans=3;
  if(a==c||a==b||b==c){
    if(a==b&&b==c)ans=1;
    else ans=2;
  }
   cout<<ans<<endl;
  }


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

using namespace std;

int main() {
  std::ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  long long cnt = 0;
  for (auto c : s) {
    cnt += (c == 'W');
  }
  long long ans = 0;
  for (auto c : s) {
    if (c == 'B') ans += cnt;
    else cnt--;
  }
  cout << ans << endl;
  return 0;
}


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

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

int main() {
  int x, n, a = -1;
  bool c = true;
  cin >> x >> n;
  vector<int> v(n);
  REP(i, n) {
    cin >> v[i];
  }
  while(c) {
    a++;
    bool d = true, e = true;
    REP(i, n) {
      if(v[i] == x + a) {
        d = false;
        break;
      }
    }
    REP(i, n) {
      if(v[i] == x - a) {
        e = false;
        break;
      }
    }
    if(e) a = -a;
    if(d || e) c = false;
  }
  cout << x + a << endl;
}

Measured memory_bytes: 3624
a, b = map(int, input().split(' '))

b_l = list(range(int(b/0.1), int((b+0.99)//0.1+1)))
for b_ in b_l:
  s = int(b_*0.08//1)
  if s==a:
    print(str(b_))
    exit(0)
print('-1')

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < 100; i++) {
		for (int j = 0; j < 100; j++) {
			if (i * 4 + j * 7 == n) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

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

int main() {

    string S;

    cin >> S;

    if(S.at(0)==S.at(1)&&S.at(1)==S.at(2)&&S.at(2)==S.at(0)){

    cout << "No" << endl;
    }

   else{

   cout << "Yes" << endl;
   }
   }

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

int Max(int a, int b, int c, int k){
	if(a>=b && a>=c){
		return a*pow(2,k) + b + c;
	}
	if(b>=a && b>=c){
		return b*pow(2,k) + a + c;
	}
	if(c>=b && c>=a){
		return c*pow(2,k) + a + b;
	}	
}

int main(){
	int a, b, c;
	int k;
	scanf("%d %d %d", &a, &b, &c);
	scanf("%d", &k);
	printf("%d", Max(a,b,c,k));
	
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 3e5 + 5;
const ll mod = 1e9 + 7;
ll w[maxn];

ll add(ll x, ll y)
{
	x += y;
	if (x >= mod)
		x -= mod;
	return x;
}

ll sub(ll x, ll y)
{
	x -= y;
	if (x < 0)
		x += mod;
	return x;
}

ll mul(ll x, ll y)
{
	return x * y % mod;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> w[i];
    }
    ll ans = 0;
    for (int i = 0; i < 60; i++) {
        ll cnt = 0;
        for (int j = 0; j < n; j++) {
            cnt += (w[j] >> i) & 1;
        }
        ans = add(ans, mul((1LL << i) % mod, mul(cnt, n - cnt)));
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////
//

int n;

void rec(int d, string s, int m) {
    if (d == 1) {
        cout << s << endl;
    } else {
        rep(i, m + 1) {
            char c = 'a' + i;
            int mm = i == m ? m + 1 : m;
            rec(d - 1, s + c, mm);
        }
    }
}


int main() {
    cin >> n;
    rec(n, "a", 1);
    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define fr(x) scanf("%lld", &x)
#define int long long
using namespace std;

int isnp[100010], a[100010];

void init() {
	isnp[1] = 1;
	for(int i=2; i<=100005; ++i) {
		if(isnp[i]) continue;
		for(int j=i+i; j<=100005; j+=i) {
			isnp[j] = 1;
		}
	}
	for(int i=1; i<=100005; ++i) {
		if((i&1) && (isnp[i] == 0) && (isnp[(i+1)/2] == 0)) {
			a[i] = 1;
		}
	}
	for(int i=1; i<=100005; ++i) {
		a[i] += a[i-1];
	}
}

signed main(){
	init();
	int q;
	fr(q);
	while(q--) {
		int l, r;
		fr(l);
		fr(r);
		printf("%d\n", a[r]-a[l-1]);
	}
	return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;

using Graph = vector<vector<int>>;

vector<pair<long long, long long>> prime_factorize(long long N)
{
    vector<pair<long long, long long>> res;
    for (long long a = 2; a * a <= N; ++a)
    {
        if (N % a != 0)
            continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0)
        {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1)
        res.push_back({N, 1});
    return res;
}

int main()
{
    ll n;
    cin >> n;
    vector<pair<long long, long long>> vec = prime_factorize(n);
    ll ans = 0;
    for (int i = 0; i < vec.size(); i++)
    {
        ll j = 1;
        while (vec[i].se >= 0)
        {
            if (vec[i].se - j < 0)
            {
                break;
            }
            else
            {
                vec[i].se -= j;
                ans++;
                j++;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int include3(int x){
    for(;;){
        if(x%10==3){
            return x;
            
        }else{
            x /= 10;
        }
        if(x<3 ){
            return 0;
            break;
        };
    }
}

int main(){
    int n, i;
        cin >> n;

        for(i=1;i<n+1;i++){
            if(i%3==0){
                cout << " " << i;
            }else{
                if(include3(i)!=0){
                    cout << " " << i;
                }

            }
        }
    cout << endl;
}



Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define pll pair<ll,ll>
int main() {
  ll N, K; 
  ll total = 0; 
  cin >> N >> K; 
  total += N * (N - 1)/2; 
  total += K * (K - 1)/2; 
  cout << total; 
}

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

template<typename T>
constexpr T factorial(T n)
{
    T ret = 1;
    for (int i=1; i <= n; i++)
    {
        ret *= i;
    }
    return ret;
}

template<typename T>
constexpr T combination(T a, T b)
{
    T ret = 1;
    for (int i=0; i < b; i++)
    {
        ret *= a--;
    }
    return ret / factorial(b);
}

using ll=long long;
using namespace std;
int main()
{
    int n;
    cin >> n;

    vector<ll> h;
    for (int i=0; i < n; i++)
    {
        string val;
        cin >> val;
        std::sort(val.begin(), val.end());
        h.push_back(std::hash<std::string>{}(val));
    }
    sort(h.begin(), h.end());
    h.push_back(0);

    ll c = 0, accum = 0;
    ll prev = 0;
    for (auto e: h)
    {
        c++;
        if (e != prev)
        {
            accum += combination(c, 2LL);
            c = 0;
        }
        prev = e;
    }

    cout << accum << endl;
    return 0;
}


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

#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))

#define DIVUP(x, y) (((x) + ((y) - 1)) / (y))
#define DIVOFF(x, y) (((x) + ((y) / 2)) / (y))
#define REMAINDER(x, y) ((x) % (y))

int main() {
  long a, b, x, ans;

  scanf("%ld%ld%ld", &a, &b, &x);

  if (a > 0)
    ans = b / x - (a - 1) / x;
  else
    ans = b / x + 1;

  printf("%ld\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

ll N, M, Q;
ll ans = 0;
vector<ll> A;
vector<vector<ll>> abcd;
void rep(ll index, ll last)
{
  if (index == N) {
    ll temp = 0;
    for (ll i = 0; i < Q; ++i) {
      if (A.at(abcd.at(i).at(1)) - A.at(abcd.at(i).at(0)) == abcd.at(i).at(2)) {
        temp += abcd.at(i).at(3);
      }
    }
    ans = max(ans, temp);
    return;
  }
  for (ll i = last; i <= M; ++i) {
    A.at(index) = i;
    rep(index + 1, i);
  }
}

int main()
{
  cin >> N >> M >> Q;
  A = vector<ll>(N);
  abcd = vector<vector<ll>>(Q);
  for (ll i = 0; i < Q; ++i) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    a -= 1;
    b -= 1;
    abcd.at(i) = {a, b, c, d};
  }
  rep(0, 1);
  cout << ans << endl;
}


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

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

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = 1<<30;
const ll mod = 1000000007LL;

int main() {
  int N;
  cin>>N;
  vector<queue<int>> vq(N);
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N-1;j++){
      int x;
      cin>>x;
      vq[i].push(x-1);
    }
  }
  vector<int> v(N);
  for(int i = 0; i < N; i++) {
    v[i]=vq[i].front();
    vq[i].pop();
  }
  bool can = true;
  int day = 0;
  while(true){
    bool n = false;
    vector<bool> m(N,false);
    for(int i = 0; i < N; i++) {
      if(m[i])continue;
      if(v[i]==-1)continue;
      if(m[v[i]]) continue;
      if(v[v[i]]==i){
        int t = v[i];
        if(vq[i].empty()) v[i]=-1;
        if(!vq[i].empty()){
          v[i]=vq[i].front();
          vq[i].pop();
        }
        if(vq[t].empty()) v[t] = -1;
        if(!vq[t].empty()){
          v[t]=vq[t].front();
          vq[t].pop();
        }
        m[i]=true;
        m[t]=true;
        n = true;
      }
    }
    day++;
    if(!n) break;
  }
  for(auto x:v) if(x!=-1)can = false;
  if(can)cout<<day-1<<endl;
  else cout<<-1<<endl;
}
  

Measured memory_bytes: 4736
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
   int n;
   cin>>n;
   map<string,int> a;
   string st;
   for(int i=0;i<n;i++){
       cin>>st;
       a[st]++;
   }
   cout<<a.size()<<endl;
    return 0;
}

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

int gcd(int x, int y){
  int r;
  if(x<y)swap(x,y);

  while(y>0){
    r = x % y;
    x = y;
    y = r;
    
  }
  return x;
}

int main(){
  int x,y;
  cin >> x >> y;
  int result = gcd(x,y);

  cout << result << endl;
  
  return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
const long long MOD = pow(10,9)+7;
int main(){
  int N;
  string S;
  cin >> N >> S;
  vector<long long> v(26);
  for(char c : S) v[c-'a'] = (v[c-'a']+1)%MOD;
  long long ret = 1;
  for(long long i : v) ret = (ret*(i+1))%MOD;
  cout << (ret+MOD-1)%MOD;
  return 0;
}


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

using namespace std;
int main() {
  string str;
  int char_num;
  bool cout_flag = false;
  cin >> str;

  for (int j = 0; j < str.length(); j++)
  {
    char_num = 0;
    for (int k = 0; k < str.length(); k++)
    {
      if (str[j] == str[k])
      {
        char_num++;
      }
    }
    if (char_num % 2 == 1)
    {
      cout << "No";
      cout_flag = true;
      break;
    }
  }
  if (!cout_flag)
  {
    cout << "Yes";
  }

  return 0;
}


Measured memory_bytes: 256
#include <set>
#include <map>
#include <cstdio>
#include <cctype>
#include <vector>
#include <cstring>
#include <algorithm>
#define mp std::make_pair
#define pr std::pair<int,int>
#define gc() getchar()
typedef long long LL;
const int N=1005;

LL A[N];
std::map<LL,bool> f;

inline LL read()
{
	LL now=0,f=1;register char c=gc();
	for(;!isdigit(c);c=='-'&&(f=-1),c=gc());
	for(;isdigit(c);now=now*10+c-48,c=gc());
	return now*f;
}

int main()
{
	int n=read();
	for(int i=1; i<=n; ++i) A[i]=read();
	for(int i=1; i<=n; ++i)
	{
		LL x=0;
		for(int j=i; j<=std::min(n,i+10); ++j)
			x=x*10+A[j], f[x]=1;
	}
	for(int i=0; ; ++i) if(!f.count(i)) return printf("%d\n",i),0;

	return 0;
}


Measured memory_bytes: 3260
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <map>
 
using namespace std;
typedef long long ll;


bool checkp(ll a[],int n,ll b[]){
	for(int i = 0; i < n; i++){
		if(a[i]!= b[i]) return false;
	}
	return true;
}


ll ans;
ll a[10000],q[100000],p[100000];
int main(){
	int n;
	cin>>n;
	for(int i = 0; i < n; i++){
		cin>>p[i];
	}
	for(int i = 0; i < n; i++){
		cin>>q[i];
		a[i] = q[i];
	}
	sort(a,a+n);
	int flag=0,flag2=0,cnt=0;
	do{
		cnt++;
		if(checkp(a,n,p) == true){
			flag=cnt;
		}
		if(checkp(a,n,q) == true){
			flag2 = cnt;
		}
	}while(next_permutation(a,a+n));
	cout<<abs(flag-flag2);
}

Measured memory_bytes: 256
import numpy as np

n = int(input())
x = np.array([input().split() for _ in range(n)], dtype=np.int)
norm2 = np.sum(x * x, axis=1)
dist = -2. * x.dot(x.T) + norm2
dist = np.sqrt(dist.T + norm2)
print(dist.sum() / n)

Measured memory_bytes: 12444
N,M = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
b = [0,2,5,5,4,5,6,3,7,6]

dp = []*(N+1)
dp[0] = 0

1.upto(N) do |i|
  tmp = []
  a.each do |v|
    tmp << dp[i-b[v]] + 1 if i >= b[v] && !dp[i-b[v]].nil?
  end
  dp[i] = tmp.empty? ? nil : tmp.max
end

a.sort!.reverse!
idx = N
ans = ""
a.each do |v|
  while dp[idx-b[v]] == dp[idx] - 1 && idx >= b[v]
    ans += v.to_s
    idx -= b[v]
  end
end

puts ans

Measured memory_bytes: 10748
#include <bits/stdc++.h>
using namespace std;
#define int long long int
// #include "../../Template.cpp"

const int mod = (1e9) + 7;

vector<int> arr;
int n, d;
vector<vector<int>> dp;

int solve(int ind, int curr = 0, bool small = 0) {
    if(ind == n) {
        return curr == 0;
    }
    if(small == 1 && dp[ind][curr] != -1) {
        return dp[ind][curr];
    }
    int ans = 0;
    int limit = small ? 9 : arr[ind];
    for(int i = 0; i <= limit; i ++) {
        if(i!= limit)
            ans += (solve(ind+1, (curr+i)%d, 1));
        else 
            ans += (solve(ind+1, (curr+i)%d, small));
        ans %= mod;
    }
    if(small == 1)
        dp[ind][curr] = ans;
    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s; cin >> s >> d;
    n = s.size();
    for(auto i : s) {
        arr.push_back(i - '0');
    }
    dp.resize(n+1, vector<int>(d, -1));
    int ans = solve(0, 0);
    ans = (ans - 1 + mod) % mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11136
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
//typedef boost::multiprecision::cpp_int bigint;

string S;

int main() {
	cin >> S;
	for (ll n = 0; n < S.size(); n += 2) {
		cout << S.substr(n, 1);
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 512
#include "bits/stdc++.h"

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(ll)(n);i>0;i--)
#define REP(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
#define mp make_pair


int main() {
  int n;
  cin >> n;
  vl a(n);
  rep (i, n) {
    cin >> a[i];
  }
  if (a[0]) {
    cout << -1 << endl;
    return 0;
  }
  rep1 (i, n - 1) {
    if (a[i] - a[i - 1] > 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  ll pre = 0;
  ll cnt = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == pre + 1) {
      pre = a[i];
    }
    else {
      cnt += pre;
      pre = a[i];
    }
  }
  cnt += pre;
  cout << cnt << endl;
}
      


Measured memory_bytes: 1792
for e in iter(input, '0 0'):
    a, l = map(int, e.split())
    his = [a]
    for i in range(1, 30):
        a = str(a)
        size = len(a)
        res = sorted(a + '0' * (l - size))
        mi = int(''.join(res))
        ma = int(''.join(res)[::-1])
        a = ma - mi
        if a in his:
            break
        else:
            his.append(a)
    j = his.index(a)
    print(j, a, i - j)


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

#define EPS (1e-10)
#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)
#define all(a) a.begin(), a.end()

using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvb = vector<vb>;

constexpr int MOD = 1000000007;

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

    ll n;
    cin >> n;

    ll minv = LLONG_MAX;
    rep(i, 0, 5) {
        ll x;
        cin >> x;
        minv = min(minv, x);
    }

    cout << (n + minv - 1) / minv + 4 << endl;

    return 0;
}

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

int main()
{
    int n,t, a;
    cin >> n >> t >> a;
    int h[n], ans = 0;
    rep(i,n) cin >> h[i];
    for (int i = 1;i<=n-1;i++){
        if (fabs(t-0.006*(double)h[ans]-a)>fabs(t-0.006*(double)h[i]-a)) ans = i;
    }
    cout << ans+1 << endl;
}

Measured memory_bytes: 256
import math
n = int(input())
if n == 1:
  print(0)
  exit(0)
  
pows = []
upto = int(math.sqrt(n))
for i in range(2, upto+1):
  if n % i == 0:
    cc = 0
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)
    

if n != 1:
  pows.append(1)
    
if len(pows) == 0:
  print(1)
  exit(0)
  
ans = 0
for pp in pows:
  start = 1
  cc = 0
  while pp - start >= 0:
    cc += 1
    pp -= start
    start += 1

  ans += cc

print(ans)      


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


int main(){
    int i,a;
    int64_t x;
    int count=0;
    int64_t K=100;
    cin>>x;
    for(i=0;K<x;i++){
        K+=K/100;
        count++;
    }
    cout<<count;
return 0;
}

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

const int INF = INT_MAX / 2;

int main(){
    long L, R; cin >> L >> R;
    long n = L%2019;
    long diff = R - L;
    if(n+(R-L)>=2019){
        cout << 0 << endl;
        return 0;
    } 

    long ans = INF;
    for (int i = 0; i < diff; i++)
    {
        for (int j = i+1; j <= diff; j++)
        {
            ans = min(ans, ((n+i) * (n+j))%2019);
        }
        
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <stdio.h>
using namespace std;

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


Measured memory_bytes: 256
// AtCoder :: Beginner Contest 177 :: C - Sum of product of pairs 
// https://atcoder.jp/contests/abc177/tasks/abc177_c

// REF: https://www.geeksforgeeks.org/sum-product-pairs-array-elements/
// (a + b + c + ..)^2 = (a^2 + b^2 + c^2 ... + 2 * (a*b + b*c ...))

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const ll MOD{1000000007};

ll pow(ll base, ll exp, ll mod) {
    ll result = 1;
    base = base % mod;

    if (base == 0) return 0;

    while (exp > 0) {
        if (exp & 1) {
            result = (result * base) % mod;
        }

        exp = exp >> 1;
        base = (base * base) % mod;
    }
    return result;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    vector<ll> arr;
    arr.reserve(N);
    copy_n(istream_iterator<int>(cin), N, back_inserter(arr));

    // Compute sum of array.
    ll arraySum{0};
    for (int i{0}; i < N; ++i) {
        arraySum = (arraySum + arr[i]) % MOD;
    }

    // Compute (a + b + c ...)^2
    ll arraySumSquared = (arraySum * arraySum) % MOD;

    // Compute sum of individual squares
    ll individualSquaresSum{0};
    for (int i{0}; i < N; ++i) {
        ll sq = (arr[i] * arr[i]) % MOD;
        individualSquaresSum = (individualSquaresSum + sq) % MOD;
    }

    // Mod inverse of 2.
    ll modInv2{pow(2, MOD-2, MOD)};

    // Solution
    ll a = (arraySumSquared - individualSquaresSum) % MOD;
    if (a < 0) {
        a += MOD;
    }
    ll soln{(a * modInv2) % MOD};
    cout << soln << "\n";
    return EXIT_SUCCESS;
}


Measured memory_bytes: 4764
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

n = I()
a = LI()

# n枚のカードでaとbが勝負。
# i番目のカードにはaiの整数が書かれている。
# それぞれ1枚ずつカードをとる。aが先行してカードをとる。
# 2人がすべてのカードをとったときゲーム終了、合計数がそれぞれの特典。
# 二人とも自分の特典を最大化するとき、AがBより何点多く取るか。
# つまりカードが見えている。

a.sort(reverse=True)
A = 0
B = 0

for i in range(n):
    if i % 2 == 0:
        A += a[i]
    else:
        B += a[i]

print(A - B)
    


Measured memory_bytes: 61824