akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int w;
	string s;
	cin >> s>> w;
	int n=sz(s);
	rep(i,n) if(i%w==0) cout << s[i];
	cout <<"\n";
	
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  int A=N/1000, B=N/100-10*A, C=N/10-100*A-10*B, D=N-1000*A-100*B-10*C;

  if ((A==B && B==C) || (B==C&&C==D)) {
    cout << "Yes" << endl;
  }
  else {
  cout << "No" << endl;
}
}

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

int main(){
  long n,m,a,r,c,h;
  m=0;a=0;r=0;c=0;h=0;
  cin>>n;
  string s;
  rep(i,n){
    cin>>s;
    if(s[0]=='M')m++;
    if(s[0]=='A')a++;
    if(s[0]=='R')r++;
    if(s[0]=='C')c++;
    if(s[0]=='H')h++;
  }
  
  cout<<m*a*(r+c+h) + m*r*(c+h) + m*c*h + a*r*(c+h) + a*c*h + r*c*h<<endl;
}


Measured memory_bytes: 256
/*
 *  * main.cpp
 *   *
 *    */

#include<bits/stdc++.h>
using namespace std;

int A[300000];
int main() {

    int N, K, R, S, P;
    char T[100005];
    char c[100005];

    scanf("%d %d %d %d %d", &N, &K, &R, &S, &P);
    scanf("%s", T);
    long long res = 0;
    for (int i = 0; i < N; ++i) {
        char r;
        if (T[i] == 'r') r = 'p';
        else if (T[i] == 's') r = 'r';
        else r = 's';

        if (i < K || T[i] != T[i - K] || r != c[i - K]) {
            if (T[i] == 'r') res += P, c[i] = 'p';
            else if (T[i] == 's') res += R, c[i] = 'r';
            else res += S, c[i] = 's';
        } else c[i] = T[i];
        
    }

    printf("%lld\n", res);
    return 0;
}


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

using namespace std;
const long long MOD=1e9+7;
long long fanc[1000009], ifanc[1000009];

long long modpow(long long a, long long n, long long mod){
  long long ret = 1;
  while(n>0){
    if(n&1)ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}

long long modinv(long long a, long long mod){
  return modpow(a, mod-2, mod);
}

long long combination(long long n, long long m, long long mod){
  long long ret=1;
  ret = (ret*fanc[n])%mod;
  ret = (ret*ifanc[m])%mod;
  ret = (ret*ifanc[n-m])%mod;
  return ret;
}

long long permitation(long long n, long long m, long long mod){
  long long ret=1;
  ret = (ret*fanc[n])%mod;
  ret = (ret*ifanc[n-m])%mod;
  return ret;
}


int main(){
  int n, m;
  cin >> n >> m;
  long long ans=0;
  fanc[0]=1;
  ifanc[0]=1;
  for(int i=1;i<=n+m;i++){
    fanc[i]=(i*fanc[i-1])%MOD;
    ifanc[i]=modinv(fanc[i], MOD);
  }
  for(int i=0;i<=n;i++){
    long long add=1;
    add = (add*combination(n, i, MOD))%MOD;
    add = (add*permitation(m, i, MOD))%MOD;
    add = (add*permitation(m-i, n-i, MOD))%MOD;
    add = (add*permitation(m-i, n-i, MOD))%MOD;
    ans = (ans + (i%2==0?add:-add)+MOD)%MOD;
  }
  cout << ans << endl;
}



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

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

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

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

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n, d;
    cin >> n >> d;
    vector<vector<double>> cr(n, vector<double>(d, 0));
    for(int i = 0; i < n; i++){
        for(auto &x : cr[i]){
            cin >> x;
        }
    }
    int ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            function<int(int, int)> check = [&](int x, int y){
                double sum = 0;
                for(int i = 0; i < d; i++){
                    sum += (cr[x][i] - cr[y][i]) * (cr[x][i] - cr[y][i]);
                }
                double dist = sqrtl(sum);
                if(ceil(dist) == floor(dist)){
                    return 1;        
                }
                return 0;
            };
            ans += (check(i, j));
        }
    }
    cout << ans;
    return 0;
}


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

int main(){
	int num[5],i,j,k,l,m,key,flag=0,count=0;
	
	while(scanf("%d,%d,%d,%d,%d",&num[0],&num[1],&num[2],&num[3],&num[4])!=EOF){
	
	for(i=0;i<5;i++){
		for(j=i;j<5;j++)if(num[i]==num[j] && i!=j){
			flag=1;
			count++;
		}
	}
	
	if(count==2)flag=2;
	
	for(i=0;i<5;i++){
		for(j=i;j<5;j++){
			if(num[i]==num[j] && i!=j){
				for(k=0;k<5;k++)if(i!=k && j!=k && num[i]==num[k] && num[j]==num[k])flag=3;
			}
		}
	}
	
	for(i=0;i<5;i++){
		for(j=i;j<5;j++){
			if(num[i]>num[j]){
				key=num[i];
				num[i]=num[j];
				num[j]=key;
			}
		}
	}
	if(num[0]==num[1]-1 && num[1]==num[2]-1 && num[2]==num[3]-1 && num[3]==num[4]-1 || num[0]==1 && num[1]==10 && num[2]==11 && num[3]==12 && num[4]==13)flag=4;
	
	for(i=0;i<5;i++){
		for(j=i;j<5;j++){
			if(num[i]==num[j] && i!=j){
				for(k=0;k<5;k++){
					if(i!=k && j!=k && num[i]==num[k] && num[j]==num[k]){
						for(l=0;l<5;l++){
							for(m=0;m<5;m++)if(num[l]==num[m] && l!=i && l!=j && l!=k && l!=m)flag=5;
						}
					}
				}
			}
		}
	}
	
	for(i=0;i<5;i++){
		for(j=i;j<5;j++){
			if(num[i]==num[j] && i!=j){
				for(k=0;k<5;k++){
					if(i!=k && j!=k && num[i]==num[k] && num[j]==num[k]){
						for(l=0;l<5;l++)if(i!=l && j!=l && k!=l && num[i]==num[l] && num[j]==num[l] && num[k]==num[l] )flag=6;
					}
				}
			}
		}
	}
	
	switch(flag){
	case 0:
		printf("null\n");
		break;
	case 1:
		printf("one pair\n");
		break;
	case 2:
		printf("two pair\n");
		break;
	case 3:
		printf("three card\n");
		break;
	case 4:
		printf("straight\n");
		break;
	case 5:
		printf("full house\n");
		break;
	case 6:
		printf("four card\n");
		break;
	}
		flag=0;
		count=0;
	}
return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
#define REP(i,x,n) for(int i = x; i < n; i++)
const int N = 1e5+10;
 
void solve(int n) {
    vector<int> a(n);
    REP(i, 0, n) cin >> a[i];
 
    using P = pair<int, int>;
 
    P dp[2][N];
    REP(i, 0, 2) REP(j, 0, N) dp[i][j] = P(-1000,0);
    dp[0][0] = P(0,0);
    REP(i, 0, n) {
        int tmp = a[i] % 1000;
        if (tmp == 0) tmp = 1000;
        REP(j, 0, N) dp[(i+1)&1][j] = P(-1000,0);
        REP(j, 0, 100001) {
            if (tmp <= 500) {
                if (j + 500 - tmp < N) dp[(i + 1) & 1][j + 500 - tmp] = max(dp[(i + 1) & 1][j + 500 - tmp], P(dp[i & 1][j].first+1,dp[i&1][j].second-a[i]));
            }
            else{
                if (j - (tmp - 500) >= 0) dp[(i + 1)&1][j - (tmp - 500)] = max(dp[(i + 1)&1][j - (tmp - 500)], P(dp[i & 1][j].first + 1, dp[i & 1][j].second - a[i]));
                if(j+1000-tmp < N) dp[(i + 1)&1][j + 1000 -tmp] = max(dp[(i + 1)&1][j + 1000 - tmp], P(dp[i & 1][j].first, dp[i & 1][j].second - a[i]));
            }
            dp[(i + 1) & 1][j] = max(dp[(i + 1) & 1][j], dp[i & 1][j]);
        }
    }
 
    P ans = P(0,0);
    REP(i, 0, N) ans = max(ans, dp[n&1][i]);
 
    cout << ans.first << " " << -ans.second << endl;
}
 
int main() {
    int n;
    while (cin >> n, n) {
        solve(n);
    }
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(vs) (ll)(vs.size())
#define rep(i,a,b) for (ll i = a; i < b; ++i)
#define rep_(i,a,b) for (ll i = a; i > b; --i)
#define endl '\n'
const ll mod = 1e9 + 7;

const ll maxn = 1e5;

string s, t;

// #include "debug.h"
void solve() {
	cin >> s >> t;
	int ns = s.size();
	int nt = t.size();
	int ans = INT_MAX;
	for (int i = 0; i <= ns - nt; ++i) {
		int this_ans = 0;
		for (int j = 0; j < nt; ++j) {
			this_ans += (t[j] != s[i + j]);
		}
		ans = min(ans, this_ans);
	}
	cout << ans << endl;
}

void aux() {
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cout<<fixed<<setprecision(10);
	aux();
	ll _ = 1;
	// cin>>_;
	while(_--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) {
  return '"' + s + '"';
}
string to_string(const char* s) {
  return to_string((string) s);
}
string to_string(bool b) {
  return (b ? "true" : "false");
}
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
const long long mod = 998244353; // CHECK
long long power(long long a, long long b, long long m = mod) {
    if(b < 0) {
        return power(power(a, -b), mod-2);
    }
    long long x = 1;
    while(b) {
        if(b & 1) {
            x = 1ll * x * a % m;
        }
        a = 1ll * a * a % m;
        b /= 2;
    }
    return x;
}
#define ll long long
const int INT_INF = 1e9+9;
const ll LL_INF = 2e18;
const int N = 3e5+9; // check N, mod

signed main() {  
    ios_base::sync_with_stdio(false); 
    cin.tie(0); cout.tie(0);
    
    int a, b, c, d; cin >> a >> b >> c >> d;
    vector<vector<ll>> f(c+1, vector<ll>(d+1));
    f[a][b] = 1;
    for (int i = a; i <= c; i++) {
        for (int j = b; j <= d; j++) {
            if (i == a && j == b) continue;
            f[i][j] = (f[i-1][j] * j % mod + f[i][j-1] * i % mod - 
                f[i-1][j-1] * (i-1) % mod * (j-1) % mod + mod) % mod;
        }
    }
    cout << f[c][d] << "\n";
    



    




    

    return 0;
}



Measured memory_bytes: 73684
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD 1000000007
#define P pair<ll, ll>


ll n, v[300000], w[300000];
vector<ll> dat[300000];
vector<P> r[300000];

bool solve(ll now, ll index, ll key) { //条件判定
    if (r[now][index].first <= key) return true; //ここに条件を入れる
    else return false;
}

ll nibutan(ll now, ll key = 0) { //ちゃろー！

    ll ng = r[now].size(); //最大値ならs.size()
    ll ok = -1; // 最大値なら0

    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if (solve(now, mid, key)) ok = mid;
        else ng = mid;
    }
    return ok; //満たさない最大ならng
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    REP(i, n){
        cin >> v[i] >> w[i];
    }
    REP(i, min(n, 1023ll)){
        if(i == 0){
            r[i].push_back(P(0, 0));
            r[i].push_back(P(w[i], v[i]));
        }
        else{
            ll p = (i - 1) / 2;
            REP(j, r[p].size()){
                P now = r[p][j];
                r[i].push_back(P(now.first, now.second));
                if(now.first + w[i] <= 100010) r[i].push_back(P(now.first + w[i], now.second + v[i]));
            }
            sort(ALL(r[i]));
        }
        REP(j, r[i].size()){
            dat[i].resize(r[i].size() + 1);
            dat[i][j] = max(dat[i][j], r[i][j].second);
            dat[i][j + 1] = dat[i][j];
            //cout << i << " " << j << " " << r[i][j].second << endl;
        }
    }
    ll q;
    cin >> q;
    REP(qq, q){
        ll a, l;
        cin >> a >> l;
        a--;
        ll ans = 0;
        if(a < 1023){
            ll pos = nibutan(a, l);
            //cout << a << " "<<  pos << " " << dat[a][pos] << " !" << endl;
            ans = max(ans, dat[a][pos]);
        }
        else{
            vector<P> s;
            ll now = a;
            while(1){
                s.push_back(P(w[now], v[now]));
                now = (now - 1) / 2;
                if (now < 1023) break;
            }
            ll ns = s.size();
            REP(i, 1 << ns){
                ll nl = 0, nv = 0;
                REP(j, ns){
                    if(i & (1 << j)) {
                        nl += s[j].first;
                        nv += s[j].second;
                    }
                }
                if (nl > l) continue;
                ll pos = nibutan(now, l - nl);
                ans = max(ans, dat[now][pos] + nv);
            }
        }
        cout << ans << "\n";
    }
}


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

int main() {
  int height, width;
  cin >> height >> width;
  vector<string> strings(height);
  for (int i = 0; i < height; i++) {
    cin >> strings[i];
  }

  string top(width + 2, '#');
  cout << top << endl;
  for (auto orig_str : strings) {
    string str = "#";
    str += orig_str;
    str += "#";
    cout << str << endl;
  }
  cout << top << endl;
}


Measured memory_bytes: 256
let prim a n =
  let min_costs = Array.make n max_int in
  min_costs.(0) <- 0;
  let reached_p = Array.make n false in
  let z = Array.make n (-1) in
  let rec doit () =
    let u =
      Array.fold_left (fun (i, m, u) p ->
        if not p && min_costs.(i) < m then (i + 1, min_costs.(i), i)
        else (i + 1, m, u))
        (0, max_int, (-1)) reached_p
      |> (fun (_, _, u) -> u) in
    if u = (-1) then ()
    else begin
      reached_p.(u) <- true;
      Array.iteri (fun j p ->
        if a.(u).(j) <> (-1) && not p && min_costs.(j) > a.(u).(j) then begin
          min_costs.(j) <- a.(u).(j);
          z.(j) <- u;
        end) reached_p;
      doit ()
    end in
  doit ();
  Array.fold_left (fun (j, sum) i ->
    (j + 1, if i = (-1) then sum else sum + a.(i).(j)))
    (0, 0) z
  |> snd

let () =
  let n = read_int () in
  let a = Array.make_matrix n n 0 in
  for i = 0 to n - 1 do
    for j = 0 to n - 1 do
      a.(i).(j) <- Scanf.scanf " %d" (fun x -> x);
    done
  done;
  prim a n |> Printf.printf "%d\n"

Measured memory_bytes: 4488
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n,i; cin>>n>>i;
    cout<<n-i+1<<endl;
    return 0;
}


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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, A: int, B: int, S: str):
    at = 0
    bt = 0
    for s in list(S):
        if s == "c":
            print(NO)
            continue
        if at + bt < A + B:
            if s == "a":
                print(YES)
                at += 1
            elif s == "b" and bt < B:
                print(YES)
                bt += 1
            else:
                print(NO)
        else:
            print(NO)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 79380
#include<iostream> 
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
#define INT_MAX 2147483647
#define _LIBCPP_DEBUG 0
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (n); ++i)	
using namespace std;


int max(int a,int b) {
	int max;
	if (a > b) max = a;
	else max = b;
	return max;
}
int min(int a, int b) {
	int min;
	if (a < b) min = a;
	else min = b;
	return min;
}


int main() {
	string s;
	int ans = -1;
	
	cin >> s;
	bool res = false;
	bool res2 = false;
	int length_end = 0;
	int length_top = 0;
	rep(i, s.size()) {
		if (s[i] == 'A' && !res) {
			res = true;
			length_top = i;
		}
		if (s[s.size() - 1 - i] == 'Z' && !res2) {
			length_end = s.size() - i;
			res2 = true;
		}
	}
	cout << length_end - length_top<< endl;
}

Measured memory_bytes: 640
using System;

public static class Solution
{
  public static void Main()
  {
    int n = int.Parse(Console.ReadLine());
    // index 0: AC, index 1: WA, index 2: TLE, index 3: RE
    var arr = new int[4];
    for (int i = 0; i < n; i++)
    {
      string s = Console.ReadLine();
      if (s == "AC") arr[0]++;
      else if (s == "WA") arr[1]++;
      else if (s == "TLE") arr[2]++;
      else if (s == "RE") arr[3]++;
    }
    Console.WriteLine($"AC x {arr[0]}");
    Console.WriteLine($"WA x {arr[1]}");
    Console.WriteLine($"TLE x {arr[2]}");
    Console.WriteLine($"RE x {arr[3]}");
  }
}


Measured memory_bytes: 30348
a, b, c = map(int, input().split())
dat = [a,b,c]
dat.sort()
a,b,c = dat
# cが一番長い
#print(a,b,c)
if a%2 == 0 or b%2 == 0 or c%2 == 0:
    print(0)
else:
    print(a*b)

Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
	long long int N, K, Q;
	scanf("%ld %ld %ld", &N, &K, &Q);
	
	int A[Q];
	int B[N];
	int k;
	int n;
	
	for(k=0; k<N; k++) B[k] = 0;
			
	for(k=0; k<Q; k++){
		scanf("%ld", &A[k]);
		n = A[k];
		B[n-1]++;
	}
	
	for(k=0; k<N; k++){
		if(B[k] > Q - K) printf("Yes\n");
		else printf("No\n");
	}
		
	
	return 0;
}

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

int main(){
int n,k;
  cin>>k;
string s;
  cin>>s;
  n=s.size();
  if(n<=k){
cout<<s<<endl;}
  else{
  string result=s.substr(0,k);
    result+="...";
    cout<<result<<endl;
  }
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <sstream>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <functional>
#include <utility>
#include <stdio.h>
#define ll long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define F first
#define S second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
int n,m;
int main()
{
	cin >>n>>m;
	if (abs(n-m)%2) cout <<"IMPOSSIBLE";
	else cout <<(n+m)/2;
	return 0;
} 

Measured memory_bytes: 764
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

// #include <iomanip>
//  cout << fixed << setprecision(15) << y << endl;

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll ltmp;
string stmp;
double dtmp;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> A;
    cin >> B;

    cout << (A*3+B)/2 << endl;
    

}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define FASTIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define inf 1e18
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define mod 1000000007
#define pb push_back
#define all(s) s.begin(),s.end()
#define pie 3.14159265358979323846
#define fr(i,a,b)  for(ll i=a;i<b;i++)
#define frr(i,a,b) for(ll i=b-1;i>=a;i--)
#define gcd __gcd
#define con continue
#define pii pair<ll,ll>
signed main(){
    FASTIO;
    ll tt=1;
    //cin>>tt;
    while(tt--){
         string s1,s2;cin>>s1>>s2;
         ll fans=inf;
         for(ll i=0;i+s2.size()<=s1.size();i++){
            ll ans=0;
            string ss=s1.substr(i,s2.size());
            for(ll k=0;k<s2.size();k++){
               if(ss[k]!=s2[k])ans++;
            }
            fans=min(fans,ans);
         }
         cout<<fans<<"\n";
    }
}


Measured memory_bytes: 3612
import collections as col
import math as ma

MOD = 10**9 + 7
def inv(a): return pow(a, MOD-2, MOD)
def comb(n,r,MOD):
    ans = ma.factorial(n)%MOD * inv(ma.factorial(r)) * inv(ma.factorial(n-r))
    return ans%MOD

def prime(n):
    ans = []
    for i in range(2, int(n**0.5)+1):
        while not n%i: n //= i; ans.append(i)
    if n != 1: ans.append(n)
    return ans

n,m = map(int,input().split())
cnt = col.Counter(prime(m))

ans = 1
for key,val in cnt.items():
    ans *= comb(val + n-1, n-1, MOD)
    ans %= MOD
print(ans)



Measured memory_bytes: 112732
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

int BIT[200201];
inline void add(int A) {
	while (A <= 200200) {
		BIT[A]++;
		A += A & -A;
	}
}

inline int query(int A) {
	int kotae = 0;
	while (A > 0) {
		kotae += BIT[A];
		A -= A & -A;
	}
	return kotae;
}

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

	int N = getint();
	int K = getint();

	ll B[200001] = {}, C[200001] = {};
	rep(i, N) {
		int A = getint();
		B[i + 1] = B[i] + A - K;
		C[i + 1] = B[i + 1];
	}
	sort(B, B + N + 1);

	ll kotae = 0;
	int are = lower_bound(B, B + N + 1, 0) - B + 1;
	add(are);
	rep(i, N) {
		are = lower_bound(B, B + N + 1, C[i + 1]) - B + 1;
		kotae += query(are);
		add(are);
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define maxn 1000010
using namespace std;


long long n,k=5000000000000000LL;
char s[maxn];
int main(){
	cin>>s+1>>n;
	int tmp=0;
	while(s[tmp+1]=='1')
		tmp++;
	if(n<=tmp)
		cout<<"1"<<endl;
	else
		cout<<s[tmp+1]<<endl;
	return 0;
}

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

int main(void){
    int k;
    string s;
    cin >> k;
    cin >> s;

    int i;

    if(s.size() > k){
            for(i=0; i<k; i++){
            cout << s[i];
        }
        cout << "..." << endl;
    }
    else{
        for(i=0; i<s.size(); i++){
            cout << s[i];
        }
        cout << endl;
    }

}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;


signed main(){
    int n; cin >> n;
    ll a[n];
    rep(i,n) cin >> a[i];
    if(n%2==0){
        ll l[n/2+1],r[n/2+1];
        l[0]=r[0]=0;
        for(int i=0;2*i<n;i++){
            l[i+1]=l[i]+a[2*i];
            r[i+1]=r[i]+a[n-1-(2*i)];
        }
        ll ans=l[n/2];
        rep(i,n/2+1){
            chmax(ans,l[i]+r[n/2-i]);
        }
        cout << ans << endl;
    }else{
        ll dp[n][3];
        dp[0][0]=0; dp[0][1]=a[0];
        rep(i,n-1){
            if(i==0){
                dp[1][0]=dp[0][0];
                dp[1][1]=dp[0][0]+a[1];
                dp[1][2]=dp[0][1];
            }
            else if(i%2==0){
                dp[i+1][0]=max(dp[i][0],dp[i][1]);
                dp[i+1][1]=dp[i][1]+a[i+1];
                dp[i+1][2]=dp[i][2];
            }else{
                dp[i+1][0]=dp[i][0]+a[i+1];
                dp[i+1][1]=max(dp[i][1],dp[i][2]);
                dp[i+1][2]=dp[i][2]+a[i+1];
            }
        }
        cout << max(dp[n-1][0],dp[n-1][1]) << endl;
    }
}


Measured memory_bytes: 9876
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    string s;cin >> s;
    if(s == "Sunny") cout << "Cloudy" <<endl;
    else if(s == "Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.swing.text.Segment;

public class Main {

	public static void main(String[] args) throws IOException {
		try (Scanner sc = new Scanner(System.in)) {
			final int N = sc.nextInt();
			
			long l_fst = 2;
			long l_snd = 1;
			if(N == 1){ System.out.println(l_snd); return; }
			for(int i = 2; i <= N; i++){
				final long tmp = l_snd;
				l_snd = l_fst + l_snd;
				l_fst=  tmp;
			}
			
			System.out.println(l_snd);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 21204
#include <stdio.h>

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main() {
  int number_of_char[3];
  scanf("%d %d %d", &number_of_char[0], &number_of_char[1], &number_of_char[2]);
  qsort(number_of_char, 3, sizeof(int), asc);
  if(number_of_char[0] == 5 && number_of_char[1] == 5 && number_of_char[2] == 7) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}


Measured memory_bytes: 128
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

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

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

//-----------------------ここから-----------


int main(void){
    int k;
    cin >> k;

    if(k % 2 == 0){
        cout << (k / 2) * (k / 2) << endl;; 
    } else {
        cout << (k / 2) * ((k / 2) + 1) << endl;
    }
    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int alp[26] = {0};
    string s;
    std::cin >> s;
    for (size_t i = 0; i < s.length(); i++) {
        alp[s[i] - 'a']++;
    }
    for (size_t i = 0; i < 26; i++) {
        if (alp[i]%2) {
            std::cout << "No" << std::endl;
            return 0;
        }
    }
    std::cout << "Yes" << std::endl;
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main()
{
    int n, m, c, a[100][100], b[100];
    cin >> n >> m >> c;
    for(int j = 0; j < m; j++)
    {
        cin >> b[j];
    }

    int k = 0;
    for(int i = 0; i < n; i++)
    {
        int s = 0;
        for(int j = 0; j < m; j++)
        {
            cin >> a[i][j];
            s = s + a[i][j] * b[j];
        }
        if(s + c > 0)
            k++;
    }
    cout << k;
    return 0;

}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFLL = LLONG_MAX / 3;
const double eps = (1e-9);


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

  ll x; cin >> x;
  ll sum = 0;
  for (ll i = 0; i <= x; i++) {
    if ((i * (i+1)>>1) >= x) {
      cout << i << endl;
      return 0;
    }
  }

  return 0;
}


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

#define rep(i,n,s) for(int i=s; i<n; i++)

using namespace std;

int main(){

    long int N; cin >> N;
    long int A[N+1],B[N]; 
    rep(i,N+1,0) cin >> A[i];
    rep(i,N,0) cin >> B[i];

    long int sum = 0;
    rep(i,N,0) {
        
        if (A[i]<B[i]) {
            sum += A[i];
            if (A[i+1]<abs(B[i]-A[i])) {
                sum += A[i+1];
                A[i+1] = 0;
            }
            else {
                sum += abs(B[i]-A[i]);
                A[i+1] = A[i+1] - abs(B[i]-A[i]);
            }
        }
        else {
            sum += B[i];
        }
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>

using namespace std;

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;

const int INF = INT_MAX / 4;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( ui i = (ui)( m ); i < (ui)( n ); i++ )
#define EACH( v, c ) for ( __typeof( c.front() ) &v : c )

#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define RALL( c ) (c).rbegin(), (c).rend()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

double powdist( double x1, double y1, double x2, double y2 )
{
	return pow( x1 - x2, 2 ) + pow( y1 - y2, 2 );
}

double dist( double x1, double y1, double x2, double y2 )
{
	return sqrt( pow( x1 - x2, 2 ) + pow( y1 - y2, 2 ) );
}

int main()
{
	while ( true )
	{
		int n;
		cin >> n;

		if ( n == 0 )
		{
			break;
		}

		vector<double> x( n ), y( n );

		REP( i, 0, n )
		{
			cin >> x[i] >> y[i];
		}

		int res = 1;

		REP( i, 0, n )
		{
			REP( j, i + 1, n )
			{
				if ( powdist( x[i], y[i], x[j], y[j] ) <= 4 )
				{
					double mx = ( x[i] + x[j] ) / 2, my = ( y[i] + y[j] ) / 2;
					double xl = sqrt( 1 - pow( dist( x[i], y[i], x[j], y[j] ) / 2, 2 ) );
					
					double ox1 = mx, oy1 = my, ox2 = mx, oy2 = my;

					if ( x[i] - x[j] == 0 )
					{
						oy1 += xl;
						oy2 -= xl;
					}
					else if ( y[i] - y[j] == 0 )
					{
						ox1 += xl;
						oy2 -= xl;
					}
					else
					{
						double s = -( ( x[j] - x[i] ) / ( y[j] - y[i] ) );
						double th = atan( s );
						
						ox1 = mx + xl * cos( th );
						oy1 = my + xl * sin( th );

						ox2 = mx - xl * cos( th );
						oy2 = my - xl * sin( th );
					}

					int tmp1 = 2, tmp2 = 2;

					REP( k, 0, n )
					{
						if ( i == k || j == k )
						{
							continue;
						}

						if ( powdist( x[k], y[k], ox1, oy1 ) <= 1 )
						{
							tmp1++;
						}

						if ( powdist( x[k], y[k], ox2, oy2 ) <= 1 )
						{
							tmp2++;
						}
					}

					res = max( res, max( tmp1, tmp2 ) );
				}
			}
		}

		cout << res << endl;
	}

	return 0;
}

Measured memory_bytes: 1328
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#define rep(i,l,r) for(int i=l;i<r;i++)

typedef long long ll;

ll min(ll a, ll b) { return a < b ? a : b; }

int main() {
    ll n, h[100000];
    scanf("%lld", &n);
    rep(i, 0, n) scanf("%lld", &h[i]);
    ll dp[100000];
    dp[0] = 0, dp[1] = labs(h[1] - h[0]);
    rep(i, 2, n) {
        dp[i] = min(dp[i - 1] + labs(h[i] - h[i - 1]), dp[i - 2] + labs(h[i] - h[i - 2]));
    }
    printf("%lld", dp[n - 1]);

    return 0;
}

Measured memory_bytes: 3664
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>

using namespace std;

int main(){
	vector<int> a(3,0);
	int cost=0;
	
	for(int i=0;i<3;i++){
		cin >> a[i];
	}
	
	if(a[0]==a[1] && a[1]==a[2]){
		cout << "0" << endl;
		return 0;
	}
	
	sort(a.begin(),a.end());
	
	int sa_min=a[2]-a[1];
	int sa_max=a[2]-a[0];
	
	if(sa_max%2!=0 && sa_min%2==0){
		sa_max++;
		cost++;
	}
	
	if(sa_max%2==0 && sa_min%2!=0){
		sa_min++;
		cost++;
	}
	
	if(sa_max%2==0 && sa_min%2==0){
		cost+=sa_max/2+sa_min/2;
		cout << cost << endl;
		return 0;
	}
	
	if(sa_max%2!=0 && sa_min%2!=0){
		cout << ((sa_max-sa_min)/2) + 1 << endl;
		return 0;
	}
		
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define P pair<long long, long long>
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const double PI = acos(-1.0);

const int dpsize = 1<<26;
vector<int> dp;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  string s; cin >> s;
  int n=s.size();
  vector<int> a(n);
  a[0] = 1<<(s[0] - 'a');
  for(int i=1; i<n; i++) {
    a[i] = a[i-1] ^ (1<<(s[i]-'a'));
  }

  dp.resize(dpsize);
  for(int i=0; i<dpsize; i++) {
    dp[i] = INT_MAX;
  }

  int opt;
  dp[0]=0;

  for(int i=0; i<n; i++) {
    int mi = dp[a[i]];
    for(int j=0; j<26; j++) {
      int x = 1<<j;
      chmin(mi, dp[x^a[i]]);
    }
    opt = mi+1;
    //debugln(opt[i]);
    chmin(dp[a[i]], opt);
  }

  cout << opt << endl;
}


Measured memory_bytes: 263572
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
  int unused __attribute__((unused));
  int i, j, N, L;
  char **S, *tmp;
  unused = scanf("%d %d", &N, &L);
  S = malloc(sizeof(char *)*N);
  for(i=0; i<N; i++){
    S[i] = malloc(sizeof(char)*(L+1));
    unused = scanf("%s", S[i]);
  }

  for(j=0; j<N-1; j++){
    for(i=0; i<N-1; i++){
      if(strcmp(S[i], S[i+1]) > 0){
        tmp = S[i];
        S[i] = S[i+1];
        S[i+1] = tmp;
      }
    }
  }
  for(i=0; i<N; i++){
    printf("%s", S[i]);
    free(S[i]);
  }
  free(S);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
#define fi first
#define se second
const ll inf = 9e18;
const ll mod = 1e9 + 7;

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

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

	ll x, a;
	cin>>x>>a;
	if(x<a){
		cout<<0;
	}
	else cout<<10;
	return 0;
}


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

#define rep(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a);i>(b);i--)
#define all(a) (a).begin(),(a).end()
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;

main(){
  string s; cin >> s;
  vi a(26);
  rep(i,s.size()) a[s[i]-'a']++;
  rep(i,26)
    if(!a[i]){
      cout << (char)(i+'a') << endl;
      return 0;
    }
  cout << "None\n";
    
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++) 
#define rep(i,n); for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b); 
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
#define pi pair<int,int>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e18+10;

/*----------------------------------------------*/
string check[]={"AA","AB","AX","AY","BA","BB","BX","BY","XA","XB","XX","XY","YA","YB","YX","YY"};
int dp[1001];

signed main(){
  int n;
  cin>>n;
  vi A(3*n);
  rep(i,3*n) cin>>A[i];
  sort(all(A),greater<int>());
  int ans=0;
  for(int i=1;i<2*n;i+=2){
    ans+=A[i];
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 2560
import Control.Monad
import Data.List

insertion s = isub 0 s s ""
    where isub lv orig "" pre = pre ++ orig ++ replicate lv ')'
          isub lv orig (c:cs) pre
              | lv==0 && c==')' = isub 0 orig cs ('(':pre)
              | c==')'          = isub (lv-1) orig cs pre
              | otherwise       = isub (lv+1) orig cs pre
              

main = getLine >>= const getLine >>= putStrLn . insertion

Measured memory_bytes: 508
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
int main(int argc, char const *argv[])
{
	int x,a;
	cin>>x>>a;
	if(x < a)
	{
		printf("0\n");
	}
	else
	{
		printf("10\n");
	}
	return 0;
}

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

using ll = long long;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll x;
  cin >> x;
  
  ll ans = x / 500 * 1000;
  x %= 500;
  ans += x / 5 * 5;
  
  cout << ans << '\n';
}

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

int main(){
    string s;
    while(cin >> s){
        int joi = 0, ioi = 0;
        for(int i = 0; i <= s.length()-3; i++){
            if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') joi++;
            if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') ioi++;
        }
        cout << joi << endl << ioi << endl;
    }
    return 0;
}


Measured memory_bytes: 3024