akhauriyash/Code-Regression huggingface dataset:
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
   
#include <x86intrin.h>
#include <bits/stdc++.h>   
 
using namespace std;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define al 0x3F3F3F3F
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;

const double pi = acos (-1.0);
const double eps = 1e-7;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

char s[N];
int cnt[123], ans;
vector < pair <string, pii> > S;

inline void boost () {                    
   ios_base :: sync_with_stdio (NULL);
   cin.tie (NULL), cout.tie (NULL);          
}                                                     

inline void Solve () {
   cin >> s + 1;
   int n = strlen (s + 1);
   for (int i = 1; i <= n; i ++) cnt[s[i]] ++;
   for (int i = 'a'; i <= 'z'; i ++) ans += cnt[i] * (cnt[i] + 1) / 2;
   cout << n * (n + 1) / 2 - ans + 1;
}

main () {                                       
// freopen (".in", "r", stdin);    
// freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}
                          

Measured memory_bytes: 512
n=gets.to_i - 1
a=[1,1,1,0]
b=[1,1,1,0]
def mul a,b
  [a[0]*b[0]+a[1]*b[2], a[0]*b[1]+a[1]*b[3], a[2]*b[0]+a[3]*b[2], a[2]*b[1]+a[3]*b[3]]
end

while n>0
  if n & 1 == 1
    b = mul a,b
  end
  a = mul a,a
  n >>= 1
end
puts b[0]

Measured memory_bytes: 8684
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}



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

  ll K , S ; cin >> K >> S;
  ll ans = 0;
  rep(i,K+1){
    rep(j,K+1){
      ll c = S-i-j;
      if((0<=c) && (c<=K)) ans ++;
    }
  }
  cout << ans << endl;
  
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#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()
#define dump(v) (cerr << #v << ": " << v << endl)
#define cerr                                                                   \
  if (true)                                                                    \
  cerr

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<unsigned long long> vull;

// 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 N, long long A, long long B, long long C, long long D) {

  REP(i, N + 1) {
    ll low = C * (N - 1 - i) - D * i;
    ll up = -C * i + D * (N - 1 - i);
    if (low <= B - A && B - A <= up) {
      cout << "YES" << endl;
      return;
    }
  }

  cout << "NO" << endl;
}

int main() {
  ios::sync_with_stdio(false);
  long long D;
  long long C;
  long long B;
  long long A;
  long long N;
  cin >> N;
  cin >> A;
  cin >> B;
  cin >> C;
  cin >> D;
  solve(N, A, B, C, D);
  return 0;
}


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

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

    rep(i, 1300) {
        if(floor(i*0.08)==a && floor(i*0.10)==b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 256
s = input()
word = s.split("/")
for i in range(3):
    word[i] = int(word[i])
if word[0] <= 2018:
    print('Heisei')
elif word[0] > 2020:
    print('TBD')
else:
    if word[1] <= 4:
        if word[2] <= 30:
            print('Heisei')
        else:
            print('TBD')
    else:
        print('TBD')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> div(2000);
  int id = 0;
  for (int i = 1; i * i <= m; i++)  {
    int q = m / i;
    if (m % i == 0) {
      div[id] = q;
      div[id+1] = i;
      id += 2;
    }
  }
  sort(div.begin(), div.end(), greater<int>());
  int maxdiv = m / n;
  rep(i, 2000) {
    if (div[i] <= maxdiv) {
      cout << div[i] << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include<cstdio>
#include<vector>
std::vector<int> a[100005];
int n,k,cnt,used[100005];
int ans[100005],p[100005],pp[100005],q[100005],qq[100005],g[100005],gg[100005],gk[100005],ggk[100005],f[10][100005],ff[10][100005];
int main()
{
	scanf("%d%d",&n,&k);
	for (int i=1;i<=n;i++) scanf("%d",&p[i]);
	for (int i=1;i<=n;i++) scanf("%d",&q[i]);
	for (int i=1;i<=n;i++) f[0][i]=i;
	for (int i=1;i<=n;i++) ff[0][i]=i;
	for (int i=1;i<=n;i++) f[1][i]=p[i];
	for (int i=1;i<=n;i++) f[2][i]=q[i];
	for (int i=1;i<=n;i++) ff[1][f[1][i]]=i;
	for (int i=1;i<=n;i++) ff[2][f[2][i]]=i;
	for (int r=3;r<=6;r++)
	{
		for (int i=1;i<=n;i++) f[r][i]=f[r-1][ff[r-2][i]];
		for (int i=1;i<=n;i++) ff[r][f[r][i]]=i;
	}
	for (int i=1;i<=n;i++) pp[p[i]]=i;
	for (int i=1;i<=n;i++) qq[q[i]]=i;
	for (int i=1;i<=n;i++) g[i]=q[pp[qq[p[i]]]];
	for (int i=1;i<=n;i++) gg[g[i]]=i;
//	for (int i=1;i<=n;i++) printf("%d ",g[i]);puts("");
	for (int i=1;i<=n;i++)
	    if (!used[i])
	    {
			int x=++cnt;
			used[i]=1;
			a[x].push_back(i);
	    	for (int j=g[i];!used[j];j=g[j])
	    	{
	    		a[x].push_back(j);
	    		used[j]=1;
			}
	    }
	for (int i=1;i<=cnt;i++)
	{
		int sz=a[i].size();
		for (int j=0;j<a[i].size();j++)
		{
			int x=a[i][j],y=a[i][(j+(k-1)/6)%sz];
			gk[x]=y;
		}
	}
//	for (int i=1;i<=n;i++) printf("%d ",gk[i]);puts("");
	for (int i=1;i<=n;i++) used[i]=0;
	for (int i=1;i<=cnt;i++) a[i].clear();cnt=0;
	for (int i=1;i<=n;i++)
	    if (!used[i])
	    {
			int x=++cnt;
			used[i]=1;
			a[x].push_back(i);
	    	for (int j=gg[i];!used[j];j=gg[j])
	    	{
	    		a[x].push_back(j);
	    		used[j]=1;
			}
	    }
	for (int i=1;i<=cnt;i++)
	{
		int sz=a[i].size();
		for (int j=0;j<a[i].size();j++)
		{
			int x=a[i][j],y=a[i][(j+(k-1)/6)%sz];
			ggk[x]=y;
		}
	}
	for (int i=1;i<=n;i++) used[i]=0;
	for (int i=1;i<=cnt;i++) a[i].clear();cnt=0;
	for (int i=1;i<=n;i++) ans[i]=gk[f[(k-1)%6+1][ggk[i]]];
	
	for (int i=1;i<=n;i++) printf("%d ",ans[i]);
	puts("");
	return 0;
}

Measured memory_bytes: 15088
#include<iostream>
using namespace std;
int main()
{
    int n,a=0,b=0,c=0,d=0;
    char s[5];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%s",s);
        if(s[0]=='A')
        {
            a++;
        }
        else if(s[0]=='W')
        {
            b++;
        }
        else if(s[0]=='T')
        {
            c++;
        }
        else
        {
            d++;
        }
    }
    printf("AC x %d\n",a);
    printf("WA x %d\n",b);
    printf("TLE x %d\n",c);
    printf("RE x %d\n",d);
    return 0;
}


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

int storex[107];
int storey[107];
int N;

int main()
{
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> storex[i];
    for (int i = 1; i <= N; i++) cin >> storey[i];

    int sum = 0;
    int A = 0;
    for (int i = 1; i <= N; i++) {
        A += storex[i];
        int tmp = A;
        for (int j = i; j <= N; j++) {
            int B = storey[j];
            tmp += B;
        }
        sum = max(sum, tmp);
    }

    cout << sum << endl;
}


Measured memory_bytes: 256
import sys
readline = sys.stdin.readline

n = int(input())
a = [int(i) for i in readline().split()]

ans = 0

# 各要素について素因数分解を行い、2の乗数が答えになる
for i in a:
    num = 1
    while (i % 2 ** num) == 0:
       ans += 1
       num += 1

print(ans)

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

const int N = 2e3 + 10, mod = 1e9 + 7;
typedef long long ll;
ll n, K;
ll fac[N * N], f[N][N], inv[N * N];

ll quick_pow(ll a, ll b) {
    ll ret = 1;
    for (; b; b >>= 1) {
        if (b & 1) ret = ret * a % mod;
        a = a * a % mod;
    } return ret;
}

void pre() {
    fac[0] = inv[0] = 1;
    rep(i, 1, n * K) fac[i] = fac[i - 1] * i % mod;
    inv[n * K] = quick_pow(fac[n * K], mod - 2);
    for (int i = n * K - 1; i >= 1; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}

ll C(ll n, ll m) { return fac[n] * inv[m] % mod * inv[n - m] % mod; }

ll upd(ll x, ll y) { return (x + y) % mod; }

int main() {
    cin >> n >> K;
    if (K == 1) { puts("1"); return 0; }
    pre();
    rep(i, 1, n) f[i][0] = 1;
    rep(i, 1, n)
        rep(j, 1, i) {
            f[i][j] = upd(f[i - 1][j], (n - j + 1) * f[i][j - 1] % mod * C((n - j + 1) * (K - 1) + n - i - 1, K - 2) % mod);
        }
    printf("%lld\n", f[n][n]);
    return 0;
}


Measured memory_bytes: 94592
#include <bits/stdc++.h>
#define mem(a, b) memset(a, b, sizeof(a))
#define inf (1e9 + 7)
#define eps (1e-8)
#define pi acos(-1)
using namespace std;
typedef long long LL;
const LL mod = (1e9 + 7);

char ch[55];

int main()
{
    scanf("%s", ch + 1);
    int len = strlen(ch + 1);
    len -= 8;
    for(int i = 1;i <= len;i++)
        printf("%c", ch[i]);
    puts("");
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<set>
#include<utility>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> p;
typedef unsigned long long int ull;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
const int MAXN=100000;
const int MAXE=100000;
const int MAXV=10000;
const int INF=2e9;
const ll MOD=1e9+7;

ll T1,T2;
ll A1,A2;
ll B1,B2;

int main(){
    cin>>T1>>T2;
    cin>>A1>>A2;
    cin>>B1>>B2;
    if(A1>B1){
        swap(A1,B1);swap(A2,B2);
    }
    ll P=T1*(A1-B1),Q=T2*(A2-B2);
    if(P+Q<0){
        cout<<0<<endl;
        return 0;
    }else if(P+Q==0){
        cout<<"infinity"<<endl;
        return 0;
    }
    ll T=(-P)%(P+Q);
    if(T==0){
        cout<<2*((-P)/(P+Q))<<endl;
    }else{
        cout<<2*((-P)/(P+Q))+1<<endl;
    }
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <string>
#include <cmath>
#include <iomanip>
#include <cstdio>
using namespace std;

typedef long long ll;

const int maxn = 1e5+5;
int N,M;
int pre[maxn];
int size[maxn];
ll ans[maxn];
int l[maxn];
int r[maxn];

int find(int x)
{
    return x == pre[x] ? x : pre[x] = find(pre[x]); //这里一开始写错了，写成了x = find。。
}

void join(int a, int b)
{
    a = find(a), b = find(b);
    if(a != b)
    {
        size[a] += size[b];
        size[b] = 0;
       pre[b] = a;
    }
}
int main(){
	cin>>N>>M;

	for(int i=0;i<maxn;i++)
		pre[i] = i,size[i]=1;
	 memset(ans, 0, sizeof(ans));
		
	for(int i=1;i<=M;i++)
		scanf("%d%d", &l[i], &r[i]);
	ll cnt = N;
	ans[M+1] = cnt*(cnt-1)/2;
	for(int i = M;i>=2;i--){
		int x = find(l[i]);
		int y = find(r[i]);
		if(x!=y){
			ans[i] = ans[i+1]-size[x]*size[y];
			join(l[i],r[i]);
		}
		else 
			ans[i] = ans[i+1];
	}
	
	for(int i=2;i<=M+1;i++)
		  printf("%lld\n", ans[i]);
	
	return 0;
}

Measured memory_bytes: 3712
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:https://agc003.contest.atcoder.jp/tasks/agc003_b>
問題文============================================================
 高橋君は 1 から N までの整数のうちのどれかが書かれたカードをたくさん持っています。
 高橋君は整数 i が書かれたカードを Ai 枚持っています。
 
 2 枚のカードについて、それらに書かれた整数の差の絶対値が 1 以下のとき、これらをペアにすることができます。
 
 高橋君は、同じカードが複数のペアに使われないように、できるだけ多くのペアを作りたいです。
 高橋君が作れるペアの個数の最大値を求めてください。
 
=================================================================

解説=============================================================
 
================================================================
*/
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    ll N; cin >> N;
    vector<ll> A(N);
    for(auto&in:A) cin >> in;
    vector<ll> tA(A);
    
    ll cntl = 0;
    for(int i = 0; i < N - 1;i++){
        cntl += A[i]/2;
        A[i] -= A[i]/2 * 2;
        ll minv = min(A[i],A[i+1]);
        cntl += minv;
        A[i] -= minv; A[i+1] -= minv;
    }
    cntl += A[N-1]/2;
    
    A = tA;
    
    ll cntr = 0;
    for(int i = N - 1; i > 0; i--){
        cntr += A[i]/2;
        A[i] -= A[i]/2 * 2;
        ll minv = min(A[i],A[i-1]);
        cntr += minv;
        A[i] -= minv; A[i-1] -= minv;
    }
    cntr += A[0]/2;
    cout << max(cntl,cntr) << endl;
	return 0;
}


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

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

}

Measured memory_bytes: 3612
#include<cstdio>
#include<functional>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cctype>
#define rep(i,a) for(i=0;i<a;i++)
#define kk 26
using namespace std;
typedef pair<char,int> P;
int main(void)
{
	FILE *fp;
	int i,j,k;
	P data[27];
	char cc[27]={"abcdefghijklmnopqrstuvwxyz"};
	char mozi;
	string ss;
	rep(i,kk){data[i].first=cc[i];data[i].second=0;}
	while(scanf("%c",&mozi)!=EOF) {
		rep(j,kk) {
			if(data[j].first==mozi || 
				data[j].first==tolower(mozi)) {
					data[j].second++;
					break;
			}
		}
	}
	rep(i,kk) cout<<data[i].first<<" : "<<data[i].second<<endl;
	return 0;
}

Measured memory_bytes: 3088
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
using namespace std;
// clang-format on

template<typename InputIterator> constexpr std::string join(InputIterator first, InputIterator last, const std::string &sep) {
  if (first == last) return "";
  std::stringstream ss;
  ss << *(first++);
  for_each(first, last, [&](auto &x) { ss << sep << x; });
  return ss.str();
}

main {
  int n;
  cin >> n;
  vi a(n);
  cin >> a;
  int c = 0;
  bool flag = true;
  while (flag) {
    flag = false;
    for (int j = n - 1; j >= 1; j--) {
      if (a[j] < a[j - 1]) {
        swap(a[j], a[j - 1]);
        c++;
        flag = true;
      }
    }
  }
  cout << join(all(a), " ") << endl;
  cout << c << endl;
}

Measured memory_bytes: 3200
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int y = sc.nextInt();
		
		// 計算
		String result = "-1 -1 -1";
		int a = y/10000;
		int b = (y%10000)/5000;
		int c = (y%5000)/1000;
		
		for(int i = 0; i <= a; i++){
		    for(int j = 0; j <= b + (a - i)*2; j++){
		        int k = c + (b + (a - i)*2 - j)*5;
		        if(i + j + k == n){
		            System.out.println(i + " " + j + " " + k);
		            return;
		        }
		    }
		}
		
		// 出力
		System.out.println(result);
	}
}



Measured memory_bytes: 23124
s = input()
n = len(s)
t = input()
m = len(t)
ans = []

for i in range(n-m+1):
    for j in range(m):
        if s[i+j] not in [t[j] , "?"]:
            break
        elif j == m-1:
            res = s[:i]+t+s[i+m:]
            ans.append(res.replace("?","a"))

if not ans:
    ans.append("UNRESTORABLE")

print(min(ans))

Measured memory_bytes: 9072
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr = (input.trim()).split("\n");

const binarySearch = (key, arr, N) => {
  let mid;
  let left = 0;
  let right = N;
  if (key < arr[0] || arr[N-1] < key) return 0;
  while (left < right) {
    mid = Math.floor((left + right) / 2);
    if (key < arr[mid]) right = mid;
    else if (key > arr[mid]) left = mid + 1;
    else return 1;
  }
  return 0;
}


(function main() {
  let N1 = Number(Arr[0]);
  let arr1 = Arr[1].split(" ").map(Number);
  // const N2 = Number(Arr[2]);
  let arr2 = Arr[3].split(" ").map(Number);
  console.log(arr2.map(e => binarySearch(e, arr1, N1)).reduce((a, b) => a + b, 0));
})();



Measured memory_bytes: 34936
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>

using namespace std;
typedef long long int ll;
void sayYes() { cout << "Yes" << endl; };
void sayNo() { cout << "No" << endl; };
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }                   // 最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };                      // 最小公倍数
ll getDigit(ll num) { return log10(num) + 1; }                         // 桁数
ll digitSum(ll n) { return (n < 10) ? n : digitSum(n / 10) + n % 10; } // 各桁の和
#define rep(i, n) for (ll i = 0; i < n; i++)

void Main()
{
    // int n;
    // cin >> n;
    // vector<int> a(n);
    // rep(i, n)
    // {
    //     cin >> a[i];
    // }
    string str;
    cin >> str;
    int ans = 0;
    rep(i, str.size() / 2)
    {
        if (str[i] != str[str.size() - i - 1])
            ++ans;
    }

    cout << ans << endl;

    return;
}

signed main(void)
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

void run (void) {
  i32 a, p;
  scanf ("%" SCNi32 "%" SCNi32, &a, &p);
  i32 ans = (3 * a + p) / 2;
  printf ("%" PRIi32 "\n", ans);
}

int main (void) {
  run();
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep(i,j,n) for(ll (i)=(j);(i)<(n);(i)++)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
typedef pair<ll, ll> P;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

//グラフ関連
struct Edge {//グラフ
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}


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

	ll k, x;
	cin >> k >> x;

	if (k * 500 >= x) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	oneInt()
	s := oneStr()
	k := oneInt()

	del := string(s[k-1])

	ans := ""
	for _, v := range s {
		if del != string(v) {
			ans = ans + "*"
		} else {
			ans = ans + string(v)
		}
	}

	fmt.Println(ans)
}

func oneInt() int {
	var a int
	fmt.Scan(&a)
	return a
}
func oneStr() string {
	var a string
	fmt.Scan(&a)
	return a
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func scanNums() (nums []int) {
	s := nextLine()
	numStr := strings.Split(s, " ")

	for _, n := range numStr {
		i, _ := strconv.Atoi(n)
		nums = append(nums, i)
	}
	return nums
}

func scanStrings() (strs []string) {
	s := nextLine()
	list := strings.Split(s, " ")
	strs = append(strs, list...)
	return strs
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func sortAsc(a []int) []int {
	sort.Ints(a)
	return a
}

func sortDesc(a []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	return a
}

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

func lcm(a, b int) int {
	if a == 0 && b == 0 {
		return 0
	}
	return a * b / gcd(a, b)
}

func cumSum(nums []int) []int {
	sums := []int{0}

	for i := 0; i < len(nums); i++ {
		sums = append(sums, sums[i]+nums[i])
	}
	return sums
}


Measured memory_bytes: 640
class UnionFind():
  def __init__(self,n):
    self.parents=[-1]*n
   
  def find(self,x):
    if self.parents[x]<0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]

  def union(self,x,y):
    x = self.find(x)
    y = self.find(y)
    
    if x==y:
      return
    
    if self.parents[x] > self.parents[y]:
      x,y=y,x
      
    self.parents[x]+=self.parents[y]
    self.parents[y]=x
  
  def size(self,x):
    return self.parents[self.find(x)]


N,M,K=map(int,input().split())
uf=UnionFind(N+1)
friends={x:set() for x in range(1,N+1)}
blocks={x:set() for x in range(1,N+1)}
ans=[N-1]*(N+1)

for _ in range(M):
  A,B=map(int,input().split())
  friends[A].add(B)
  friends[B].add(A)
  uf.union(A,B)

for _ in range(K):
  C,D=map(int,input().split())
  if uf.find(C)==uf.find(D):
    blocks[C].add(D)
    blocks[D].add(C)

for i in range(1,N+1):
  if uf.size(i)==-1:
    print(0)
    continue
  print(abs(uf.size(i))-len(friends[i])-len(blocks[i])-1,end=' ')

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

using namespace std;

#define int long long
#define ar array
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)

template<class T>
bool umin(T &a, const T &b) {
    return b < a ? a = b, 1 : 0;
}

template<class T>
bool umax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

template<class A>
void read(vt<A> &v);

template<class A, size_t S>
void read(ar<A, S> &a);

template<class T>
void read(T &x) {
    cin >> x;
}

void read(double &d) {
    string t;
    read(t);
    d = stod(t);
}

void read(long double &d) {
    string t;
    read(t);
    d = stold(t);
}

template<class H, class... T>
void read(H &h, T &... t) {
    read(h);
    read(t...);
}

template<class A>
void read(vt<A> &x) {
    EACH(a, x)read(a);
}

template<class A, size_t S>
void read(array<A, S> &x) {
    EACH(a, x)read(a);
}

string to_string(char c) {
    return string(1, c);
}

string to_string(bool b) {
    return b ? "true" : "false";
}

string to_string(const char *s) {
    return string(s);
}

string to_string(string s) {
    return s;
}

string to_string(vt<bool> v) {
    string res;
    FOR(sz(v))res += char('0' + v[i]);
    return res;
}

template<size_t S>
string to_string(bitset<S> b) {
    string res;
    FOR(S)res += char('0' + b[i]);
    return res;
}

template<class T>
string to_string(T v) {
    bool f = 1;
    string res;
    EACH(x, v) {
        if (!f)
            res += ' ';
        f = 0;
        res += to_string(x);
    }
    return res;
}

template<class A>
void write(A x) {
    cout << to_string(x);
}

template<class H, class... T>
void write(const H &h, const T &... t) {
    write(h);
    write(t...);
}

void print() {
    write("\n");
}

template<class H, class... T>
void print(const H &h, const T &... t) {
    write(h);
    if (sizeof...(t))
        write(' ');
    print(t...);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n) {
    v = vt<T>(n, x);
}

template<class T, class U>
void vti(vt<T> &v, U x, size_t n, size_t m...) {
    v = vt<T>(n);
    EACH(a, v)vti(a, x, m);
}

int cmp(int a, int b) {
    if (a == b) {
        return 0;
    }
    return a < b ? -1 : 1;
}

void solve() {
    int n, x;
    read(n, x);
    vt<int> a(n);
    read(a);
    int ans = 0;
    FOR(n) {
        ans += max(0LL, a[i] - x);
        a[i] = min(x, a[i]);
    }
    FOR(i, 1, n) {
        ans += max(0LL, a[i] + a[i - 1] - x);
        a[i] = min(a[i], x - a[i - 1]);
    }
    print(ans);
}

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int tt = 1;
//    read(tt);
    FOR(tt) {
//        write("Case #", i + 1, ": ");
        solve();
    }
    
}



Measured memory_bytes: 3976
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=n-1;i>=0;i--){
        if(i!=n-1)cout<<' ';
        cout<<a[i];
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3092
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;

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

const int MAXV = 128;
const ll INF = 100000000000000;
ll d[MAXV][MAXV];

int main(void) {
    int V, E;
    cin >> V >> E;
    for (int i = 0; i < V; i++) {
        for (int j = 0; j < V; j++) {
            d[i][j] = INF;
        }
        d[i][i] = 0;
    }
    for (int i = 0; i < E; i++) {
        int s, t;
        ll D;
        cin >> s >> t >> D;
        d[s][t] = D;
    }
    // warshall
    for (int k = 0; k < V; k++) {
        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                if (d[i][k] != INF && d[k][j] != INF) {
                    d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
                }
            }
        }
    }
    for (int i = 0; i < V; i++) {
        if (d[i][i] < 0) {
            cout << "NEGATIVE CYCLE" << endl;
            return 0;
        }
    }
    for (int i = 0; i < V; i++) {
        for (int j = 0; j < V; j++) {
            if (d[i][j] == INF) {
                cout << "INF" ;
            } else {
                cout << d[i][j] ;
            }
            if (j != V-1) cout << ' ';
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 1264
import itertools

l = [int(input()) for i in range(5)]
p = list(itertools.permutations(l))

ans = 2 ** 31
for i in range(len(p)):
    t = 0
    for j in range(5):
        if t % 10 == 0:
            t += p[i][j]
        else:
            t //= 10
            t += 1
            t *= 10
            t += p[i][j]
    ans = min(ans, t)
print(ans)


Measured memory_bytes: 3060
N, M = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(N)]
lst = sorted(lst)
S, cnt = 0, 0
for x in lst:
    S += x[0] * min(M - cnt, x[1])
    cnt += min(M - cnt, x[1])
print(S)

Measured memory_bytes: 28648
n = gets.to_i
as = gets.split.map &:to_i

sum = []

count = {}

(n).downto(1).with_index{ |i,ind|
	sum << i + as[ind]
	p = i - as[ind]
	if count[p] == nil then
		count[p] = 1
	else
		count[p] += 1
	end
}

res = 0

sum.each{ |x|
	if count[x] != nil then
		res += count[x]
	end
}

puts res

Measured memory_bytes: 38224
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;


int main(void)
{
    int N;
    string S;
    cin >> N >> S;

    auto f = [N,S](string &s){
        Rep(i, 1, N-1){
            if(s[i] == 'S'){
                if(S[i]=='o') {
                    if(s[i-1]=='S') s.pb('S');
                    else s.pb('W');
                }else{
                    if(s[i-1]=='S') s.pb('W');
                    else s.pb('S');   
                }
            }else{
                if(S[i]=='o') {
                    if(s[i-1]=='S') s.pb('W');
                    else s.pb('S');
                }else{
                    if(s[i-1]=='S') s.pb('S');
                    else s.pb('W');   
                }
            }
        }
        bool t1 = false;
        if(s[N-1]=='S') {
            if(S[N-1]=='o') t1 = s[N-2]==s[0];
            else t1 = s[N-2]!=s[0];
        }
        else {
            if(S[N-1]=='o') t1 = s[N-2]!=s[0];
            else t1 = s[N-2]==s[0];
        }
        bool t2 = false;
        if(s[0]=='S') {
            if(S[0]=='o') t2 = s[N-1]==s[1];
            else t2 = s[N-1]!=s[1];
        }
        else {
            if(S[0]=='o') t2 = s[N-1]!=s[1];
            else t2 = s[N-1]==s[1];
        }

        return (t1 && t2);
    };

    string ans = "SS";
    if(f(ans)) {
        pr(ans);
        return 0;
    }
    ans = "SW";
    if(f(ans)) {
        pr(ans);
        return 0;
    }
    ans = "WW";
    if(f(ans)) {
        pr(ans);
        return 0;
    }
    ans = "WS";
    if(f(ans)) {
        pr(ans);
        return 0;
    }
    pr(-1);
}

Measured memory_bytes: 640
#include<stdio.h>
#define MAX 100000

int A[MAX], n;

int partition(int p, int r)
{
    int x, i, j, t;
    x = A[r];
    i = p - 1;

    for (j = p; j < r; j++)
    {
        if (A[j] <= x)
        {
            i++;
            t = A[j];
            A[j] = A[i];
            A[i] = t;
        }
    }

    t = A[r];
    A[r] = A[i+1];
    A[i+1] = t;

    return i+1;
}

int main()
{
    int i, q;
    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%d", &A[i]);

    q = partition(0, n - 1);

    for (i = 0; i < n; i++)
    {
        if (i > 0) printf(" ");
        if (i == q) printf("[");
        printf("%d", A[i]);
        if (i == q) printf("]");
    }
    printf("\n");

    return 0;
}


Measured memory_bytes: 2116
#include<stdio.h>
int jc[65536],injc[65536];
int dp[65536];
int a[16];
int num[65536];
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	injc[1]=1;
	for(int i=2;i<(1<<n);i++)
	{
		injc[i]=(long long)1000000007/i*injc[1000000007%i]%1000000007;
		injc[i]=1000000007-injc[i];
	}
	jc[0]=1;
	injc[0]=1;
	for(int i=1;i<(1<<n);i++)
	{
		jc[i]=(long long)jc[i-1]*i%1000000007;
		injc[i]=(long long)injc[i-1]*injc[i]%1000000007;
	}
	for(int i=0;i<m;i++)
	{
		scanf("%d",&a[i]);
	}
	dp[0]=1;
	for(int i=m-1;i>=0;i--)
	{
		for(int j=(1<<n)-1;j>=0;j--)
		{
			int rm=(1<<n)-a[i]-j;
			for(int k=0;k<n;k++)
			{
				if(j&(1<<k))
				{
					continue;
				}
				if(rm<(1<<k)-1)
				{
					continue;
				}
				int inc=(long long)jc[rm]*injc[rm-(1<<k)+1]%1000000007;
				inc=(long long)inc*(1<<k)%1000000007;
				dp[j+(1<<k)]+=(long long)inc*dp[j]%1000000007;
				if(dp[j+(1<<k)]>=1000000007)
				{
					dp[j+(1<<k)]-=1000000007;
				}
			}
		}
	}
	num[0]=0;
	for(int i=1;i<(1<<n);i++)
	{
		num[i]=num[i-(i&(-i))]+1;
	}
	int ans=0;
	for(int i=0;i<(1<<n);i++)
	{
		if(num[i]&1)
		{
			ans-=(long long)dp[i]*jc[(1<<n)-1-i]%1000000007;
			if(ans<0)
			{
				ans+=1000000007;
			}
		}
		else
		{
			ans+=(long long)dp[i]*jc[(1<<n)-1-i]%1000000007;
			if(ans>=1000000007)
			{
				ans-=1000000007;
			}
		}
	}
	ans=(long long)ans*(1<<n)%1000000007;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1280
#pragma GCC optimize ("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
const int mod = 1e9+7;
const Int Inf = 1e17;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(pri2i,n-1)cout<<a[pri2i]<<' '; if(n>1)cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

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

  cin>>n>>m; bool g[n][m],seen[n][m]={};
  rep(i,n)rep(j,m){cin>>cf; g[i][j]=cf=='#';}
  queue<P>que; que.emplace(0,0); seen[0][0]=1;
  while(!que.empty()){
    tie(y,x)=que.front(); que.pop();
    if(y==n&&x==m)break;
    if(y+1<n&&g[y+1][x]&&x+1<m&&g[y][x+1]){pri1("Impossible"); return 0;}
    if(y+1<n&&g[y+1][x]&&!seen[y+1][x]){que.emplace(y+1,x); seen[y+1][x]=1;}
    if(x+1<m&&g[y][x+1]&&!seen[y][x+1]){que.emplace(y,x+1); seen[y][x+1]=1;}
  }
  ok=1;
  rep(i,n)rep(j,m)if(g[i][j])ok&=seen[i][j];
  pri1(ok?"Possible":"Impossible");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll MOD=1e9+7;


void solve()
{
	ll a,p;
	cin>>a>>p;
	cout<<(a*3+p)/2;
	return;
}

int main()
{
        fast;
        ll q;
        q=1;
        // cin>>q;
        while(q--)
        	solve();
        
        return 0;
}


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

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin >> n;
    
    map<int, int> dct;
    set<int> kek;
    
    for (int i = 0; i != n; ++i)
    {
        int x;
        cin >> x;
        
        if (kek.find(x) == kek.end())
        {
            kek.insert(x);
            dct[x] = 1;
        }
        else
            dct[x]++;
    }
    
    if (kek.size() == 1)
    {
        if (kek.find(0) != kek.end())
            cout << "Yes" << '\n';
        else
            cout << "No" << '\n';
    }
    else if (kek.size() == 2)
    {
        if (kek.find(0) == kek.end())
            cout << "No" << '\n';
        else if (dct[0] * 3 == n)
            cout << "Yes" << '\n';
        else
            cout << "No" << '\n';
    }
    else if (kek.size() == 3)
    {
        int i = 0;
        int abc[3];
        
        for (int x : kek)
            abc[i++] = x;
        
        int a = abc[0];
        int b = abc[1];
        int c = abc[2];
        
        if ((a ^ b ^ c) == 0 && dct[a] == dct[b] && dct[a] == dct[c])
            cout << "Yes" << '\n';
        else
            cout << "No" << '\n';
    }
    else
        cout << "No" << '\n';
    
    return 0;
}

Measured memory_bytes: 7552
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

map<int, int> factorize(int a) {
  map<int, int> ret;
  for (int i = 2; i * i <= a; i++) {
    int cnt = 0;
    while (a % i == 0) a /= i, cnt++;
    if (cnt != 0) ret[i] = cnt;
  }
  if (a != 1) ret[a] = 1;
  return ret;
}
int calc(int x) {
  int ans = 0;
  rep(i, 0, x + 1) {
    if (i * (i + 1) / 2 <= x) {
      ans = i;
    }
  }
  return ans;
}
signed main() {
  int N;
  cin >> N;
  auto f = factorize(N);
  int ans = 0;
  for (pii x : f) {
    ans += calc(x.second);
  }
  cout << ans << endl;
  return (0 ^ _ ^ 0);
}



Measured memory_bytes: 3656
/* author:hellojim */
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	int k;
	cin>>k;
	rep(i,k)cout<<"ACL";
	return 0;
}



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

int main(){
  int a,b,c,d,max=0,flag=0;
  cin>> a>>b;
  for(int i=0;i<a;i++){    
    if(b>max)max=b;
    cin>>c>>d;
    b+=c-d;
    if(b<0)flag=1;
    else if(b>max)max=b;
  }
  if(flag!=1)cout<<max<<endl;
  else cout<<"0"<<endl;
  return 0;
}

Measured memory_bytes: 1160
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>

using namespace std;

int main(){
	bool sosuu[1000011];
	bool dp[1000011];
	
	for(int i=0;i<=1000000;i++){
		sosuu[i]=0;
	}
	for(int i=2;i<=500000;i++){
		if(sosuu[i]==0){
			for(int j=i;j<=1000000;j+=i){
				sosuu[j]=1;
			}
			sosuu[i]=0;
		}
	}
	sosuu[0]=1;
	sosuu[1]=1;
	while(1){
		for(int i=0;i<=1000000;i++){
			dp[i]=0;
		}
		
		int item[30];
		
		int n,m;
		scanf("%d%d",&n,&m);
		
		if(n==0 && m==0){
			break;
		}
		for(int i=0;i<n;i++){
			scanf("%d",&item[i]);
		}
		dp[0]=1;
		for(int i=0;i<=m;i++){
			for(int j=0;j<n;j++){
				if(i<item[j]){
					continue;
				}
				if(dp[i-item[j]]==1){
					dp[i]=1;
				}
			}
		}
		int num=0;
		for(int i=m;i>=0;i--){
			if(dp[i]==1&&sosuu[i]==0){
				num=i;
				break;
			}
		}
		if(num==0){
			puts("NA");
		}else{
			printf("%d\n",num);
		}
	}
}

Measured memory_bytes: 2832
#include <bits/stdc++.h>
using namespace std;
 
int a, b;
 
int main(){
	
	scanf("%d %d", &a, &b);

	if(b%a==0){
		printf("%d\n", a+b);
		return 0;
	}

	printf("%d\n", b-a);

	return 0;
}

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

//macro-----------------------------------------------------------------------------------------
#define rep(i,a,b) for(int i=a;i<b;i++)
#define int long long

const int inf = 100100100100100;
const int mod = 1000000007;
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};


//io_method
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void print(const T& n){cout << n << endl;}
void print(vector<int> arr){cout << arr[0];rep(i,1,arr.size()) cout << " " << arr[i];cout << endl;}
void print(pair<int, int> p){cout << p.first << " " << p.second;}
void print(vector<vector<int>> arr){rep(i,0,arr.size()){print(arr[i]);}}
void print(set<int> s){for(auto e = s.begin(); e != s.end(); e++){cout << *e << " ";}cout << endl;}
void print(map<int, int> mp){cout << "{";for(auto e = mp.begin(); e != mp.end(); e++){cout << "(" << e -> first << " " << e -> second << ")";}cout << "}" << endl;}

//main------------------------------------------------------------------------------------------

signed main(){


    int n = input();

    int t = input();

    vector<pair<int, int> > arr;
    rep(i,0,n){
        int c, x;
        cin >> c >> x;
        arr.push_back(make_pair(c,x));
    }

    sort(arr.begin(), arr.end());

    int m = inf;
    rep(i,0,n){
        if(arr[i].second <= t){
            m = min(m, arr[i].first);
        }
    }
    
    if(m == inf){
        print("TLE");
    }else{
        print(m);
    }









}   

Measured memory_bytes: 256