akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <math.h>
#include <bitset>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)
#define rep_r(i,s,n)for(ll i = n-1;i>s;i--)
#define rep_re(i,s,n)for(ll i = n-1;i>=s;i--)
ll MOD = 1e9 + 7;
//initial : call init_uf();
//unite x and y : p[uf(x)] = uf(y)
//same x and y : uf(x) == uf(y)
static const ll MAX_N = 100001;
ll p[MAX_N] = {};
map<ll, ll> num;
ll uf(ll i) { return (p[i] == i) ? i : p[i] = uf(p[i]); }
void init_uf() { rep(i, 1, MAX_N)p[i] = i; }

vector<vector<int>> f(100001);
vector<vector<int>> b(100001);
int main() {
	ll n, m, k; cin >> n >> m >> k;
	init_uf();
	rep(i, 0, m) {
		ll a, b; cin >> a >> b;
		f[a].push_back(b);
		f[b].push_back(a);

		p[uf(a)] = uf(b);
	}
	rep(i, 0, k) {
		ll c, d; cin >> c >> d;
		b[c].push_back(d);
		b[d].push_back(c);
	}

	repe(i, 1, n) {
		num[uf(i)]++;
	}
	repe(i, 1, n) {
		ll ans = num[uf(i)];

		rep(j, 0, f[i].size()) {
			if (uf(i) == uf(f[i][j]))ans--;
		}
		rep(j, 0, b[i].size()) {
			if (uf(i) == uf(b[i][j]))ans--;
		}

		cout << --ans << endl;
	}

	return 0;
}


Measured memory_bytes: 14720
def insertionSort(a, n):
  print " ".join(map(str, a))
  for i in xrange(1, n):
    v = a[i]
    j = i - 1
    # print "i = " + str(i) + ", j = " + str(j)
    while j >= 0 and v < a[j]:
      a[j + 1] = a[j]
      j -= 1
    a[j + 1] = v
    print " ".join(map(str, a))

n = int(raw_input())
a = map(int, raw_input().split(" "))
insertionSort(a, n)

Measured memory_bytes: 6432
#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define POW(n) ((n) * (n))
#define ALL(a) (a).begin(), (a).end()

using namespace std;

namespace Dump {
#define dump(...) Dump::print(#__VA_ARGS__, __VA_ARGS__)
static std::vector<string> dumpKey;
static string dumpKeyBuf;

void print() { cerr << endl; }
template <class Head, class... Tail> void print(Head &&head, Tail &&... tail) {
  if (dumpKey.empty()) {
    dumpKeyBuf = head;
    dumpKeyBuf.erase(std::remove_if(dumpKeyBuf.begin(), dumpKeyBuf.end(),
                                    [](char c) { return c == ' '; }),
                     dumpKeyBuf.end());

    std::istringstream stream(dumpKeyBuf);
    string field;
    while (std::getline(stream, field, ','))
      dumpKey.push_back(field);

    reverse(dumpKey.begin(), dumpKey.end());
  } else {
    cerr << dumpKey.back() << ":" << head << "  ";
    dumpKey.pop_back();
  }
  Dump::print(std::move(tail)...);
}
}

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<long long> vll;
typedef vector<unsigned long long> vull;
typedef pair<int, int> pii; // p.first p.second

// ll n = to_T<ll>("114514")
template <class T> T to_T(const string &s) {
  istringstream is(s);
  T res;
  is >> res;
  return res;
}
template <class T> string to_s(const T &a) {
  ostringstream os;
  os << a;
  return os.str();
}

void solve(long long M) {
  int ans = abs(48LL - M);
  cout << ans << endl;
}

int main() {
  ios::sync_with_stdio(false);
  long long M;
  cin >> M;
  solve(M);
  return 0;
}


Measured memory_bytes: 256
import math
x,k,d=map(int,input().split(" "))


if x<0:
  x=(-1)*x
if d<0:
  d=(-1)*d
  
s=math.floor(x/d)

if k<s:
  print(x-d*k)
else:
  w=k-s
  v=x-d*s
  if w%2==0:
    print(v)
  else:
    print(abs(v-d))
  

Measured memory_bytes: 9180
#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a>b){
		printf("a > b\n");
	}
	if(a<b){
		printf("a < b\n");
	}
	if(a==b){
		printf("a == b\n");
	}
	return 0;
}
	

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

using namespace std ;

int main ()
{
    int i = 0 ;
    string s ;

    cin >> s ;

    for (i ; i < s.size() ; i++)
    {
        if (s[i] == ','){
            s[i] = ' ';
        }
    }
    cout << s ;
}


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

#define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PER(j,n,a) for (int j=n-1;j>=a;j--)
#define REP(i,a,n) for (int i=a;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define show(x) cout<<(x)<<endl
#define UM unordered_map
#define PB push_back
#define V vector
#define EPS 1e-8
typedef unsigned long ul;
typedef long long ll;
typedef string str;
/*FIN*/
const ll maxn = 2e5;
ll n,l,lo,hi,mid,k;
V<ll> a(maxn);

bool can(ll x) {
	ll left = k;
	REP(i,0,n) {
		if(a[i] > x) {
			if(left <= 0) return 0;
			left -= floor(a[i] / x);
		}
	}
	return (left>=0);
}

int main() {
	FAST;
	cin>>n>>k;
	hi = 0;
	REP(i,0,n) {
		cin>>a[i];
		hi=max(hi,a[i]);
	}

	lo = 1;
	while(lo < hi) {
		mid=lo+((hi-lo)>>1);
		if(can(mid)) hi=mid;
		else lo=mid+1;
	}
	show(lo);
	return 0;
}



Measured memory_bytes: 4664
n = int(input())
a = list(map(int, input().split()))

mod = 10**9+7
tmp = sum(a)
d = []
for i in range(n-1):
    tmp -= a[i]
    d.append(tmp%mod)
ans = 0
for i in range(n-1):
    ans += a[i]*d[i]%mod
    ans %= mod

print(ans)

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

mod = 10 ** 9 + 7 
k = 10 ** 6
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1]

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


a, b = map(int,input().split())
x = a + b

if x % 3 != 0:
    print(0)
    exit()

p = 0
q = 0
for i in range(x):
    if a <= 0 or b <= 0:
        if a == b == 0:
            break
        else:
            print(0)
            exit()
    else:
        if a >= b:
            a -= 2
            b -= 1
            p += 1
        else:
            a -= 1
            b -= 2
            q += 1

print(cmb(p+q, p, mod))

Measured memory_bytes: 121840
use std::cmp::min;
use std::io::stdin;

fn main() {
    let stdin = stdin();
    let mut s = String::new();
    stdin.read_line(&mut s).unwrap();

    let (mut l, mut r): (i64, i64) = {
        let mut splitted = s.split(' ');
        (
            splitted.next().unwrap().trim().parse().unwrap(),
            splitted.next().unwrap().trim().parse().unwrap(),
        )
    };

    r -= (l / 2019) * 2019;
    l %= 2019;

    let lim = min(r, l + 2019) + 1;
    let mut mi = 999999999;
    for i in l..lim {
        for j in i + 1..lim {
            mi = min(mi, i * j % 2019)
        }
    }

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



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

int main(){

 int n = 3;
 int d,b,c;
 cin>>d>>b>>c;

 int a[n+1];

 a[0] = d;
 a[1] = b;
 a[2] = c;

 sort(a,a+n);

 if(a[2] == a[1]+a[0])
    cout<<"Yes"<<endl;
 else cout<<"No"<<endl;


 return 0;
}


Measured memory_bytes: 256
import java.io.*;

class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        String [] ymd = S.split("/");
        int[] ymd_num = new int[ymd.length];
        int cont = 0;
        for (String t:ymd){
            ymd_num[cont] = Integer.parseInt(t);
            cont = cont + 1;
        }
        if (ymd_num[0] <= 2018){
            System.out.println("Heisei");
        } else if (ymd_num[0] == 2019 && ymd_num[1] <= 4){
            System.out.println("Heisei");
        } else {
            System.out.println("TBD");
        }
    }
}

Measured memory_bytes: 21332
#include <stdio.h>
int data[26]={};int mod=1e9+7,i,n;int main(void){scanf("%d\n", &n);for(i=0;i<n;++i)data[(int)(getchar()-'a')]++;long ans = 1;for(i=0;i<26;++i)ans=(ans*(data[i]+1))%mod;printf("%ld\n",ans-1);return 0;}


Measured memory_bytes: 128
while True:
  try:
    a, b, c, d, e, f = map(float, input().split())
  except EOFError:
    break
  print("{0:.3f} {1:.3f}".format((c*e-b*f)/(a*e-b*d)+0,(c*d-a*f)/(b*d-a*e)))


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

typedef long long int ll;

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

int main()
{
  ll n,count=0;cin>>n;
  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      for(int k=1;k<=n;k++)
      {
        count+=__gcd(i,__gcd(j,k));
      }
  cout<<count<<"\n";
}


Measured memory_bytes: 3620
# https://atcoder.jp/contests/abc156/submissions/10277689

# コンテスト中に通せたけどmodintクラスで実装してみる
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


class ModInt:
    def __init__(self, x, MOD=10 ** 9 + 7):
        self.mod = MOD
        self.x = x if 0 <= x < MOD else x % MOD

    def __str__(self):
        return str(self.x)

    __repr__ = __str__

    def __add__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x + other.x, self.mod)
        else:
            return ModInt(self.x + other, self.mod)

    def __sub__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x - other.x, self.mod)
        else:
            return ModInt(self.x - other, self.mod)

    def __mul__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x * other.x, self.mod)
        else:
            return ModInt(self.x * other, self.mod)

    def __truediv__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x * pow(other.x, self.mod - 2, self.mod))
        else:
            return ModInt(self.x * pow(other, self.mod - 2, self.mod))

    def __pow__(self, other):
        if isinstance(other, ModInt):
            return ModInt(pow(self.x, other.x, self.mod))
        else:
            return ModInt(pow(self.x, other, self.mod))

    __radd__ = __add__

    def __rsub__(self, other):  # 演算の順序が逆
        if isinstance(other, ModInt):
            return ModInt(other.x - self.x, self.mod)
        else:
            return ModInt(other - self.x, self.mod)

    __rmul__ = __mul__

    def __rtruediv__(self, other):
        if isinstance(other, ModInt):
            return ModInt(other.x * pow(self.x, self.mod - 2, self.mod))
        else:
            return ModInt(other * pow(self.x, self.mod - 2, self.mod))

    def __rpow__(self, other):
        if isinstance(other, ModInt):
            return ModInt(pow(other.x, self.x, self.mod))
        else:
            return ModInt(pow(other, self.x, self.mod))


def combination_mod(n, r, mod):
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


def combination(n, r):
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = ModInt(1)
    for i in range(r):
        nf = nf * (n - i)
        rf = rf * (i + 1)
    return nf / rf


# すべての通り(2^n-1)からnCa,nCbを引けば良い
MOD = 10**9 + 7
n, a, b = read_ints()
# tmp = pow(2, n, MOD) - 1
# ans = tmp - combination_mod(n, a, MOD) - combination_mod(n, b, MOD)
# print(ans % MOD)

tmp = ModInt(2)**n - 1
ans = tmp - combination(n, a) - combination(n, b)
print(ans)


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL ans = 0LL;

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

	int N, K; cin >> N >> K;
	ans = K;
	FOR(i, 1, N) {
		ans *= (K - 1);
	}


	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#include <cmath>
#define SIZE 6005

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

string dp[SIZE];
char str[SIZE];
int pa[SIZE],pb[SIZE];
int pos[SIZE];
bool use[SIZE];

int main()
{
	int n;
	scanf("%d",&n);
    if (n < 1200) {
        puts("ABC");
    } else if (n < 2800){
        puts("ARC");
    } else {
        puts("AGC");
    }

    return 0;
}


Measured memory_bytes: 256
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");

int x,y;
cin>>x>>y;
bool is=false;
for(int i=0;i<=100;i++)
{
  forn(j,101)
  {
    if(i+j==x&&2*i+4*j==y)is=true;
  }
}
if(is)cout<<"Yes";
else cout<<"No";

    return 0;
  }


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

using namespace std;

int main(){
  int x[5];
  int ans=0;
  for(int i=0;i<5;i++) {
    cin >> x[i];
    if(x[i] == 0) ans = ++i;
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3596
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
struct Tree{
	int mx;
	int lch,rch;
}T[12800010];int tot;
void update(int root)
{
	int lc=T[root].lch;
	int rc=T[root].rch;
	T[root].mx=max(T[lc].mx,T[rc].mx);
	return ;
}
void insert(int lstroot,int& nowroot,int l,int r,int x,int y)
{
	nowroot=++tot;
	if(l==r){
		T[nowroot].mx=max(T[lstroot].mx,y);
		return ;
	}
	int mid=(l+r)>>1;
	if(x<=mid){
		T[nowroot].rch=T[lstroot].rch;
		insert(T[lstroot].lch,T[nowroot].lch,l,mid,x,y);
	}
	else{
		T[nowroot].lch=T[lstroot].lch;
		insert(T[lstroot].rch,T[nowroot].rch,mid+1,r,x,y);
	}
	update(nowroot);
	return ;
}
int query(int root,int l,int r,int x,int y)
{
	if(x<=l&&r<=y)return T[root].mx;
	int mid=(l+r)>>1;
	if(x<=mid){
		if(y>mid)return max(query(T[root].lch,l,mid,x,y),query(T[root].rch,mid+1,r,x,y));
		return query(T[root].lch,l,mid,x,y);
	}
	return query(T[root].rch,mid+1,r,x,y);
}
int rt[200010][2];
int n,p[200010],c[200010],f[200010];
void init()
{
	int mx=0;
	for(int i=1;i<=n;i++)
		if(p[i]>mx){
			mx=p[i];
			c[i]=2;
		}
		else c[i]=1;
	for(int i=n;i>=1;i--)
		f[i]=f[i+1]+c[i]-1;
	for(int i=n;i>=1;i--)
		for(int j=0;j<2;j++)
		{
			rt[i][j]=rt[i+1][j];
			int val=query(rt[i+1][(j+c[i])&1],1,n,p[i],n)+c[i];
			if(val%2==j){
//				printf("%d,%d:%d\n",i,j,val);
				insert(rt[i+1][j],rt[i][j],1,n,p[i],val);
			}
		}
	return ;
}
bool check(int H1,int C1,int H2,int C2,int opt,int i)
{
	if(opt==0)
	{
		C1+=(p[i]>H1);
		H1=max(H1,p[i]);
	}
	else{
		C2+=(p[i]>H2);
		H2=max(H2,p[i]);
	}
	int need;
	//in 2
	need=C1-C2+f[i+1];
	if(need>=0&&
	query(rt[i+1][need&1],1,n,H2,n)>=need)
		return true;
	//in 1
	need=C2-C1+f[i+1];
	if(need>=0&&
	query(rt[i+1][need&1],1,n,H1,n)>=need)
		return true;
	return false;
}
char ans[200010];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&p[i]);
	init();
	int H1=0,C1=0,H2=0,C2=0;
	for(int i=1;i<=n;i++)
	{
		if(check(H1,C1,H2,C2,0,i))
		{
			C1+=(p[i]>H1);
			H1=max(H1,p[i]);
			ans[i]='0';
		}
		else if(check(H1,C1,H2,C2,1,i))
		{
			C2+=(p[i]>H2);
			H2=max(H2,p[i]);
			ans[i]='1';
		}
		else{
			printf("-1\n");
			return 0;
		}
	}
	printf("%s\n",ans+1);
	return 0;
}

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

int main() {
  vector<int> vec(1000000);
  cin >> vec.at(1);
   for(int i=2;true;i++){
     bool finished = false;
     if(vec.at(i-1)%2==0){
       vec.at(i) = vec.at(i-1)/2;
     }
     else{
       vec.at(i) = vec.at(i-1)*3+1;
     }
     for(int j=1;j<i;j++){
       if (vec.at(j) == vec.at(i)){
         finished = true;
         cout << i << endl;
         break;
       }
     }
     if (finished == true){
       break;
     }
     }
  }

Measured memory_bytes: 4096
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#define FUP(i,x,y) for(int i=(x);i<=(y);i++)
#define FDW(i,x,y) for(int i=(x);i>=(y);i--)
#define MAXN 100010
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define ll long long
#define db double
using namespace std;
int read(){
    int w=0,flg=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')flg=-1;ch=getchar();}
    while(ch<='9'&&ch>='0'){w=w*10-'0'+ch,ch=getchar();}
    return w*flg;
}
int n,x,t;
int main(){
	n=read(),x=read(),t=read();
	int cnt=n/x+(n%x>0);
	printf("%d\n",cnt*t);
    return 0;
}

Measured memory_bytes: 3760
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

A, B, C = ln()

result = min([abs(A * B * (C / 2) - A * B * (C - C / 2)), abs(A * C * (B / 2) - A * C * (B - B / 2)), abs(C * B * (A / 2) - C * B * (A - A / 2))])

print result



Measured memory_bytes: 4644
<?php
define( "TOP", 0 );
define( "FRONT", 1 );
define( "RIGHT", 2 );
define( "LEFT", 3 );
define( "BACK", 4 );
define( "BOTTOM", 5 );
class Dice
{
	private $labels;
	public function __construct( $labels )
	{//var_dump( $labels);
		$this->labels = $labels;
	}
	public function roll( $cmds )
	{
		$len = strlen( $cmds );
		for( $i=0; $i<$len; $i++ ) {
			if( 'E' == $cmds[$i] ) {
				$t = $this->labels[TOP];
				$this->labels[TOP] = $this->labels[LEFT];
				$this->labels[LEFT] = $this->labels[BOTTOM];
				$this->labels[BOTTOM] = $this->labels[RIGHT];
				$this->labels[RIGHT] = $t;
			} else if( 'S' == $cmds[$i] ) {
				$t = $this->labels[TOP];
				$this->labels[TOP] = $this->labels[BACK];
				$this->labels[BACK] = $this->labels[BOTTOM];
				$this->labels[BOTTOM] = $this->labels[FRONT];
				$this->labels[FRONT] = $t;
			} else if( 'W' == $cmds[$i] ) {
				$t = $this->labels[TOP];
				$this->labels[TOP] = $this->labels[RIGHT];
				$this->labels[RIGHT] = $this->labels[BOTTOM];
				$this->labels[BOTTOM] = $this->labels[LEFT];
				$this->labels[LEFT] = $t;
			} else if( 'N' == $cmds[$i] ) {
				$t = $this->labels[TOP];
				$this->labels[TOP] = $this->labels[FRONT];
				$this->labels[FRONT] = $this->labels[BOTTOM];
				$this->labels[BOTTOM] = $this->labels[BACK];
				$this->labels[BACK] = $t;
			} else if( 'M' == $cmds[$i] ) {
				$t = $this->labels[FRONT];
				$this->labels[FRONT] = $this->labels[RIGHT];
				$this->labels[RIGHT] = $this->labels[BACK];
				$this->labels[BACK] = $this->labels[LEFT];
				$this->labels[LEFT] = $t;
			}
		}
	}
	public function getLabel( $face )
	{
		return $this->labels[ $face ];
	}
	public function isEqual( $another )
	{
		$cmds = "NEEENMMMM";
		$len = strlen( $cmds );
		for( $i=0; $i<=5; $i++ ) {
			if( $another->getLabel( TOP ) == $this->getLabel( TOP ) ) {
				for( $j=5; $j<$len; $j++ ) {
					if( $another->getLabel( FRONT ) == $this->getLabel( FRONT ) ) {
						for( $k=TOP; $k<=BOTTOM; $k++ ) {
							if( $another->getLabel($k) != $this->getLabel($k) ) { break; }
						}
						if( 6 == $k ) { return true; }
					}
					$this->roll( $cmds[$j] );
				}
			}
			$this->roll( $cmds[$i] );
		}		
		return false;
	}	
}
	
	$labels = explode( " ", trim( fgets( STDIN ) ) );
	$dice = new Dice( $labels );
	$labels = explode( " ", trim( fgets( STDIN ) ) );
	$dice2 = new Dice( $labels );
	
	if( $dice->isEqual( $dice2 ) ) {
		print "Yes";
	} else {
		print "No";
	}
?>

Measured memory_bytes: 15664
#include<bits/stdc++.h>
using namespace std;
int a[100001];
vector<int>v;
int main(void){
	int n,m;
	int i,k;
	int x,y,z;
	cin>>n>>m;
	for(i=0;i<n;i++)	cin>>a[i];
	for(i=0;i<n-1;i++){
		x=a[i]+1;
		y=a[i+1]-x;
		if(y!=0)	v.push_back(y);
	}
	z=n;
	k=v.size()-(m-1);
	sort(v.begin(),v.end());
	for(i=0;i<k;i++)	z+=v[i];
	cout<<z<<endl;
	return 0;
}


Measured memory_bytes: 3944
#include <bits/stdc++.h>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef long double ld;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    ll x, y;

    cin >> x >> y;

    if(y%2==0 && x*2<=y && y<=x*4) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3640
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::FromStr;
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
fn main(){
    let n:usize = read();
    let mut a:Vec<i64> = vec![0;n];
    let mut b:Vec<i64> = vec![0;n];
    let mut c:Vec<i64> = vec![0;n];
    for i in 0..n{
        let l:Vec<i64> = (0..3).map(|_| read()).collect();
        a[i] = l[0];
        b[i] = l[1];
        c[i] = l[2];
    }
    let mut dp:Vec<Vec<i64>> = vec![vec![0;3];n];
    dp[0][0] = a[0];
    dp[0][1] = b[0];
    dp[0][2] = c[0];
    for i in 1..n{
        for j in 0..3usize{
            for k in 0..3usize{
                if(j != k){
                    match k {
                        0 => dp[i][k] = max(dp[i - 1][j] + a[i], dp[i][k]),
                        1 => dp[i][k] = max(dp[i - 1][j] + b[i], dp[i][k]),
                        2 => dp[i][k] = max(dp[i - 1][j] + c[i], dp[i][k]),
                        _ => (),
                    }
                }
            }
        }
    }
    let mut ans = 0;
    for i in &dp[n - 1]{
        ans = max(*i,ans);
    }
    println!("{}",ans);
}

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

int main(){
  long A,B,C;
  cin>>A>>B>>C;
  long s=C-A;
  long can;
  if (B>=s){
    can=B+C;
  }
  else{
    can=A+2*B+1;
  }
  cout<<can;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
using namespace std;
typedef long long ll;

ll a[1000] = {};
ll b[1000] = {};
ll c[1000] = {};
ll D[1000000] = {};
ll E[3000000] = {};
int main() {
	ll x, y, z, k; cin >> x >> y >> z >> k;
	rep(i, 0, x)cin >> a[i];
	rep(i, 0, y)cin >> b[i];
	rep(i, 0, z)cin >> c[i];

	rep(i, 0, x) rep(j, 0, y) {
		D[i*y + j] = a[i] + b[j];
	}
	sort(D, D + x * y);
	reverse(D, D + x * y);

	rep(i, 0, k) rep(j, 0, z) {
		E[i*z + j] = D[i] + c[j];
	}

	sort(E, E + k * z);
	reverse(E, E + k * z);

	rep(i, 0, k) {
		cout << E[i] << endl;
	}
	return 0;
}

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

inline bool check(int x, int y)
{
	if (x >= 0 && x <= 9 && 0 <= y && y <= 9) return true;
	else false;
}

int main()
{
	int mass[12][12] = { {0} };
	int x, y, s, non = 0, maxim = -1;

	while (scanf("%d,%d,%d", &x, &y, &s) != EOF)
	{
		switch (s)
		{
		case 1:
			mass[x][y]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			break;
		case 2:
			mass[x][y]++;
			if (check(x - 1, y - 1)) mass[x - 1][y - 1]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x + 1, y - 1)) mass[x + 1][y - 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			if (check(x - 1, y + 1)) mass[x - 1][y + 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x + 1, y + 1)) mass[x + 1][y + 1]++;
			break;
		case 3:
			mass[x][y]++;
			if (check(x - 1, y - 1)) mass[x - 1][y - 1]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x + 1, y - 1)) mass[x + 1][y - 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			if (check(x - 1, y + 1)) mass[x - 1][y + 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x + 1, y + 1)) mass[x + 1][y + 1]++;
			if (check(x, y - 2)) mass[x][y - 2]++;
			if (check(x - 2, y)) mass[x - 2][y]++;
			if (check(x + 2, y)) mass[x + 2][y]++;
			if (check(x, y + 2)) mass[x][y + 2]++;
			break;
		}
	}
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (mass[i][j] == 0) non++;
			maxim = max(maxim, mass[i][j]);
		}
	}
	cout << non << endl << maxim << endl;
	return 0;
}


Measured memory_bytes: 3056
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

typedef long long ll;

int m=1000000007;

int main()
{
    ll n;
    cin>>n;
    ll a[n];
    ll sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    ll c=0;
    for(int i=0;i<n;i++)
    {
       sum-=a[i];
       c+=((a[i]%m)*((sum)%m))%m;

    }
    cout<<c%m;
    

    return 0;
}


Measured memory_bytes: 5096
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1);
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 MAX = 505;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int h[MAX][MAX];    // 席(i, j)のコスト
bool occ[MAX][MAX]; // 席(i, j)にまだ人がいるか

void dfs(int y, int x) {
    int z = h[y][x] + occ[y][x];
    rep(i, 4) {
        int ny = y + dy[i];
        int nx = x + dx[i];
        if (chmin(h[ny][nx], z)) dfs(ny, nx);
    }
}

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

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            h[i][j] = min(min(i, n+1-i), min(j, n+1-j)) - 1;
            occ[i][j] = true;
        }
    }

    int res = 0;
    rep(_, n*n) {
        int id; cin >> id;
        int y = (id + n - 1) / n;
        int x = id % n;
        if (x == 0) x += n;
        res += h[y][x];
        occ[y][x] = false;
        dfs(y, x);
    }
    cout << res << endl;
}



Measured memory_bytes: 20340
#include <cstdio>
#include <memory.h>
#include <cstring>
#include <vector>
#include <deque>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <functional>
#include <iostream>
#include <set>
#include <list>
#include <map>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long llu;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
const ll MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

priority_queue<int, vector<int>, greater<int> > pq;

// 2000. 현재 상태에 따라서. 모든 스왑수가 정해지지 않나?
// 어떤 점에서 반대 색깔이 몇까지 열렸을 떄 원하는 자리로 가는 데에 필요한 연산수.
// 뒤에 자신보다 순서가 앞선 점의 개수만큼 자신 위치를 더해준다.
// 2000 * 2000 쌍에 대한 순서..

int dp[2001][2001];
int ww[2000], bb[2000];
int wg[2000][2001], bg[2000][2001];
int n;
int tree[4001];
int tmp[4001];

void update(int i, int val) {
	for (; i <= 2 * n; i += i & -i)
		tree[i] += val;
}

int find(int i) {
	int sum = 0;
	for (; i; i -= i & -i)
		sum += tree[i];
	return sum;
}

int go(int o, int oo) {
	if (o == n && oo == n) return 0;
	if (dp[o][oo] != -1) return dp[o][oo];
	
	int miv = 1e9;
	if(o != n) miv = min(miv, go(o + 1, oo) + ww[o] + wg[o][oo] - (o + oo + 1)); // 현재 위치. o + oo + 1에 맞춰져야 함.
	if(oo != n) miv = min(miv, go(o, oo + 1) + bb[oo] + bg[oo][o] - (o + oo + 1));

	// printf("%d %d : %d %d // %d %d // %d\n", o, oo, ww[o], wg[o][oo], bb[o], bg[o][oo], miv);
	return dp[o][oo] = miv;
}

int main() {
	memset(dp, -1, sizeof(dp));
	scanf("%d", &n);

	char a;
	int b, l = 0, r = 0;
	for (int i = 0; i < 2 * n; i++) {
		scanf(" %c %d", &a, &b);
		b--;

		if (a == 'W') ww[b] = i + 1;
		else bb[b] = i + 1;
	}
	
	for (int i = 0; i < n; i++) {
		memcpy(tmp, tree, sizeof(tmp));

		wg[i][0] = find(2 * n) - find(ww[i]);
		for (int j = 0; j < n; j++) {
			update(bb[j], 1);
			wg[i][j + 1] = find(2 * n) - find(ww[i]);
		}
		
		memcpy(tree, tmp, sizeof(tmp));
		update(ww[i], 1);
	}

	memset(tree, 0, sizeof(tree));
	for (int i = 0; i < n; i++) {
		memcpy(tmp, tree, sizeof(tmp));

		bg[i][0] = find(2 * n) - find(bb[i]);
		for (int j = 0; j < n; j++) {
			update(ww[j], 1);
			bg[i][j + 1] = find(2 * n) - find(bb[i]);
		}

		memcpy(tree, tmp, sizeof(tmp));
		update(bb[i], 1);
	}

	printf("%d", go(0, 0));
}

Measured memory_bytes: 47488
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 201

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

void calc(int n){
  int x[SIZE],y[SIZE],p,d;
  int min_x=0,max_x=0,min_y=0,max_y=0;
  
  x[0] = y[0] = 0;
  
  for(int i=1;i<n;i++){
    scanf("%d%d",&p,&d);

    x[i] = x[p] + dx[d];
    y[i] = y[p] + dy[d];

    min_x = min(x[i],min_x);
    max_x = max(x[i],max_x);
    min_y = min(y[i],min_y);
    max_y = max(y[i],max_y);   
  }
  
  printf("%d %d\n",max_x-min_x+1,max_y-min_y+1);
}

int main(){
  int n;
  
  while(1){
    scanf("%d",&n);
    if(n==0) break;
    calc(n);
  }
  
  return 0;
}

Measured memory_bytes: 3096
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		if (c[0]==97||c[0]==101||c[0]==105||c[0]==111||c[0]==117){
			System.out.println("vowel");
		}
		else{
			System.out.println("consonant");
		}
	}

}


Measured memory_bytes: 9684
#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    int N;cin>>N;
    vector<int> A(N);
    ll money = 1000;
    ll stock = 0;
    for(int i=0;i<N;i++) cin >> A[i];
    int state = 0;
    if(A[0]<A[1]){
        stock = money / A[0];
        money %= A[0];
        state = 1;
    }else if(A[0]>A[1]) state = -1;
    for(int i=1;i<N-1;i++){
        if(A[i]==A[i+1]) continue;
        else if(A[i]>A[i+1]){
            if(state==1||state==0){
                money += stock * A[i];
                stock = 0;
            }
            state = -1;
        }else{
            if(state==-1||state==0){
                stock = money / A[i];
                money %= A[i];
            }
            state = 1;
        }
    }
    money += stock * A[N-1];
    cout << money << endl;
    return 0;
}

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

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

	string S,T;
	int i,j;
	int counter=0;
	int tmp;
	double ave;
	vector<int> given;

	cin >> S >> T;

	for(i=0;i<3;i++){
		if(S[i]==T[i]){
			counter++;
		}
	}

	cout << counter << endl;

	return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String[] s = sc.next().split("");
      HashMap<String,Integer> map = new HashMap<>();
      
      for(String t:s){
        int number = map.getOrDefault(t,0);
        map.put(t,number+1);
      }
      
      System.out.println(check(map)?"Yes":"No");
      
     
      
      
      
    }
  private static boolean check(HashMap<String,Integer> mp){
    for(Integer b:mp.values()){
      if(b % 2 != 0) return false;
    }
    return true;
  }
  
}

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

int main(){
    ll N, A, B;
    cin >> N >> A >> B;

    if(A>B){
        cout << 0 << endl;
    }else if(N==1 && A != B){
        cout << 0 << endl;
    }else
        cout << (B-A)*(N-2) + 1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
#define lli long long
typedef long double ldb;
#define deci(n) fixed << setprecision(n)
 
lli M=1e9+7;
lli MOD=1e9+7;
 
#define MAXN 2000006 
 
// Template function //
lli powermod(lli x, lli y)  
{  
    lli res = 1;  
    x = x % MOD;
    if (x == 0) return 0;  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % MOD;  
        y = y>>1;   
        x = (x*x) % MOD;  
    }  
    return res;  
}
lli modinv(lli x)
{
    return powermod(x,MOD-2);
}
// Template functions end //
 
// Custom funtions //
lli findset(lli p[], lli x){
	if(x!=p[x]){
		p[x]=findset(p,p[x]);
	}
	return p[x];
}
 
void unionset(lli p[],lli r[],lli a,lli b){
	lli x=findset(p,a);
	lli y=findset(p,b);
	if(x!=y){
		if(r[x]<r[y]) swap(x,y);
		p[y]=x;
		if(r[x]==r[y]){
			r[x]++;
		}
	}
}

void dfs(vector<lli> v[], lli s[], lli x)
{
    lli S=1;
    for(lli i=0;i<v[x].size();i++)
    {
        dfs(v,s,v[x][i]);
        S+=s[v[x][i]];
    }
    s[x]=S;
}

lli f[100005];



void preprocess()
{
    f[0]=1;
    for(lli i=1;i<100005;i++)
    {
        f[i] = (f[i-1]*i)%MOD;
        if(i%2==0)
        f[i]/=2;
    }
}

lli tree[MAXN];


void buildTree(vector<lli> a, lli n)
{
    for(lli i=0;i<n;i++)
        tree[n+i] = a[i];
    for(lli i=n-1;i>0;i--)
    {
        tree[i] = tree[i<<1] + tree[i<<1|1];
    }
}

void updateTree(lli n, lli p, lli value)
{
    tree[p+n] = value;
    p+=n;
    for(lli i=p; i>1;i >>= 1)
        tree[i>>1] = tree[i] + tree[i^1];
}

lli queryTree(lli n, lli l, lli r)
{
    lli res = 0;
    for(l+=n,r+=n;l<r;l>>=1, r>>=1)
    {
        if(l&1)
            res += tree[l++];
        if(r&1)
            res += tree[--r];
    }
    return res;
}

bool sortbysec(const pair<pair<lli,lli>,lli> &a, 
              const pair<pair<lli,lli>,lli> &b) 
{ 
    if(a.first.second == b.first.second)
    return a.first.first>b.first.first;
    return (a.first.second < b.first.second); 
} 

void dfs(int x, int vi[], vector<int> v[], long double pr, long double &ans)
{
    vi[x] = 1;
    double d = 0;
    for(int i=0;i<v[x].size();i++) 
    {
        if(vi[v[x][i]]==0)
        d++;
    }
    if(d==0)
    return;
    ans+=pr;
    pr = pr/d;
    for(int i=0;i<v[x].size();i++) 
    {
        if(vi[v[x][i]]==0)
        {
            dfs(v[x][i],vi,v,pr,ans);
        }
    }
}

void solve()
{ 
    string s;
    string t;
    cin>>s>>t;
    int n = s.length();
    int m = t.length();
    int ans = INT_MAX, c = 0;
    for(int i=0;i<n-m+1;i++)
    {
        c=0;
        for(int j=0;j<m;j++)
        {
            if(s[i+j]!=t[j])
            c++;
        }
        ans = min(ans,c);
    } 
    cout<<ans<<endl;
}
// Custom functions end //
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli q=1;
    //cin>>q;
    for(lli tc=1;tc<=q;tc++)
    {
        solve();
    }
    return 0;
}

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

int main(){
    int K ,X;
    cin >> K >> X;
    int x;
    for(x = X - K + 1; x < X; x++){
        cout << x << " ";
    }
    for(x = X; x < X + K - 1; x++){
        cout << x << " ";
    }
    cout << x << endl;
    return 0;
}

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

int main(){
    
    // 1. 入力情報.
    const string s = "CODEFESTIVAL2016";
    char c[22];
    scanf("%s", c);
    
    // 2. 書き換え回数.
    int ans = 0;
    rep(i, 16) if(s[i] != c[i]) ans++;
    
    // 3. 出力.
    printf("%d\n", ans);
    return 0;
    
}

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

// NOTE TO SELF // try to simplyfy the problem

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

#define ll long long int

//const int mod=1000000007;
using namespace std;
 
/*int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};
*/

int main()
{
    int n;
    cin>>n;
    
    int a[n];
    
    for(int i=0;i<n;i++)
        cin>>a[i];
    
    int dp[n];
    
    dp[0]=0;
    
    for(int i=1;i<n;i++)
    {
        
        dp[i]=  dp[i-1]+abs(a[i-1]-a[i]) ;
        if(i>1)
            dp[i]=min(dp[i],dp[i-2] + abs(a[i-2]-a[i]));
    }
    
    cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 4332
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9+7;
const ll INF = 0x3f3f3f3f;

ll a[300001];

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef ONLINE_JUDGE
    //freopen("C.txt", "r", stdin);
    #endif
    string str;
    cin >> str;
    sort(str.begin(), str.end());
    if(str[1]==str[0]&&str[1]!=str[2]&&str[2]==str[3]) cout << "Yes";
    else cout << "No";

}



Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;

typedef long long ll;

int main()
{
    int R,G,B,N;
    cin >> R >> G >> B >> N;
    int ans=0;
    for(int r=0; r<=N/R; r++){
        for(int g=0; g<=(N-r*R)/G; g++){
            if((N-r*R-g*G)%B==0) ans++;
        }
    }
    cout << ans;


    return 0;
}

Measured memory_bytes: 256
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))

GCD1 = []
g = A[0]
for a in A:
    g = gcd(g, a)
    GCD1.append(g)

B = A[::-1]
g = B[0]
GCD2 = []
for b in B:
    g = gcd(g, b)
    GCD2.append(g)

ans = 1
for i in range(N):
    if i == 0:
        a = GCD2[N-2]
    elif i == N-1:
        a = GCD1[N-2]
    else:
        a = gcd(GCD1[i-1], GCD2[N-i-2])
    ans = max(ans, a)
print(ans)

Measured memory_bytes: 16152
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<tuple>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
	int h, w;
	cin >> h >> w;
	vector<string>a(h);
	rep(i, h)cin >> a[i];
	vector<bool>hei(h, false);
	vector<bool>wid(w, false);
	rep(i, h) {
		rep(j, w) {
			if (a[i][j] == '#') {
				hei[i] = true;
				wid[j] = true;
			}
		}
	}
	rep(i, h) {
		if (hei[i]) {
			rep(j, w) {
				if (wid[j]) {
					cout << a[i][j];
				}
			}
			cout << endl;
		}
	}
	return 0;
}


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

min_num = b - a
max_num = b + a

ls = list(range(min_num+1, max_num, 1))

ans_str = ""
for _l in ls:
    ans_str += str(_l) + " "

ans_str = ans_str[:-1]

print(ans_str)

Measured memory_bytes: 3064
#include<stdio.h>
int main(){
  int unused __attribute__((unused));
  char x;
  unused = scanf("%c", &x);

  if((int)x >= 65 && (int)x <= 90) printf("A");
  else if((int)x >= 97 && (int)x <= 122) printf("a");

  return 0;
}


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

// 
int main() {
    int N;
    cin >> N;
    bool c[N];
    string tmp;
    cin >> tmp;
    for (int i = 0; i < N; i++) {
        if (tmp[i] == 'R') {
            c[i] = false;  // Red
        } else {
            c[i] = true;  // White
        }
    }

    int changeCount = 0;
    int left = 0, right = N - 1;
    while (left < right) {
        // cout << left << " " << right << endl;
        // cout << "true:" << c[left] << " " << c[right] << endl;
        if (c[left] == true && c[right] == false) {
            // cout << "change" << endl; // debug
            swap(c[left], c[right]);
            changeCount++;
        } else if (c[left] == true) {
            right--;
        } else {
            left++;
        }
    }
    cout << changeCount;
}


Measured memory_bytes: 3952
#include <iostream>
#include <utility>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <map>
#include <fstream>
#include <bitset>
#include <stack>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pii;
typedef vector<ll> vec;

vector<pii> cits[100050];
string ans[100500];

string assignid(int pref, int xth) {
	string p1 = to_string(pref);
	string p2 = to_string(xth);
	int oldss = p1.length();
	int oldss2 = p2.length();

	for (int i = 0; i < 6 - oldss; i++) p1 = "0" + p1;
	for (int i = 0; i < 6 - oldss2; i++) p2 = "0" + p2;
	return p1 + p2;
}
int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m; cin >> n >> m;

	for (int i = 0; i < m; i++) {
		int p, y; cin >> p >> y;
		cits[p].push_back({ y, i });
	}
	for (int i = 0; i <= 1e5; i++) {
		sort(cits[i].begin(), cits[i].end());
		for (int j = 0; j < cits[i].size(); j++) {
			ans[cits[i][j].second] = assignid(i, j+1);
		}
	}

	for (int i = 0; i <= 1e5; i++) {
		if (ans[i] != "") {
			cout << ans[i] << "\n";
		}
	}
	return 0;

}

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

#define lli long long int
#define pb push_back

int main()  
{
    string a ;
    cin >> a ;
    int n = a.size() -  1 , c = 0;

    for (int i = 0 ; i < a.size() / 2  ; i++)
    {
        if (a[n - i] != a[i]) c++ ;
    }

    cout << c << endl ;

    return 0;  
}  

Measured memory_bytes: 256
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Solve is
   X : Integer;
   A : Integer;
begin
   Get (X);
   Get (A);
   if X < A then
      Put_Line ("0");
   else
      Put_Line ("10");
   end if;
end Solve;

Measured memory_bytes: 3684
import collections
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
c = collections.Counter(a)
cl = ""
if n%2 == 1:
	cl = "odd"
else:
	cl = "even"
ans = 0
flg = True
if cl == "odd":
	for i in c:
		if i%2 == 1:
			flg = False
		if i == 0:
			if c[i] != 1:
				flg = False
		else:
			if c[i] != 2:
				flg = False
else:
	for i in c:
		if i%2 == 2:
			flg = False
		if c[i] != 2:
			flg = False
if not (flg):
	print (ans)
	exit()
ans = 2**(n//2)%mod
print (ans)

Measured memory_bytes: 14812
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())
 
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18


int main() {
    LL N;
    cin >> N;
    LL ans=0;
    LL b = 10;
    while(b<pow(10,18)){
        ans += N/b;
        b*=5;
    }


    if(N%2!=0){cout<<0<<endl;}
    else{cout<<ans<<endl;}

    
}

Measured memory_bytes: 256