akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<deque>
#include<sstream>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<bitset>
#include<time.h>
#include<cstdlib>
#include<cassert>
#define ll long long
#define fi first
#define se second
using namespace std;

const ll MOD=(ll)1e9+7;
int n;
ll a[100001],t[100001];
ll ka[100001],kt[100001];
                   
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
    freopen("in", "r", stdin); 
    freopen("out","w",stdout);
#endif
  cin>>n;
  ll tmax=0;
  for(int i=0;i<n;i++){
    cin>>t[i];
    tmax=max(t[i],tmax);
  }
  ll amax=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    amax=max(a[i],amax);
  }
  if(amax!=tmax){
    cout<<0<<"\n";
    return 0;
  }
  kt[0]=t[0];
  for(int i=1;i<n;i++){
    if(t[i-1]!=t[i])kt[i]=t[i];
    else if(t[i]==1)kt[i]=1;
  }
  ka[n-1]=a[n-1];
  for(int i=n-2;i>=0;i--){
    if(a[i+1]!=a[i])ka[i]=a[i];
    else if(a[i]==1)ka[i]=1;
  }
  for(int i=0;i<n;i++){
    if(ka[i]>0 && kt[i]==0){if(ka[i]>t[i]){cout<<0<<"\n";return 0;}kt[i]=ka[i];}
    else if(ka[i]==0 && kt[i]>0){if(kt[i]>a[i]){cout<<0<<"\n";return 0;}ka[i]=kt[i];}
    else if(ka[i]!=kt[i]){
      cout<<0<<"\n";
      return 0;
    }
  }
  ll ans=1;
  for(int i=0;i<n;i++){
    if(ka[i])continue;
    ans=((ans%MOD)*(min(a[i],t[i])%MOD))%MOD;
  }
  cout<<ans<<"\n";
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}

Measured memory_bytes: 3328
// AOJ 2804 Minimum Enclosing Rectangle
// 2018.5.5 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

typedef struct { int x, y; } PP;

#define INF 1e18
#define EPS 1e-8
#define EQ(a,b)  (fabs((a)-(b))<EPS)

#define MAX_N 100002
int xpos[MAX_N], ypos[MAX_N];
PP  pi[MAX_N<<2], po[MAX_N<<2]; int sz;

int cmp(PP *a, PP *b) {
	if (a->y - b->y) return a->y - b->y;
	return a->x - b->x;
}

PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; }
long long cross(PP a, PP b) { return (long long)a.x * b.y - (long long)a.y * b.x; }
int convex_hull(int n, PP *ps, PP *po)
{
	int i, k, j = 0;

	qsort(ps, n, sizeof(PP), cmp);
	for (i = 0; i < n; i++) {
		while (j > 1 && cross(vsub(po[j-1], po[j-2]), vsub(ps[i], po[j-1])) <= 0) j--;
		po[j++] = ps[i];
	}
	k = j;
	for (i = n - 2; i >= 0; i--) {
		while (j > k && cross(vsub(po[j-1], po[j-2]), vsub(ps[i], po[j-1])) <= 0) j--;
		po[j++] = ps[i];
	}
	return j-1;
}

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void xypos(int id, int x, int y)
{
	xpos[id] = x, ypos[id] = y;
	pi[sz].x = x  , pi[sz].y = y,   sz++;
	pi[sz].x = x+1, pi[sz].y = y,   sz++;
	pi[sz].x = x,   pi[sz].y = y+1, sz++;
	pi[sz].x = x+1, pi[sz].y = y+1, sz++;
}

int main()
{
	int N, n, i, j, d, x, y;
	double delta, ans;
	double t, fx, fy, xmin, xmax, ymin, ymax, cosv, sinv;

	sz = 0;
	xypos(0, 0, 0);
	N = in();
	for (i = 1; i < N; i++) {
		n = in(), d = gc() & 0xf, gc();
		x = xpos[n], y = ypos[n];
		if      (d == 0) xypos(i, x-1, y);	// 左
		else if (d == 1) xypos(i, x, y+1);  // 下
		else if (d == 2) xypos(i, x+1, y);  // 右
		else             xypos(i, x, y-1);  // 上
	}

	n = convex_hull(sz, pi, po);
	po[n] = po[0];

	ans = INF;
	for (i = 0; i < n; i++) {
		delta = -atan2(po[i+1].y-po[i].y, po[i+1].x-po[i].x);
		d = !EQ(delta,0);
		if (d)	cosv = cos(delta), sinv = sin(delta);
		x = po[i].x, y = po[i].y;
		xmin = ymin = INF, xmax = ymax = -INF;
		for (j = 0; j < n; j++) {
			if (d) {
				fx = (po[j].x-x) * cosv - (po[j].y-y) * sinv;
				fy = (po[j].x-x) * sinv + (po[j].y-y) * cosv;
			} else fx = po[j].x, fy = po[j].y;
			if (fx < xmin) xmin = fx;
			if (fx > xmax) xmax = fx;
			if (fy < ymin) ymin = fy;
			if (fy > ymax) ymax = fy;
		}
		t = (xmax-xmin)*(ymax-ymin);
		if (t < ans) ans = t;
	}
	printf("%.10lf\n", ans);
	return 0;
}



Measured memory_bytes: 8544
#include <bits/stdc++.h>
 
using namespace std;
 
int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s, t;
    cin >> s >> t;
    int mx_len = 0;
    int ns = s.size();
    int nt = t.size();
    for (int i = 0; i <= ns - nt; ++i) {
        int match = 0;
        for (int j = i; j < i + nt; ++j) {
            if (s[j] == t[j - i]) {
                match++;
            }
        }
        mx_len = max(mx_len, match);
    }
    cout << nt - mx_len << "\n";
    return 0;
}

Measured memory_bytes: 3652
//
//  ALDS1_2_C_StableSort.cpp
//  test
//
//  Created by Sajor on 2019/3/22.
//  Copyright © 2019年 Sajor. All rights reserved.
//

#include <iostream>
using namespace std;
#define MAX_N 105

struct Card{
    char suit, value;
};

void print(Card a[], int n){
    for(int i=0; i<n; i++){
        if (i>0) cout << " ";
        cout << a[i].suit << a[i].value;
    }
    cout << endl;
}

void selectionSort(Card *a, int n){
    int mini_n;
    Card temp;

    for(int i=0; i<n; i++){
        mini_n = i;
        for(int j=i; j<n; j++){
            if(a[j].value < a[mini_n].value)
                mini_n = j;
        }
        if (mini_n != i){
            temp = a[i];
            a[i] = a[mini_n];
            a[mini_n] = temp;
        }
    }
}
void bubbleSort(Card *a, int n){
    Card temp;
    for (int i=1; i<n; i++){
        for (int j=0; j<n-i; j++){
            if(a[j].value>a[j+1].value){
                temp = a[j];
                a[j] = a[j+1];
                a[j+1] = temp;
            }
        }
    }
}
bool isStable(Card *C1, Card *C2, int n){
    for(int i=0; i<n; i++){
        if (C1[i].suit != C2[i].suit){
            return false;
        }
    }
    return true;
}
int main()
{
    Card C1[MAX_N], C2[MAX_N];
    int N;
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> C1[i].suit >> C1[i].value;
    }
    for(int i=0; i<N; i++)
        C2[i] = C1[i];
    
    bubbleSort(C1, N);
    selectionSort(C2, N);
    
    print(C1, N);
    cout << "Stable" << endl;
    print(C2, N);
    if (isStable(C1, C2, N)) cout << "Stable" << endl;
    else cout << "Not stable" << endl;
    return 0;
}



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

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;

//少数点表示
//cout <<std::fixed << std::setprecision(14)

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    double a,b;
    cin >> a >> b;
    bool af=false,bf=false;
    for(double i=0;i<=10000;i++){
        int ansb=i*0.1;
        int ansa=i*0.08;
        if(ansb==b){
            bf=true;
        }
        if(ansa==a){
            af=true;
        }
        if(af && bf){
            cout <<i;
            return 0;
        }else{
            af=false;
            bf=false;
        }
        if(!af && !bf &&  i==10000){
        cout << "-1";
    }

    }



}

Measured memory_bytes: 384
#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 rrng(a) a.rbegin(), a.rend()
#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 eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define print(x) cout << 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 tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

ll masu[5050][5050];
ll dp[5050][5050][4];
int main() {
  int r, c, k;
  cin >> r >> c >> k;
  rep(i, k) {
    int x, y, v;
    cin >> x >> y >> v;
    masu[x-1][y-1] = v;
  }
  rep(i, r) {
    rep(j,c) {
      for(int k =2;k>=0;k--){
        maxs(dp[i][j][k+1],dp[i][j][k]+masu[i][j]);
      }
      rep(k,4){
        maxs(dp[i+1][j][0],dp[i][j][k]);
        maxs(dp[i][j+1][k],dp[i][j][k]);
      }
    }
  }
  ll ans = 0;
  rep(k,4)maxs(ans,dp[r-1][c-1][k]);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 377028
#include <algorithm>
#include <iostream>
using namespace std;
long long dp[1<<16], A[1<<16];
int n;

long long dfs(int s, int t, int i) {
    long long ans = A[t] + dp[s^t];
    if (i < n) {
        ans = max(ans, dfs(s, t, i+1));
        if (s&(1<<i)) ans = max(ans, dfs(s, t^(1<<i), i+1));
    }
    return dp[s] = max(dp[s], ans);
}

int main() {
    cin >> n;
    int a[n][n]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> a[i][j];
    for (int s = 1; s < 1<<n; s++) {
        long long sum = 0;
        for (int i = 0; i < n; i++) {
            if (s & (1<<i)) {
                for (int j = i+1; j < n; j++)
                    if (s & (1<<j)) sum += a[i][j];
            }
        }
        A[s] = sum;
    }

    for (int s = 1; s < 1<<n; s++) dfs(s, 0, 0);
    cout << *max_element(dp, dp+(1<<n)) << endl;
}


Measured memory_bytes: 1280
#include<iostream>
#include<algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <sstream>

using namespace std;
typedef long long ll;
char a[7][7];
bool c[7][7];
int n, m, k;
int ans;

int main() {
	cin.sync_with_stdio(0); cin.tie(0); cout.tie(NULL);
	
	cin >> n >> m >> k;
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
			if (a[i][j] == '#')cnt += 1;
		}
	}

	if (cnt < k) {
		cout << 0 << '\n';
		return 0;
	}
	for (int i = 0; i < (1 << (n + m)); i++) {
		memset(c, false, sizeof(c));
		for (int j = 0; j < n; j++) {
			if (i & (1 << j)) {
				for (int r = 0; r < m; r++) {
					c[j][r] = true;
				}
			}
		}
		for (int j = n; j < n + m; j++) {
			if (i & (1 << j)) {
				int idx = j - n;
				for (int r = 0; r < n; r++) {
					c[r][idx] = true;
				}
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (!c[i][j] && a[i][j] == '#') {
					cnt += 1;
				}
			}
		}
		if (cnt == k)ans += 1;
	}
	cout << ans << '\n';




}

Measured memory_bytes: 3200
using System;
public class Hello{
    public static void Main(){
        int N = int.Parse(Console.ReadLine());
        int[] cards = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
        int aliceScores = 0;
        int bobScores = 0;
        Array.Sort(cards);
        Array.Reverse(cards);
        for(int i = 0;i < N;i++){
            if(i % 2 == 0){
                aliceScores += cards[i];
            }else{
                bobScores += cards[i];
            }
        }
        Console.WriteLine(aliceScores - bobScores);
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

    string s;
    while (cin >> s, s[0] != '#') {
        string t;
        rep(i, s.size()) {
            if (s[i] == 'n' || s[i] == 'w') {
                t += s[i];
            }
        }
        reverse(all(t));
        int numer = t[0] == 'w';
        int denom = 1;
        rep2(i, 1, t.size()) {
            numer *= 2;
            numer += (t[i] == 'n' ? -1 : 1);
            denom *= 2;
        }

        numer *= 90;
        if (numer % denom == 0) {
            cout << numer / denom << endl;
        } else {
            int g = gcd(numer, denom);
            cout << numer / g << "/" << denom / g << endl;
        }
    }

}

Measured memory_bytes: 3080
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a,b,c,cnt=0;
    a=n%10;
    n/=10;
    b=n%10;
    n/=10;
    c=n;
    //cout<<a<<b<<c<<endl;
    if(a==1){
    cnt++;
}
    if(b==1)
        cnt++;
    if(c==1)
        cnt++;
    cout<<cnt<<endl;
    return 0;

}

Measured memory_bytes: 764
#include<stdio.h>
int main()
{
	int a[100][100];
	int b[100];
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i = 0;i<n;i++)
	{
		for(int j = 0;j<m;j++)
		{
			scanf("%d",&a[i][j]);
		}
	} 
	for(int i = 0;i<m;i++)
	{
		scanf("%d",&b[i]);
	}
	int c[100]={0};
	for(int i = 0;i<n;i++)
	{
		for(int j = 0;j<m;j++)
		{
			c[i]+=a[i][j]*b[j];
		}
	}
	for(int i = 0;i<n;i++)
	{
		printf("%d\n",c[i]);
	}
	return 0;
	
} 


Measured memory_bytes: 2712
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp setprecision
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e8;
const ll INF = 1e16;
const string alpha = "abcdefghijklmnopqrstuvwxyz";

const int MAX_N = 2e6;
ll fac[MAX_N+1], ifac[MAX_N+1], inv[MAX_N+1];

//mpow(x,n)で(x^n)をO(log(n))で計算
ll mpow(ll x, ll n){
    ll res = 1, now = x;
    while(n > 0){
        if(n%2 == 1) res *= now, res %= MOD;
        now *= now, now %= MOD;
        n /= 2;
    }
    return res;
}

//setcomb()でfac,ifac,invを全て計算
void setcomb(){
    rep2(i, 1, MAX_N){
        inv[i] = mpow(i, MOD-2);
    }
    //i!とi!の逆元
    fac[0] = 1, ifac[0] = 1;
    rep2(i, 1, MAX_N){
        fac[i] = (fac[i-1]*i) % MOD;
        ifac[i] = (ifac[i-1]*inv[i]) % MOD;
    }
}

//comb(n, k)でnCk
ll comb(int n, int k){
    ll c = fac[n];
    c *= ifac[n-k], c %= MOD;
    c *= ifac[k], c %= MOD;
    return c;
}

//perm(n, k)でnPk
ll perm(int n, int k){
    return(fac[n]*ifac[n-k])%MOD;
}

int main(){
    setcomb();
    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    //dp[i][j]:=すべてのグループの人数がi人以下になるようにj人を割り振る場合の数
    ll dp[B+1][N+1];
    fill(dp[0], dp[B+1], 0);
    rep(i, A){
        dp[i][0] = 1;
    }
    rep2(i, A, B){
        rep(j, N+1){
            dp[i][j] += dp[i-1][j];
        }
        //num[k]:=i*k人をi人ずつのk個のグループに分ける方法
        ll num[D+1];
        num[0] = 1;
        rep2(k, 1, D){
            num[k] = (num[k-1]*comb(i*k, i))%MOD;
            num[k] = (num[k]*inv[k])%MOD;
        }
        //i人のグループをk個使う
        rep2(k, C, D){
            if(i*k > N) break;
            rep2(j, i*k, N){
                ll tmp = (comb(j, i*k)*dp[i-1][j-i*k])%MOD;
                tmp = (tmp*num[k])%MOD;
                dp[i][j] = (dp[i][j]+tmp)%MOD;
            }
        }
    }
    cout << dp[B][N] << endl;
}

Measured memory_bytes: 54912
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
signed main(){
  init_io();
  string s;
  cin >> s;
  for(int i=0;i<3;i++){
    cout << s[i];
  }
  cout << endl;
}


Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
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; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  string s; 
  cin >> s;

  if(s[1] == 'B') cout << "ARC" << "\n";
  else cout << "ABC" << "\n";

  return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    int N;
    cin >> N;
    set<string> S;
    rep(i, N){
        string s;
        cin >> s;
        S.insert(s);
    }
    cout << (int)S.size() << endl;
    return 0;
}

Measured memory_bytes: 19120
import java.util.Scanner;

class Main{

    public static void main(String[] args){
        
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long r = scanner.nextLong();
        scanner.close();
        int count = 0;
        while(n>=r){
            count += 1;
            n = n/r;
        }
        System.out.println(count+1);
    }
}

Measured memory_bytes: 21972
#include<stdio.h>
main()
{
	double a,b,x,y;
	while(~scanf("%lf %lf %lf %lf",&a,&b,&x,&y))
	{
		if(a/2==x&&b/2==y)
			printf("%lf 1\n",a*b/2);
		else
		printf("%lf 0\n",a*b/2);
	}
	
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        System.out.print(reader.next().charAt(0));
        System.out.print(reader.next().charAt(1));
        System.out.print(reader.next().charAt(2));
        System.out.println();
    }

    // Read Class
    static class FS {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
    
        private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public int nextInt() {
            return (int)nextLong();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if(b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
    }
}



Measured memory_bytes: 20180
#define cross(a1, b1, a2, b2) ((a1)*(b2)-(a2)*(b1))
double a[4],b[4],c[4];main(i){for(;~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",a,b,a+1,b+1,a+2,b+2,a+3,b+3);){
	for(i=0;i<4;i++)c[i]=cross(a[(i+1)%4]-a[i],b[(i+1)%4]-b[i],a[(i+2)%4]-a[i],b[(i+2)%4]-b[i]);
	//printf("%.1lf,%.1lf %.1lf %.1lf %.1lf\n",a[1],c[0],c[1],c[2],c[3]);
	puts(c[0]*c[1]*c[2]*c[3]>0?"YES":"NO");
}exit(0);}

Measured memory_bytes: 608
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };

    let n: usize = sc.read();
    let mut a: Vec<usize> = sc.vec(n);
    a.sort();

    let amax = a.last().unwrap().clone();
    let mut mem: Vec<usize> = vec![0; amax + 1];

    for &i in &a {
        if mem[i] > 0 {
            mem[i] = 2;
            continue;
        }
        for j in (i..amax + 1).step_by(i) {
            mem[j] = mem[j] + 1;
        }
    }

    let mut ans = 0;
    for &i in &a {
        if mem[i] == 1 {
            ans = ans + 1;
        }
    }

    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int modpow(int a, int n, int m) {
  int res = 1;
  while (n) {
    if (n & 1) res = (ll)res * a % m;
    a = (ll)a * a % m;
    n >>= 1;
  }
  return res;
}

const int S = 100005;

string s;

mint dp[S][13];

int main() {
  cin >> s;
  rep(i, s.size()+1) rep(j, 13) dp[i][j] = 0;
  dp[0][0] = 1;
  rep(i, s.size()) rep(j, 13) rep(k, 10) {
    if (s[i] - '0' != k && s[i] != '?') continue;
    int l = (j + modpow(10, s.size() - i - 1, 13) * k) % 13;
    dp[i + 1][l] += dp[i][j];
  }
  cout << dp[s.size()][5] << endl;
  return 0;
}

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

int main() {
    int n;
    int a[200];
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a, a+n, greater<int>());
    int alice,bob = 0;
    for(int i=0;i<n;i++){
        if(i%2 == 0){
            alice += a[i];
        }else{
            bob += a[i];
        }
    }
    cout << alice - bob << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

static const int N = 100;
static const int M = 21000;
static const int INF = N * M + 1;
vector<P> adj[N];
int a[M], b[M], c[M];
int n, mat[N][N], p[N][N];

void dijkstra(int s){
    bool reached[n];
    priority_queue<P> PQ;
    rep(i, n){
        reached[i] = false;
        mat[s][i] = INF;
    }
    mat[s][s] = 0;
    p[s][s] = -1;
    PQ.push(make_pair(-mat[s][s], s));

    while(!PQ.empty()){
        P f = PQ.top(); PQ.pop();
        int u = f.second;
        reached[u] = true;
        if(-f.first > mat[s][u]) continue;

        rep(i, adj[u].size()){
            int v = adj[u][i].first;
            if(reached[v]) continue;
            if(mat[s][u] + adj[u][i].second < mat[s][v]){
                mat[s][v] = mat[s][u] + adj[u][i].second;
                p[s][v] = u;
                PQ.push(make_pair(-mat[s][v], v));
            }
        }
    }
    return;
}

int main(){
    int m;
    cin >> n >> m;
    rep(i, m){
        cin >> a[i] >> b[i] >> c[i];
        a[i]--, b[i]--;
        adj[a[i]].push_back(make_pair(b[i], c[i]));
        adj[b[i]].push_back(make_pair(a[i], c[i]));
    }

    rep(i, n) dijkstra(i);

    int ans = m;
    rep(i, m){
        bool used = false;
        rep(j, n){
            if(mat[j][a[i]] + c[i] == mat[j][b[i]]) used = true;
            //if(p[j][a[i]] == b[i] || p[j][b[i]] == a[i]) used = true;
        }
        if(used) ans--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
fun main(args:Array<String>) {
  val (c500s, c100s, c50s, N) = (0..3).map{ readLine()!!.toInt() }
  var count = 0
  for( c500 in (0..c500s) ) {
    for( c100 in (0..c100s) ) {
      for( c50 in (0..c50s) ) {
        if( c500*500 + c100*100 + c50*50 == N )
          count++
      }
    }
  }
  println(count)
}

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

int main() {
	int n, k, q;
	cin >> n >> k >> q;
	vector<int> a(q);
	rep(i, q) cin >> a[i];
	vector<int> ans(n, k);
	rep(i, q) {
		ans[a[i] - 1]++;
	}
	rep(i, n) ans[i] -= q;
	rep(i, n) {
		if (ans[i] > 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 1408
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB emplace_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("[DEBUG] ");W(__VA_ARGS__);}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1<<20;
LL fac[SIZE],inv[SIZE];
LL mypow(LL x,LL y){
    LL res=1;
    while(y){
        if(y&1)res=res*x%MOD;
        y>>=1;
        x=x*x%MOD;
    }
    return res;
}
LL C(int x,int y){
    if(y<0||y>x)return 0;
    return fac[x]*inv[y]%MOD*inv[x-y]%MOD;
}
void build(){
    assert(MOD>=SIZE);
    fac[0]=1;
    REPP(i,1,SIZE)fac[i]=fac[i-1]*i%MOD;
    inv[SIZE-1]=mypow(fac[SIZE-1],MOD-2);
    for(int i=SIZE-2;i>=0;i--)inv[i]=inv[i+1]*(i+1)%MOD;
}
LL s;
void solve() {
    LL an=0;
    FOR(i,1,s/3){
        ADD(an,C(s-3*i+i-1,i-1));
    }
    W(an);
}
void input() {
    R(s);
}
int main(){
#define MULTITEST 0
#if MULTITEST    
    CASET
#endif
    {
        build();
        input();
        solve();
    }
    return 0;
}


Measured memory_bytes: 20020
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();
		int b = sc.nextInt();

		if(a >= 1){
			System.out.println("Positive");
		}
		else if(a <= 0 && b >= 0){
			System.out.println("Zero");
		}
		else{
			System.out.println((Math.min(0, b) - a) % 2 == 1 ? "Positive" : "Negative");
		}
	}

}


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

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ll a, b, x;
	while(scanf("%lld %lld %lld", &a, &b, &x) != EOF)
	{
		ll count = 0;
		count += (b/x) - (a/x);
		if (a%x==0)
			count++;
		printf("%lld\n", count);
	}
	return 0;
}


Measured memory_bytes: 3796
#include <bits/stdc++.h>
        //#include <ttmath.h>
        #define endl '\n'
        #define modulo 998244353
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI 3.141592653589793238462643
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x,int y,int m)
        {
        int temp;
        if(y == 0)
        return 1;
        temp = (power(x, y/2,m))%m;
        if (y%2 == 0)
        return ((temp%m)*temp);
        else
        return ((x*temp%m)*temp%m)%m;
        }
        int inv(int x)
        {
        return (power(x,modulo-2,modulo))%modulo;
        }
        //#include "testlib.h"
        /*int main(int argc, char* argv[])
        {
        iostream::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        registerGen(argc, argv, 1);
        int n,k;
        n=rnd.next(1,50);
        k=rnd.next(1,n);
        cout<<n<<' '<<k;
        }*/
        ///Solution created by:Ahmadsm2005
        bool comp(int a,int b)
        {
            return a>b;
        }
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input0.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n,m;
            cin>>n>>m;
            if(n==1||m==1){
            cout<<1;
            exit(0);
            }
            int result=n*m;
            result/=2;
            if(abs(n%2-m%2))
            cout<<result;
            else if(n%2)
            cout<<result+1;
            else
            cout<<result;
            return 0;
        }


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#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 fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z main.cpp
//.\a.exe

int main(void){ios::sync_with_stdio(false);cin.tie(0);
////////////////////////////////////////////////////////
int ans=0;
string s,t;
cin >> s >> t;
if(s[0]==t[0]){
   ans++;
}
if(s[1]==t[1]){
   ans++;
}
if(s[2]==t[2]){
   ans++;
}
cout << ans << endl;
////////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rfor(i,a,b) for(ll (i) = (a); (i) > (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(a) cout << (a) << endl;
#define all(x) (x).begin(),(x).end()

ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    for (ll d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}

int main()
{
    ll n,ans = 1;
    vector<ll> cnt(1000,0);
    cin >> n;
    rep1(i, n){
        ll x = i;
        for (ll j = 2; j <= x; ++j) {
            while (x % j == 0) {
                ++cnt[j];
                x /= j;
            }
        }
    }
    rep1(i,cnt.size())ans = ans * (cnt[i] + 1) % mod;
    pf(ans)
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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 namespace std;

int main(){
    Init();
    ll h, w, n;
    cin >> h >> w >> n;
    cout << (ll)(ceil)(1.0*n/max(h, w)) << endl;
}

Measured memory_bytes: 3672
void main(){
	int l, r, d;
	readf("%d %d %d\n", &l, &r, &d);
	int cnt;
	foreach(i; l..r+1){
		if(i%d==0)cnt++;
	}
	cnt.writeln();
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}


Measured memory_bytes: 2772
using System;

class MainClass
{
    public static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine();
        var t = "ABC";

        var ans = 0;
        for (int i = 0; i < s.Length; i++)
        {
            var count = 0;
            for (int j = 0; j < t.Length && i + j < s.Length; j++)
            {
                if (s[i + j] == t[j])
                {
                    count++;
                }
                else
                {
                    break;
                }
            }
            if (count == t.Length) ans++;
        }

        Console.WriteLine(ans);
    }
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

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

  int amari = N % 1000;
  if (amari == 0) cout << 0;
  else cout << 1000 - amari;
  return 0;
}


Measured memory_bytes: 3668
n = int(input())
lst = [[0,0,0]]
for i in range(n):
    l = list(map(int,input().split()))
    lst.append(l)
flg = True
for i in range(1,n+1):
    t = lst[i][0] - lst[i-1][0]
    dst = (abs(lst[i][1] - lst[i-1][1])) + (abs(lst[i][2] - lst[i-1][2]))
    if dst > t or dst%2 != t%2:
        flg = False
        break

if flg:
    print('Yes')
else:
    print('No')

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

int main(){

  int d;
  cin >> d;
  
  if ( d == 22) cout <<"Christmas Eve Eve Eve" << endl;
  else if ( d == 23) cout <<"Christmas Eve Eve" << endl;
  else if ( d == 24) cout <<"Christmas Eve" << endl;
  else  if ( d == 25) cout <<"Christmas" << endl;
  return 0;
}


Measured memory_bytes: 256
class Dice():
    def __init__(self, numbers):
        self.numbers = numbers
        S = [1, 5, 2, 3, 0, 4]
        N = [4, 0, 2, 3, 5, 1]
        W = [3, 1, 0, 5, 4, 2]
        E = [2, 1, 5, 0, 4, 3]
        self.tumble = {'S': S, 'N': N, 'W': W, 'E': E}
        
    def rol(self, command):
        prev = self.numbers.copy()
        for i, t in enumerate(self.tumble[command]):
            self.numbers[t] = prev[i]

numbers = list(map(int, input().split()))
commands = input()

dice = Dice(numbers)
for c in commands:
    dice.rol(c)
print(dice.numbers[0])


Measured memory_bytes: 5600
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        char[] s1 = inp.next().toCharArray();
        char[] s2 = inp.next().toCharArray();
        char[] s3 = inp.next().toCharArray();
        System.out.println(s1[0] + "" + s2[1] + "" + s3[2]);
        inp.close();
    }
}


Measured memory_bytes: 21204
// atcoder/abc171/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  int n, k;
  while (cin >> n >> k) {
    vec<lli> a(n);
    cin >> a;
    sort(a.begin(), a.end());
    lli sum = 0;
    for (int i = 0; i < k; ++i) {
      sum += a[i];
    }
    cout << sum << endl;
  }

  return 0;
}


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

int main() {
  int N;
  cin >> N;
  int ans;
  ans = N % 10;
  if(ans==2||ans==4||ans==5||ans==7||ans==9){
    cout << "hon" <<endl;
  }
  else if(ans==0||ans==1||ans==6||ans==8){
    cout << "pon" << endl;
  }
  else{
    cout << "bon" <<endl;
  }

}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <map>
#include <algorithm>
#include <stdio.h>
#include <set>
#include <cmath>
#include <queue>

typedef long long ll;

using namespace std;


int main(){
    int n, X, Y;

    cin >> n >> X >> Y;
    vector<int> v;
    for(int i = 0; i < n - 1; i++){
        v.push_back(0);
    }


    for(int i = 1; i < n; i++){
        queue<pair<int, int>> que;
        vector<int> ch_p;
        for(int j = 0; j < n; j++){
            ch_p.push_back(0);
        }
        int p = i;
        que.push(make_pair(p, 0));

        while(1){
           if(p != n){
               if(ch_p[p] == 0){
                 ch_p[p] = 1;
                 if(i < p + 1) v[que.front().second]++;
                 que.push(make_pair(p + 1, que.front().second + 1));
               }
           }
           if(p != 1){
               if(ch_p[p - 2] == 0){
                   ch_p[p - 2] = 1;
                   if(i < p - 1) v[que.front().second]++;
                   que.push(make_pair(p - 1, que.front().second + 1));
               }
           }
           if(p == X){
               if(ch_p[Y - 1] == 0){
                   ch_p[Y - 1] = 1;
                   if(i < Y) v[que.front().second]++;
                   que.push(make_pair(Y, que.front().second + 1));
               }
           }
           if(p == Y){
               if(ch_p[X - 1] == 0){
                   ch_p[X - 1] = 1;
                   if(i < X) v[que.front().second]++;
                   que.push(make_pair(X, que.front().second + 1));
               }
           }
           que.pop();
           if(que.size() == 0) break;
           p = que.front().first;
        }
    }

    for(int i = 0; i < n - 1; i++){
         cout << v[i] << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	char X[3005]={'\0'},Y[3005]={'\0'};
	ll m,n,i,j,k=0;
	cin>>X;
	cin>>Y;
	m=strlen(X);
	n=strlen(Y);
	ll L[m+1][n+1];
        for (i = 0; i <= m; i++)  
    	{  
        	for (j = 0; j <= n; j++)  
        	{  
        		if (i == 0 || j == 0)  
			{
				L[i][j] = 0;  
			}
        		else if (X[i - 1] == Y[j - 1])  
			{	
				L[i][j] = L[i - 1][j - 1] + 1;  
			}
     			else
			{
				L[i][j] = max(L[i - 1][j], L[i][j - 1]);  
        		}
		}
	}		
	i=m;
	j=n;
	char str[3005]={'\0'};
	while(i>0 && j>0)
	{
		if(X[i-1]==Y[j-1])
		{
			str[k]=X[i-1];
			k++;
			i--;
			j--;
		}
		else if(L[i-1][j]>L[i][j-1])
		{
			i--;
		}
		else
		{
			j--;
		}
	}
	ll l=0,r=k-1;
	char c;
	while(r>l)
	{
		c=str[l];
		str[l]=str[r];
		str[r]=c;
		l++;
		r--;
	}
	cout<<str<<"\n";
	return 0;
}



Measured memory_bytes: 70656
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(){
    int k; cin >> k;
    string s; cin >> s;
    if(s.size()>k){
        rep(i,k) cout << s[i];
        cout << "..." << endl;
    }
    else cout << s << endl;
}

Measured memory_bytes: 3604
module JSC2019

  ! <module>s to import
  use, intrinsic :: iso_fortran_env

  ! require all variables to be explicitly declared
  implicit none

  ! accessibility of <subroutine>s and <function>s in this <module>
  public :: task_A

  ! contained <subroutine>s and <function>s are below
  contains

  subroutine task_A

    ! variables for this <subroutine>
    integer(INT32) :: digit01
    integer(INT32) :: digit10
    integer(INT32) :: num_days_per_month
    integer(INT32) :: num_days_product
    integer(INT32) :: num_months_per_year

    ! support variables for this <subroutine>
    integer(INT32) :: itr_day
    integer(INT32) :: itr_month

    ! STEP.01
    ! read the given data
    read(unit=INPUT_UNIT, fmt=*) num_months_per_year, num_days_per_month

    ! STEP.02
    ! initialize the variables for this <subroutine>
    num_days_product = 0_INT32

    ! STEP.03
    ! count up the number of "product days"
    do itr_day = 10_INT32, num_days_per_month,  1_INT32

      digit01 = mod(itr_day, 10_INT32)
      digit10 = (itr_day - digit01) / 10_INT32

      if (digit01 .ge. 2_INT32 .and. digit10 .ge. 2_INT32 .and. digit01 * digit10 .le. num_months_per_year) then
        num_days_product = num_days_product + 1_INT32
      end if

    end do

    ! STEP.04
    ! output the answer of this task
    write(unit=OUTPUT_UNIT, fmt='(I0)', advance='yes') num_days_product

    ! STEP.END
    return

  end subroutine task_A

end module JSC2019


program main

  ! <module>s to import
  use, non_intrinsic :: JSC2019

  ! require all variables to be explicitly declared
  implicit none

  call task_A

end program main

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


int main(){

  int a,b,c;
  
  cin>>a>>b>>c;
  
  cout<<max(0,c-(a-b))<<endl;
}


Measured memory_bytes: 256
use std::vec::Vec;
use std::cmp::*;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let a: Vec<usize> = read_vec();
    let mut res = vec![0; n+1];

    for i in (1..n+1).rev() {
      let mut sum = 0;
      for j in 2..n+1 {
        let count = i * j;
        if count > n {  break; }
        sum += res[count];
      }

      res[i] = if sum % 2 == a[i - 1] {
      //  println!("sum = {}, a[{}] = {}", sum,i-1, a[i-1]);
        0
      } else {
        1
      };
        //println!("{:?}", res);
    }

    let mut count = 0;
    for i in 1..n+1 {
      if res[i] == 1 {
        count += 1;
      }
    }

    if count == 0 {
      println!("{}", count);
      return;
    } else {
      println!("{}", count);
    }

    for i in 1..n+1 {
      if res[i] == 1 {
          print!("{} ", i);
      }
    }
    println!("");
}


Measured memory_bytes: 9208