akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n + 1], bit[50][n + 1];
  for (int i = 1; i <= n; i++)
    cin >> arr[i];
  for(int p = 0; p < 25; p++)
    bit[0][p] = 0;
  for (int i = 1; i <= n; i++) {
    for (int p = 0; p < 25; p++) bit[p][i] = bit[p][i - 1];
    int num = arr[i], p = 0;
    while (num) {
      if (num & 1)
        bit[p][i]++;
      num >>= 1;
      p++;
    }
  }
  int s = 1, e = 1, ans = 0;
  for (int s = 1; s <= n; s++) {
    // shift e to right s.t. all bits either never appear or only once appear between s to e
    while (true) {
      bool stop = false;
      for (int p = 0; p < 25; p++) {
        if (bit[p][e] - bit[p][s - 1] > 1)
          stop = true;
      }
      if (stop) {
        e--;
        break;
      }
      else if (e == n)
        break;
      else
        e++;
    }
    ans += e - s + 1;
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 44264
#include <algorithm>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;

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

struct IO {
    stringstream i;
    stringstream o;
    IO() { i << cin.rdbuf(); }
    ~IO() { cout << o.str(); }
    template <class T> inline istream& operator>>(T& rhs) { return i >> rhs; }
    template <class T> inline ostream& operator<<(const T& rhs) { return o << rhs; }
};

int main() {
    IO io;
    int N; io >> N;
    vector<pair<int64_t, int64_t>> points(N);
    REP(i, N) io >> points[i].first >> points[i].second;

    vector<vector<int64_t>> f(N);
    REP(i, N) {
        auto [x, y] = points[i];
        f[i] = {x-y, x+y};
    }

    int64_t ans = numeric_limits<int64_t>::min();
    REP(d, 2) {
        auto m1 = numeric_limits<int64_t>::max();
        auto m2 = numeric_limits<int64_t>::min();
        REP(i, N) m1 = min(m1, f[i][d]);
        REP(i, N) m2 = max(m2, f[i][d]);
        ans = max(ans, m2 - m1);
    }
    io << ans << endl;
}


Measured memory_bytes: 23100
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<string.h>
#include<iostream>
using namespace std;
struct node {
	int k[11] = { 0 }, p,nu;
}bu[11];
int main()
{
	int n, m, ans = 0;
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= m; i++)
	{
		scanf("%d", &bu[i].nu);
		for (int j = 1; j <= bu[i].nu; j++)
		{
			scanf("%d", &bu[i].k[j]);
		}
	}
	for (int i = 1; i <= m; i++)
		scanf("%d", &bu[i].p);
	for (int i = 0; i < (1 << n); i++)
	{
		int sum2 = 0;
		for (int j = 1; j <= m; j++)
		{
			int sum = 0;
			for (int d = 1;d<=bu[j].nu; d++)
				if (((1 << (bu[j].k[d]-1))&i) > 0)
					sum++;
			if (sum%2 == bu[j].p)
				sum2++;
		}
		if (sum2 == m)
			ans++;
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ld long double
#define lli long long int
#define vi vector<int>
#define vlli vector<lli>
#define vvi vector<vi >
#define str string
#define vs vector<str>
#define vb vector<bool>
#define slli set<lli>
#define mii map<int, int>
#define mlli map<int, lli>
#define msi map<str, int>
#define mp make_pair
#define pii pair<int, int>
#define pll pair<lli, lli>
#define vpii vector<pii >
#define vpll vector<pll >
#define pb push_back
#define loop(i, s, l, j) for(int i = s; i < l; i += j)
#define rloop(i, s, l, j) for(int i = s; i >= l; i -= j)
#define rep(i, n) loop(i,0,n,1)
#define rrep(i, n) rloop(i,n-1,0,1) 
#define fastio() ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ft first
#define sd second
#define all(a) a.begin(),a.end()
#define rev(a) reverse(all(a))
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define mod 1000000007
#define inf 100000000
#define limit 200005
#define minval -100000000000000000
#define maxval 1000000000000000
/**********************************************************************************************************************************************/
int dx4[4] = {0, -1, 0, 1};
int dy4[4] = {1, 0, -1, 0};
int dx8[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int dy8[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int Power(int base,int exp){int ans=1;  while(exp > 0){if(exp&1)ans=(1LL*ans*base)%mod; exp=exp>>1; base=(1LL*base*base)%mod;}  return ans;}
/**********************************************************************************************************************************************/ 
vvi g(200005);
vb vis(200005, 0);
int n, m, cnt;
void dfs(int root)
{
    vis[root] = 1;
    cnt++;
    rep(i, (int)g[root].size())
        if(!vis[g[root][i]])
            dfs(g[root][i]);
}
void input()
{
    cin >> n >> m;
    rep(i,m)
    {
        int x, y;
        cin >> x >> y;
        g[x-1].pb(y-1);
        g[y-1].pb(x-1);
    }
    
    vi a;
    rep(i,n)
    {
        if(vis[i])
            continue;
        cnt = 0;
        dfs(i);
        a.pb(cnt);
    }
    sort(all(a));

    int ans = 0;
    int val = 0;
    int sz = a.size();
    rep(i,sz)
    {
        ans += (a[i]-val);
        a[i] -= val;
        val += a[i];
    }
    cout << ans << '\n';

}
int main()
{
   /*
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
   */
    fastio();
    int q = 1;
    //cin >> q;
    while(q--)
        input();
}


Measured memory_bytes: 23500
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>


#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...)
#define showlr(n,l,r)
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

template<typename V,typename H> void resize(vector<V>& v,const H a){v.resize(a);}
template<typename V,typename H,typename... T> void resize(vector<V>& v,const H& a,const T... b){v.resize(a);for(auto &v:v) resize(v,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;
/*------------end of definitions------------*/

vi cumsum(1010);

auto solve=[](int n){
    int ans=0;
    rep(l,1000){
        REP(r,l+2,1000){
            if(cumsum[r]-cumsum[l]==n){
                show(r,l,cumsum[r],cumsum[l]);
                ans++;
            }
        }
    }
    out(ans);
};

signed main(){

    rep(i,1010) cumsum[i]=i;
    rep(i,1009) cumsum[i+1]+=cumsum[i];

    int n;
    while(scanf("%d",&n),n){
        solve(n);
    }

    return 0;
}



Measured memory_bytes: 3168
/*
      author : nishi5451
      created: 11.08.2020 22:17:40
*/

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


int main(){
    int a;
    string s;
    cin >> a >> s;
    if(a>=3200) cout << s << endl;
    else cout << "red" << endl;
    return 0;
}

Measured memory_bytes: 3552
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int k; rd(k);

  struct E{int u, v, w;}
  E[] edges;
  int n=2;
  void f(int x){
    if(x==2){
      edges~=E(1, 2, 0);
      edges~=E(1, 2, 1);
    }else{
      if(x&1){
        f(x-1);
        edges~=E(1, n, x-1);
      }else{
        f(x/2);
        foreach(ref e; edges) e.w*=2;
        edges~=E(n, n+1, 0);
        edges~=E(n, n+1, 1);
        n++;
      }
    }
  }
  f(k);
  writeln(n, " ", edges.length);
  foreach(e; edges){
    writeln(e.u, " ", e.v, " ", e.w);
  }
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x) e=l[i].to!(typeof(e));
}


Measured memory_bytes: 256
n,d = map(int,input().split())
x = [0]*n
for i in range(n):
    x[i] = list(map(int,input().split()))
count = 0
for i in range(n):
    for j in range(n):
        dis2 = 0
        for k in range(d):
            dis2 += (x[i][k]-x[j][k])**2
        dis = float((dis2)**0.5)
        if dis.is_integer() == True:
            count += 1
print(int((count-n)/2))

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pdd;

#define INF 0x7f7f7f
#define mem(a,b) memset(a , b , sizeof(a))
#define FOR(i, x, n) for(int i = x;i <= n; i++)
// const ll mod = 1e9 + 7;
 const int maxn = 2e5 + 10;
// const double eps = 1e-6;
const ll mod = 998244353;

ll N, M, K;
ll f[maxn];
ll inv[maxn];

ll FPM(ll x,ll power)
{
    ll ans = 1;
    while(power)
    {
        if(power & 1)
        {
            ans = (ans * x) % mod;
        }
        x = (x * x) % mod;
        power >>= 1;
    }
    return ans % mod;
}

ll C(ll a, ll b)
{
    return f[a] * inv[a - b] % mod * inv[b] % mod;
}

void solve()
{
    cin >> N >> M >> K;
    ll m = max(N, M);
    f[0] = 1;
    for(int i = 1;i <= m; i++) // 阶乘预处理
        f[i] = f[i - 1] * i % mod;
    inv[m] = FPM(f[m], mod - 2);
    for(ll i = m - 1; i >= 0; i--)
        inv[i] = inv[i + 1] * (i + 1) % mod; //求逆元
        ll ans = 0;
    ll cnt = FPM(M - 1, N - K - 1);
    for(ll i = N - K - 1;i <= N - 1; i++)
    {
        ans = (ans + C(N - 1, i) % mod * M % mod * cnt % mod) % mod;
        cnt = cnt * (M - 1) % mod;
    }
    cout<< ans << endl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    //cin.tie(nullptr);
    //cout.tie(nullptr);
#ifdef FZT_ACM_LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#else
    ios::sync_with_stdio(false);
    int T = 1;
    //cin >> T;
    while(T--)
        solve();
#endif
    return 0;
}


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

int main() {
    ll t1, t2;
    ll a1, a2;
    ll b1, b2;
    cin >> t1 >> t2 >> a1 >> a2 >> b1 >> b2;
    ll ha = t1 * a1, hb = t1 * b1;
    ll da = ha + t2 * a2, db = hb + t2 * b2;
    if (da == db) {
        cout << "infinity" << endl;
    } else if ((ha < hb && da < db) || (ha > hb && da > db)) {
        cout << 0 << endl;
    } else {
        ll X = abs(ha - hb);
        ll x = abs(da - db);
        if (X % x == 0) {
            cout << (X / x - 1) * 2 + 2 << endl;
        } else {
            cout << X / x * 2 + 1 << endl;
        }
    }
    return 0;
}

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

int main(void){
	int x,n;
	int i,j;
	int p[150]={-2};
	int flag1=0,flag2=0;

	scanf("%d %d",&x,&n);
	for(i=0;i<n;i++){
		scanf("%d",&p[i]);
	}
	for(i=0;i<100;i++){
		for(flag1=0,flag2=0,j=0;j<n;j++){
			if(x-i==p[j]){
				flag1=1;
			}
			if(x+i==p[j]){
				flag2=1;
			}
		}
		if(flag1==0||flag2==0){
			if(flag1==0){
				printf("%d",x-i);
				return 0;
			}
			if(flag2==0){
				printf("%d",x+i);
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 1732
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace paiza2
{
    class Program
    {
        static void Main(string[] args)
        {
            int outflag = 0;
            string w = Console.ReadLine();
            for (int c = 0; c < w.Length; c++)
            {
                char looking = w[c];
                int check = 0;
                for (int c_n = 0; c_n < w.Length; c_n++)
                {
                    if (looking == w[c_n]) check++;
                }
                if (check % 2 != 0)
                {
                    outflag = 1;
                    break;
                }

            }
            if (outflag == 1)
                Console.WriteLine("No");
            else
                Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<algorithm>
#include<queue>
#include<cmath>
#include<map>
#include<vector>
#include<iomanip>
using namespace std;
typedef long long ll;
ll inf = 100000000;
ll v[205];
ll x[20000005];
ll a[10000005];
ll dp[10005][10005];
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
typedef pair<ll, ll> P;
double q[200005];
ll gcd(ll a, ll b) {
	return b ? gcd(b, a % b) : a;
}

int main() {
	ll n, m;
	cin >> n >> m;
	cout << abs((n - 2) * (m - 2)) << endl;
	return 0;
}

Measured memory_bytes: 256
//=====================================================
// 
// (setq backup-inhibited t)
// (setq auto-save-default nil)
// 
// (column-number-mode t)
// (setq-default tab-width 2 indent-tabs-mode nil)
// 
// (global-set-key "\C-h" 'delete-backward-char)
// 
// (setq indent-line-function 'indent-relative-maybe)
// (global-set-key "\C-m" 'newline-and-indent)
// 
//=====================================================

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

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

using namespace std;

int main() {
  vector<int> p(1000001,1);
  p[0] = p[1] = 0;
  for(int i = 2; i<=1000; ++i) {
    if(p[i]==1){
      for(int j = i*i;j<=1000000;j+=i){
        p[j]=0;
      }
    }
  }
  while(1){
    int m,n;
    cin>>m>>n;
    if(!n)break;
    vector<vector<int>> cv(1000,vector<int>(1000));
    int k=1000000;
    int i=0;
    int j=0;
    int di[]={0,-1,0,1};
    int dj[]={-1,0,1,0};
    int r=2;
    while(k>0){
      cv[i][j] = k;
      int ni = i+di[r];
      int nj = j+dj[r];
      if(ni<0||ni>=1000||nj<0||nj>=1000){
        ++r;
        r%=4;
        ni = i+di[r];
        nj = j+dj[r];
      }
      if(cv[ni][nj] != 0){
        ++r;
        r%=4;
        ni = i+di[r];
        nj = j+dj[r];
      }
      i=ni;j=nj;
      --k;
    }
    int si=0,sj=0;
    REP(i,1000){
      REP(j,1000){
        if(cv[i][j]==n){
          si=i;
          sj=j;
        }
      }
    }
    REP(i,1000){
      REP(j,1000){
        if(p[cv[i][j]]==0||cv[i][j]>m||(i+j)<(si+sj)||(i-j)<(si-sj))
          cv[i][j]=0;
      }
    }
    vector<vector<pair<int,int>>> dp(1000,vector<pair<int,int>>(1000));
    REP(i,999){
      REP(j,1000){
        if(cv[i][j]!=0){
          ++dp[i][j].first;
          dp[i][j].second=cv[i][j];
        }
        if(j>0){
          dp[i+1][j-1] = max(dp[i+1][j-1],dp[i][j]);
        }
        dp[i+1][j]=max(dp[i+1][j],dp[i][j]);
        if(j<999){
          dp[i+1][j+1] = max(dp[i+1][j+1],dp[i][j]);
        }
      }
    }
    REP(j,1000){
      if(cv[999][j]!=0){
        ++dp[999][j].first;
        dp[999][j].second=cv[999][j];
      }
    }
    pair<int,int> mx(0,0);
    REP(i,1000)
      REP(j,1000)
        mx=max(mx,dp[i][j]);
    cout << mx.first << ' ' << mx.second << endl;
  }
  return 0;
}

Measured memory_bytes: 16856
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include<stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
long nCr(int n, int r) {
	int ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

signed main() {
	int n, a, b;
	cin >> n >> a >> b;
	if (n % 12 == 0)cout << a << ' ' << b << endl;
	elif(n % 12 == 1)cout << a - b << ' ' << b << endl;
	elif(n % 12 == 2)cout << a - b << ' '<<a << endl;
	elif(n % 12 == 3)cout << 0-b << ' ' << a << endl;
	elif(n % 12 == 4)cout << 0-b << ' '<<a - b << endl;
	elif(n % 12 == 5)cout << 0-a << ' '<<a - b << endl;
	elif(n % 12 == 6)cout << 0-a << ' ' << 0- b << endl;
	elif(n % 12 == 7)cout << 0-a+b << ' ' << 0- b << endl;
	elif(n % 12 == 8)cout << 0-a+b << ' ' <<0-a<< endl;
	elif(n % 12 == 9)cout << b << ' ' << 0-a << endl;
	elif(n % 12 == 10)cout << b << ' ' << 0-a+b << endl;
	elif(n % 12 ==11)cout << a << ' ' << 0-a+b << endl;
}


Measured memory_bytes: 3124
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
    
    string s; cin>>s;
    
    if(s.size()%2==1){
        cout<<"No"<<endl;
        return 0;
    }
    
    REP(i,s.size()/2){
        if(!((s[i]=='p'&&s[s.size()-1-i]=='q')||
             (s[i]=='q'&&s[s.size()-1-i]=='p')||
             (s[i]=='b'&&s[s.size()-1-i]=='d')||
             (s[i]=='d'&&s[s.size()-1-i]=='b'))){
            cout<<"No"<<endl;
            return 0;
        }
    }
    
    cout<<"Yes"<<endl;
    return 0;
}


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





void solve(long long N, long long A, long long B, vector<long long> P){
    int cnt[3]={0};
    
    for(auto i :P)
    {
        if(i<=A){
            cnt[0]++;
        }else if(i<=B){
            cnt[1]++;
        }else{
            cnt[2]++;
        }
    }
    cout<<min(cnt[0],min(cnt[1],cnt[2]))<<endl;
    
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    vector<long long> P(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&P[i]);
    }
    solve(N, A, B, P);
    return 0;
}


Measured memory_bytes: 256
"use strict";

main(require("fs").readFileSync("/dev/stdin", "utf8"));

function main(input) {
  const [n, ...a] = input.trim().split("\n").map(Number);

  const map = new Map();

  a.forEach(e => {
    if(map.has(e)) {
      map.delete(e);
    } else {
      map.set(e, true);
    }
  });
  const ans = map.size;
  console.log(ans);
}

Measured memory_bytes: 34892
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  ll x,y;
  cin>>x>>y;
  if(x==-y)
    cout<<"1"<<endl;
  else if(x*y>0 &&x>y)
    cout<<abs(abs(x)-abs(y))+2<<endl;
  else if(x*y<0)
    cout<<abs(abs(x)-abs(y))+1<<endl;
  else if(x==0)
    cout<<abs(y)+(y<0)<<endl;
  else if(y==0)
    cout<<abs(x)+(x>0)<<endl;
  else
    cout<<abs(abs(x)-abs(y))<<endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<list>
#include<cstring>
#include<stack>
#include<string>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
const int maxn = 100100;
int arr1[maxn], arr2[maxn];
int main()
{
	int p, q;
	scanf("%d", &p);
	for (int i = 1; i <= p; i++)
		scanf("%d", &arr1[i]);
	scanf("%d", &q);
	for (int i = 1; i <= q; i++)
		scanf("%d", &arr2[i]);
	sort(arr1 + 1, arr1 + p + 1);
	sort(arr2 + 1, arr2 + q + 1);
	int ans = 0;
	for (int i = 1; i <= q; i++)
	{
		int l = 1, r = p;
		while (l <= r)
		{
			int m = (l + r) / 2;
			//cout << m << endl;
			if (arr1[m] == arr2[i])
			{
				ans++;
				break;
			}
			else if (arr2[i] > arr1[m])
				l = m + 1;
			else
				r = m - 1;
		}
	}
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 3836
#include <stdio.h>

int main(void)
{
    long a=0,n=0,k=0,q=0;
    long point[100000]={};
    scanf("%d %d %d",&n,&k,&q);
    for(int i=0;i<q;i++){
        scanf("%ld",&a);
        point[a-1]+=1;
    }
    for(int i=0;i<n;i++){
        if(k+point[i]-q>0) printf("Yes\n");
        else printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 2420
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		bool flag = true;
		string str2 = "keyence";
		int j = 0;
		for(var i=0;i<str.Length;i++){
			if(str[i]==str2[j]){
				j++;
				if(j==7){
					break;
				}
			} else {
				break;
			}
		}
		int j2=6;
		for(var i=str.Length-1;i>=0;i--){
			if(str[i]==str2[j2]){
				j2--;
				if(j2==-1){
					break;
				}
			} else {
				break;
			}
		}
		if(j2<j){
			Console.WriteLine("YES");
		} else {
			Console.WriteLine("NO");
		}
	}
}

Measured memory_bytes: 13140
#include<stdio.h>
int main(void){

  int a,i,sum=0;

  for(i=0;i<5;i++){
    scanf("%d",&a);

    if(a<40){

      sum = sum + 40;

    }

    else{

      sum = sum + a;

  }
  }

  printf("%d",sum/5);

  printf("\n");

  return 0;
}
      

Measured memory_bytes: 604
#include<bits/stdc++.h>
#define rep(m,x,r) for((m)=(x);(m)<(r);(m)++)
#define min(a,b) ((a)<(b)?(a):(b))
#define MOD 2019
using namespace std;
int main(){
    long long l,r,a,b,m,n,ans=10e9;
    cin>>l>>r;
    a=l/MOD;
    b=r/MOD;
    l%=MOD;
    r%=MOD;
    if(a==b){
        for(m=l;m<r;m++){
            for(n=l+1;n<=r;n++){
                ans=min(ans,(m*n)%MOD);
            }
        }
    }
    else {
        cout<<"0"<<endl;
        return 0;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class C
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var NX = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var (N, X) = (NX[0], NX[1]);
            var A = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var answer = 0L;
            for (var i = 1; i < A.Length; i++)
            {
                var tmp = Math.Max(0, A[i] + A[i - 1] - X);
                answer += tmp;
                A[i] -= tmp <= A[i] ? tmp : A[i];
            }

            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 39476
# include"stdio.h"

int main(){
    char sa[101],sb[101],sc[101];
    scanf("%s",sa);
    scanf("%s",sb);
    scanf("%s",sc);
    int a=0,b=0,c=0;
    char x=sa[0];
    while(1){
          if(x=='a'){
              a++;
              x=sa[a];
              if(x=='\0'){
                  x='A';
                  break;
              }
          }else if(x=='b'){
              x=sb[b];
              b++;
              if(x=='\0'){
                  x='B';
                  break;
              }
          }else if(x=='c'){
              x=sc[c];
              c++;
              if(x=='\0'){
                  x='C';
                  break;
              }
          }
    }
    printf("%c\n",x);
}


Measured memory_bytes: 128
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;
#include <cmath>
#include <iomanip>

const int MOD = 1000000007;


ll POWER(ll x,ll y)
{
	ll ret=1;
	ll p=x;
	for (ll i=y;i>0;i/=2)
	{
		if (i%2) ret=(ret*p)%MOD;
		p=(p*p)%MOD;
	}
	return ret;
}
ll gcm(ll a, ll b)
{
	if (b>a) {ll c=a; a=b; b=c;}
	while (b>0)
	{
		ll r=a%b;
		a=b;
		b=r;
	}
	return a;
}


int main(int argc, char *argv[])
{
	int k;
	string s;
	cin>>k>>s;
	if (s.length()>k)
	{
		cout<<s.substr(0,k)<<"..."<<endl;
	}else{
		cout<<s<<endl;
	}

	return 0;
}



Measured memory_bytes: 3600
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#define N 102
using namespace std;
int n, m;
string s;
int main() {
  int x=0;
  cin>>n>>s;
  int maxv = 0;
  for (int i = 0; i < n; ++i) {
  	if (s[i] =='I') x++;
    else x--;
    maxv = max(maxv, x);
  }
  cout<<maxv<<endl;
	return 0;
}

Measured memory_bytes: 256
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


# 解説
# P で割り切れるなら 10^n で割っても割り切れる。
N, P = list(map(int, sys.stdin.buffer.readline().split()))
S = sys.stdin.buffer.readline().decode().rstrip()


def solve25():
    ans = 0
    for i, c in enumerate(S):
        if int(c) % P == 0:
            ans += i + 1
    return ans


if P in (2, 5):
    ans = solve25()
    print(ans)
    exit()

# U[i]: int(S[i:]) % P
U = [0] * N
n = 0
p = 1
for i, c in reversed(list(enumerate(S))):
    n += int(c) * p
    n %= P
    U[i] = n
    p *= 10
    p %= P

counts = [0] * P
for u in U:
    counts[u] += 1

ans = counts[0]
for i in reversed(range(N)):
    # U[i] を引いたときに 0 (mod P) となる数
    counts[U[i]] -= 1
    ans += counts[U[i]]
print(ans)


Measured memory_bytes: 31772
// -*- coding:utf-8-unix -*-

use proconio::{fastout, input};

// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a

#[fastout]
fn main() {
    input! {
        x: usize,
    }
    let kyu = 8 - (x - 400) / 200;
    println!("{}", kyu);
}


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

int N,M;

void solve(){
  cin >> N >> M;
  int s = M;
  int res = 0;
  for(int i = 0 ; i < N ; i++){
    int in,out;
    cin >> in >> out;
    res = max(res,s);
    s += in;
    s -= out;
    if(s < 0){
      cout << 0 << endl;
      return;
    }
  }
  res = max(res,s);
  cout << res << endl;
}

int main(){
  solve();
  return 0;
}

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

int main()
{
	char x, y;

	cin >> x >> y;

	if( x < y ) {
		cout << "<" << endl;
	}
	else if( x > y ) {
		cout << ">" << endl;
	}
	else {
		cout << "=" << endl;
	}

	return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  for(int j = 1; j <= min(a,b); ++j) {
    int i = min(a,b)/j;
    if(a % i == 0 && b % i == 0) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main(){
  char s[11];
  char a[11];
  int i;
  int c=0;
  for(i=0;i<11;i++)a[i]='\0';
  scanf("%s",s);
  for(i=0;i<10;i++){if(s[i]!='B'){a[c]=s[i];c++;}else{c=c==0?0:c-1;a[c]='\0';}}
  printf("%s",a);
}

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

int main() {

	int x[3],i,j,k;

	for (i = 0; i < 3; i++) {
		cin >> x[i];
	}

	for (i = 0; i < 3; i++) {
		for (j = 0; j < 2; j++) {
			if (x[j] < x[j + 1]) {
				k = x[j];
				x[j] = x[j + 1];
				x[j + 1] = k;
			}
		}
	}

	cout << x[0] * 10 + x[1] + x[2];

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
#define double long double
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
#define eps 1e-12 
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int t; cin >> t;
	while (t--) {
		int N; cin >> N;
		vector<VI>pos1(N + 10), pos2(N + 10);
		int ans = 0;
		PQ Q;
		REP(i, N) {
			int k, l, r; cin >> k >> l >> r;
			k--;
			if (l >= r)pos1[k].push_back(r - l);
			else pos2[k + 1].push_back(l - r);

			ans += min(r, l);
		}
		REP(i, N) {
			fore(j, pos1[i])Q.push(j);
			while (Q.size() > i + 1) {
				Q.pop();
			}
		}
		while (!Q.empty()) {
			ans -= Q.top();
			Q.pop();
		}
		for (int i = N - 1; i >= 0; i--) {
			fore(j, pos2[i])Q.push(j);
			while (Q.size() > N - i) {
				Q.pop();
			}
		}
		while (!Q.empty()) {
			ans -= Q.top();
			Q.pop();
		}
		cout << ans << '\n';
	}


	return 0;
}



Measured memory_bytes: 18368
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;



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

	long long l0 = 2, l1 = 1, l2 = 0;
	int n;
	cin >> n;

	if (n == 1) {
		cout << l1;
		return 0;
	}

	for (int i = 2; i <= n; ++i) {
		l2 = l0 + l1;
		long long aux = l2;
		l0 = l1;
		l1 = aux;
	}

	cout << l2;
	
	//system("pause");

	return 0;
}

Measured memory_bytes: 256
open Batteries
module EnumL = Enum.Labels
module ListL = List.Labels
module ArrayL = Array.Labels

let dbg0 x = Printf.eprintf "[debug]%s\n" @@ dump x
let dbg1 x = dbg0 x; x

let id = identity

let (++) n m = List.range n `To m
let (++-) n m = if n >= m then List.range n `Downto m else []
let (++^) n m = if n < m then List.range n `To (pred m) else []

module ModOp = struct
  let prime = 1_000_000_007
  let (-) a b = (a + prime - b) mod prime
  let (+) a b = (a + b) mod prime
  let ( * ) a b = (a * b) mod prime

  let rec pow x n =
    if n = 0 then 1
    else if n mod 2 = 0 then pow (x*x) (n/2)
    else x * pow (x*x) (n/2)
end

let scan fmt = Scanf.sscanf (read_line ()) fmt

let scan_lines n fmt f =
  if n = 0 then []
  else List.map (fun _ -> scan fmt f) (1 ++ n)

let scan_list ?sep cnv =
  let line = read_line () in
  (match sep with
   | None -> List.map String.of_char @@ String.to_list line
   | Some sep -> String.split_on_char sep line)
  |> List.map cnv

let scan_array ?sep cnv = Array.of_list @@ scan_list ?sep cnv

let scan_matrix n m e ?sep conv =
  let arr = Array.make_matrix n m e in
  ListL.iter (0 ++^ n)
    ~f:(fun i -> arr.(i) <- Array.of_list @@ scan_list ?sep conv);
  arr

let atoi c = Char.code c - Char.code '0'

let rec powerset = function
  | [] -> [[]]
  | hd::tl ->
    let pws =  powerset tl in
    pws @ ListL.map pws ~f:(fun pw -> hd::pw)

let permutations l =
  let rec interleave x = function
    | [] -> [[x]]
    | (hd::tl) as l ->
      (x::l) :: (interleave x tl |> ListL.map ~f:(fun l -> hd::l)) in
  let rec aux = function
    | [] -> [[]]
    | a::rest ->
      aux rest |> ListL.map ~f:(interleave a) |> List.concat in
  aux l

let intersection l =
  EnumL.filter ~f:(fun x -> EnumL.exists ~f:((=) x) @@ Enum.clone l)

let zip l m =
  let n = min (List.length l) (List.length m) in
  List.combine (List.take n l) (List.take n m)

let lower_bound n f =
  let rec aux l u =
    if u - l > 1 then
      let m = (l + u) / 2 in
      if f m then aux l m
      else aux m u
    else u in aux (-1) n

let between n x m = n <= x && x < m

let s = scan "%s" id
let t = scan "%s"  id

let () =
  if s = String.sub t 0 (String.length t -1) then
    Printf.printf "Yes\n"
  else Printf.printf "No\n"


Measured memory_bytes: 5364
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend();
#define sz  size()
#define fr(i,a,b) for(int i=a ;i <= b ; i++ )
#define frr(i,a,b) for(int i=a ;i >= b ; i-- )
#define inp ios_base::sync_with_stdio(false);cin.tie(NULL);
#define PQ_INC vector<int>, greater<int>   //priority_queue
using namespace std ;

ll  lcm(ll a, ll  b){
 return a / __gcd(a,b) * b ;
}

const int N = 3e5 + 9 ,  MOD = 1e9+7 , OO = 0x3f3f3f3f ;
int dX[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dY[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
ll l , r  , mn = 1e12 , x  , be , af ;
int main(){
    cin >> l >> r ;
     for (int i = 0 ; i < 1e6 ; i++ ){
         if (l <= i*2019 && r >= i*2019 ) return cout << 0 , 0 ;
     }
     for (ll i = l ; i <= r ; i++ )
            for (ll j = i+1 ; j <= r ; j++) mn = min (mn , (i*j) %2019 ) ;
  cout << mn ;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
#define srand() mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(l,r) uniform_int_distribution<int>(l,r)(rng)
typedef unsigned long long ull;
const int inf=1039074182;
const int mod=1000000007;
using namespace std;
int n,k;
int a[2005];

int main()
{
//	freopen("input.txt","r",stdin);
	cin>>n>>k;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int s=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<i;j++)
		{
			if(a[j]>a[i]) s++;
		}
	}
	sort(a,a+n);
	int t=0,p=0;
	for(int i=n-1;i>=0;i--)
	{
		t+=p;
		if(i && a[i]==a[i-1]) continue;
		p=n-i;
	}
	cout<<(1LL*s*k+t*((1LL*k*(k-1)/2)%mod))%mod<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; ++i) {
			A[i] = sc.nextInt();
		}
		int[] c = new int[N];
		for (int i = 0; i < M; ++i) {
			int B = sc.nextInt();
			for (int j = 0; j < N; ++j) {
				if (A[j] <= B) {
					c[j]++;
					break;
				}
			}
		}
		int max = 0;
		int mi = 0;
		for (int i = 0; i < N; ++i) {
			if (c[i] > max) {
				max = c[i];
				mi = i;
			}
		}
		System.out.println(mi + 1);
	}

}

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

int main(){
	int dataset = 1, w;
	while (cin >> w, w){
		int dp[1001], n, treas_val[1000], treas_w[1000], ans_val = 0, ans_w;
		for (int i = 0; i <= w; i++){
			dp[i] = -1;
		}
		cin >> n;
		for (int i = 0; i < n; i++){
			scanf("%d,%d", &treas_val[i], &treas_w[i]);
		}
		dp[0] = 0;
		for (int i = 0; i < n; i++){
			for (int j = w; j >= 0; j--){
				if (dp[j] == -1) continue;
				if (j + treas_w[i] <= w && dp[j + treas_w[i]] < dp[j] + treas_val[i])
					dp[j + treas_w[i]] = dp[j] + treas_val[i];
			}
		}
		for (int i = 0; i <= w; i++){
			if (ans_val < dp[i]){
				ans_val = dp[i];
				ans_w = i;
			}
		}
		printf("Case %d:\n%d\n%d\n", dataset, ans_val, ans_w);
		dataset++;
	}
	return 0;
}

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

int main()
{
    long K; cin>>K;
    int n=50;
    vector<long> a(n);
    for(int i=0; i<n; ++i) a[i]=K/n+i;
    K%=n;
    for(int i=0; i<K; ++i) {
        a[i]+=n;
        for(int j=0; j<n; ++j) if (i!=j) --a[j];
    }
    cout<<n<<endl;
    for(auto e: a) cout<<e<<' ';
    cout<<endl;
}


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

long long fre[200005] = {0}, a[200005];

// Driven Program
int main()
{
	int n;
	cin>>n;
	for(int i = 0; i<n; i++)
    {
        cin>>a[i];
        fre[a[i]]++;
    }
    long long ans = 0;
    for(int i = 0 ; i<=200000; i++)
    {
        ans = ans + (fre[i] * (fre[i] - 1)) /2;
    }
    for(int i = 0; i<n; i++)
    {
        long long ac = ans  - (fre[a[i]] * (fre[a[i]] - 1)) /2 ;
        if(fre[a[i]]>0)
        {
          ac = ac + ((fre[a[i]] - 1) * (fre[a[i]] - 2)) /2;
          cout<<ac<<endl;
        }

    }
	return 0;
}


Measured memory_bytes: 4736
//AtCoder Regular Contest 063 A問題
#include <bits/stdc++.h>
using namespace std;

int main(){
	double a,b,c;
	scanf("%lf%lf%lf", &a,&b,&c);
	if((a+b+c)/2 == a || (a+b+c)/2 == b || (a+b+c)/2 == c){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int x=in.nextInt();
		int a[][]=new int[2][x];
		
		for(int i=0;i<2;i++) {
			for(int j=0;j<x;j++) {
				a[i][j]=in.nextInt();
			}
		}
		int b[]=new int[x];
		for(int i=0;i<x;i++) {
			for(int j=0;j<x;j++) {
				if(i==j){
		            b[i]+=(a[0][j]+a[1][j]);
		        }
		        if(i>j){
		            b[i]+=a[0][j];
		        }
		        if(i<j){
		            b[i]+=a[1][j];
		        }
			}
		}
		int max=b[0];
	    for(int i=0;i<x;i++){
	        if(b[i]>max)max=b[i];
	    }
	    System.out.println(max);
	}

}

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

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string S;
    int i,tmp=0;
    cin >> S;
    if(S[0] == 'A') {
        for (i = 2; i < S.size() - 1; i++)
            if (S[i] == 'C') { tmp++; }
        if (tmp == 1) {
            tmp = 0;
            for(i=0;i<S.size();i++)
                if('A' <= S[i] && S[i] <= 'Z'){tmp++;}
            if(tmp ==2)
                tmp =-1;
        }
    }
    if(tmp ==-1){cout << "AC";}
    else cout << "WA";
    return 0;
}

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

using ll = long long;

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

    ll ans = -1;
    if ((b - a) % 2 == 0) ans = (b - a) / 2;
    else {
        if (a > n - b + 1) {
            ll temp = a;
            a = n - b + 1;
            b = n - temp + 1;
        }
        
        if (b - a == 1) ans = a;
        else ans = a + (b - a - 1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2+5;
const int mod = 1e9+7;
int n;
vector<int> g[6][6][6];
int f[maxn][6][6][6];
//A:1 C:2 G:3 T:4
bool check(vector<int> v) {
	for (int i = 0; i < 2; i++) {
		if (v[i] == 1 && v[i+1] == 3 && v[i+2] == 2) return false;
	}
	for (int j = 0; j < 3; j++) {
		swap(v[j],v[j+1]);
		for (int i = 0; i < 2; i++) {
			if (v[i] == 1 && v[i+1] == 3 && v[i+2] == 2) return false;
		}
		swap(v[j],v[j+1]);
	}
	return true;
}
void init(){
	for (int i = 1; i <= 4; i++) {
		for (int j = 1; j <= 4; j++) {
			for (int k = 1; k <= 4; k++) {
				for (int l = 1; l <= 4; l++) {
					vector<int> vec;
					vec.push_back(i); vec.push_back(j); vec.push_back(k); vec.push_back(l);
					if (check(vec)) g[i][j][k].push_back(l);
				}
			}
		}
	}
	for (int i = 1; i <= 4; i++) {
		for (int j = 1; j <= 4; j++) {
			for (int k = 1; k <= 4; k++) {
				f[3][i][j][k] = 1;
			}
		}
	}
	f[3][1][3][2] = f[3][3][1][2] = f[3][1][2][3] = 0;
}

int main() {
	scanf("%d",&n);
	init();
	for (int i = 3; i < n; i++) {
		for (int j = 1; j <= 4; j++) {
			for (int k = 1; k <= 4; k++) {
				for (int l = 1; l <= 4; l++) {
					for (int sz = 0; sz < g[j][k][l].size(); sz++) {
						int c = g[j][k][l][sz];
						f[i+1][k][l][c] = (f[i+1][k][l][c] + f[i][j][k][l])%mod;
					}
				}
			}
		}
	}
	int ret = 0;
	for (int i = 1; i <= 4; i++) {
		for (int j = 1; j <= 4; j++) {
			for (int k = 1; k <= 4; k++) {
				ret = (ret+f[n][i][j][k])%mod;
			}
		}
	}
	printf("%d\n",ret);
	return 0;
}

Measured memory_bytes: 3828
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
    char s[3];
    scanf("%s",s);
    if(s[1]==s[0]){printf("No\n");return 0;}
    if(s[0]+s[1]+s[2]=='a'+'b'+'c'){printf("Yes\n");return 0;}
    else {printf("No\n");return 0;}
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdlib.h>
#include<cmath>
using namespace std;

int main(){
	int N;
	cin>>N;
	int h[N];
	for(int i=0;i<N;++i){
		cin>>h[i];
	}
	int cost[N];
	cost[0] = 0;
	cost[1] = abs(h[1] - h[0]);
	for(int i=2;i<N;++i){
		cost[i] = min(cost[i-1] + abs(h[i] - h[i-1]), cost[i-2] + abs(h[i] - h[i-2]));
	}
	cout<<cost[N-1]<<endl;
}


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

typedef long long ll;
typedef long double ld;
const ll M=1e9+7;
const ll MAXN=1e6+7;
const ld pi=acos(-1);

#define gi(n) ll n=read()
#define endl '\n'
#define rep(i,a,b) for(ll i=a; i<b; ++i)
#define per(i,a,b) for(ll i=b-1; i>=a; --i)

typedef vector<ll> V;
typedef vector<V> VV;
typedef set<ll> S;
typedef pair<ll,ll> pl;
typedef vector<pl> Vp;

#define all(v) v.begin(),v.end()
#define pb push_back
#define fs first
#define sc second

inline ll read(){
	ll x=0,ff=1;
	char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-') ff=-1;ch=getchar();}
	while(isdigit(ch)) {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
	return x*ff;
}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll pow1(ll p,ll d, ll P){return d?(pow1(p*p%P,d>>1,P)*(d&1?p:1))%P:1;}

V prime;
bool is_composite[MAXN];
void sieve (ll n){
	std::fill (is_composite, is_composite + n, false);
	rep(i,2,n){
		if(!is_composite[i]) prime.pb(i);
		for(ll j = 0; j < prime.size() && i*prime[j] < n; ++j){
			is_composite[i*prime[j]] = true;
			if(i % prime[j] == 0) break;
		}
	}
}
ll modInverse(ll a, ll m){
	ll m0=m,y=0,x=1;
	if(m==1) return 0;
	while(a>1){
		ll q=a/m,t=m;
		m=a%m;
		a=t; 
		t=y;

		y = x-q*y; 
		x = t;
	}
	if(x<0) x += m0;
	return x; 
}

void doit(){
	char c;
	cin>>c;
	cout<<(c>96?'a':'A');
}
int main(){
//	for(gi(t);t--;cout<<endl)
		doit();
	return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <algorithm>
#include <set>
#include <utility>

typedef long long int64;
static const int64 INF = 1LL << 61;
static const int MAXN = 5004;

static int n;
static std::pair<int, int> p[MAXN];
static int64 f[MAXN];

inline bool cmp(const std::pair<int, int> &lhs, const std::pair<int, int> &rhs)
{
    return lhs.first + lhs.second < rhs.first + rhs.second;
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) scanf("%d%d", &p[i].first, &p[i].second);
    std::sort(p, p + n, cmp);

    f[0] = 0;
    for (int i = 1; i < MAXN; ++i) f[i] = INF;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j >= 1; --j) {
            if (f[j - 1] <= p[i].first) {
                f[j] = std::min(f[j], f[j - 1] + p[i].second);
            }
        }
    }

    for (int i = MAXN - 1; i >= 0; --i)
        if (f[i] < INF / 2) { printf("%d\n", i); break; }

    return 0;
}


Measured memory_bytes: 256
//{{{
#include<algorithm>
#include<cmath>
#include<deque>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(printde) FUNC(printdbe) FUNC(printdwe) FUNC(printdu);
#endif
template <template <class T, class = std::allocator<T>> class V, class E>
istream& operator >> (istream& in, V<E>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int n; cin >> n;
    unordered_map<string, int> mp;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        string s; cin >> s;
        sort(s.begin(), s.end());
        ans += mp[s];
        mp[s]++;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 7328