akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std; 
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }

int main(){
  int N; cin >>N;
  int d[N]; CINA(d,N);
  sort(d,d+N);
  int r = 0;
  int temp = 0;
  REP(i,N){
    if(d[i]==temp);
    else{r++; temp=d[i];}
  }
  printf("%d",r);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int N;
int x[8], y[8];
double dist = 0;

int main(){
  cin >> N;
  rep(i, N){
    cin >> x[i] >> y[i];
  }
  vector<int> v(N);
  rep(i, N) v[i] = i;
  do{
    rep(i, N - 1){
      int numa = v[i+1], numb = v[i];
      double a = sqrt((x[numa]-x[numb])*(x[numa]-x[numb]) + (y[numa]-y[numb])*(y[numa]-y[numb]));
      dist += a;
    }
  }while (next_permutation(all(v)));
  int a = 1;
  rep(i, N){
    a = a * (i+1);
  }
  printf("%10.10lf\n", dist/a);
}
  

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define uint unsigned
#define ull unsigned ll
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define y1 djsfah
using namespace std;
int n,k;
char s[100005];
char t[100005];
int main(){
	scanf("%s%d",s+1,&k);
	n=strlen(s+1);
	For(i,1,n) t[i]=t[i+n]=t[i+2*n]=s[i];
	ll s1=0,s2=0,s3=0;
	For(i,1,n) if (s[i]==s[i-1]) s[i]='a'-1,++s1;
	For(i,1,2*n) if (t[i]==t[i-1]) t[i]='a'-1,++s2,++s3;
	For(i,2*n+1,3*n) if (t[i]==t[i-1]) t[i]='a'-1,++s3;
	if (k%2==1) printf("%lld\n",s1+(s3-s1)*(k-1)/2);
	else printf("%lld\n",s1+(s3-s1)*((k-1)/2)+(s2-s1));
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
  int n,m;
  cin >> n >> m;
  cout << n*(n-1)/2+m*(m-1)/2 << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cassert>
#include <algorithm>    
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cmath>
#include <bitset>
#define mk make_pair
#define eb emplace_back
#define eps 1e-8
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
// #define int long long
using namespace std;

typedef long double ld;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef unsigned long long ull; 
typedef vector<int> vii;
typedef vector<long double> vd;
const int inf = 1e9;
const int M = 1e9 + 7;
//__int128


signed main()
{
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n;
  cin >> n;
  std::vector<int> a(n), f(n + 1);
  for(int i = 0; i < n; ++i) {
  	cin >> a[i];
  }
  f[0] = 1;
  std::vector<int> v;
  for(int i = 1; i < n; ++i) {
  	if(a[i] == a[i - 1]) {
  		f[i] = f[i - 1] + 1;
  	} else {
  		v.eb(f[i - 1]);
  		f[i] = 1;
  	}
  }
  v.eb(f[n - 1]);
  int res = 0;
  for(int i : v) {
  	res += i / 2;
  }
  cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
using ll = long long;
vector<ll> memo3(31);
ll pow3(ll a)
{
  if (a == 0)
    return 1;
  if (memo3[a] == 0)
    return memo3[a] = pow3(a - 1) * 3;
  else
    return memo3[a];
}
ll getIth(ll x, ll i)
{
  return (x / pow3(i)) % 3;
}
ll getOverIth(ll x, ll i)
{
  return x / pow3(i);
}
ll mdist(ll a, ll b, ll c, ll d)
{
  return abs(a - c) + abs(b - d);
}
ll sameXBlackBoxDist(ll rank, ll a, ll b, ll c, ll d)
{
  return min(a % pow3(rank) + c % pow3(rank) + 2,
             pow3(rank) * 2 - a % pow3(rank) - c % pow3(rank)) +
         abs(b - d);
}
ll sameXDist(ll rank, ll a, ll b, ll c, ll d)
{
  if (rank == 0)
    return mdist(a, b, c, d);
  else
  {
    ll abit = getIth(a, rank - 1);
    ll bbit = getOverIth(b, rank - 1);
    ll cbit = getIth(c, rank - 1);
    ll dbit = getOverIth(d, rank - 1);
    if (abit != cbit)
      return mdist(a, b, c, d);
    if (abit == 1)
    {
      if (abs(bbit - dbit) <= 1)
      {
        return sameXDist(rank - 1, a, b, c, d);
      }
      else
      {
        return sameXBlackBoxDist(rank - 1, a, b, c, d);
      }
    }
    else
    {
      return sameXDist(rank - 1, a, b, c, d);
    }
  }
}
ll dist(ll rank, ll a, ll b, ll c, ll d)
{
  if (rank == 0)
    return 0;
  else
  {
    ll abit = getIth(a, rank - 1);
    ll bbit = getIth(b, rank - 1);
    ll cbit = getIth(c, rank - 1);
    ll dbit = getIth(d, rank - 1);
    if (abit == cbit && bbit == dbit)
      return dist(rank - 1, a, b, c, d);
    if (abit == cbit)
    {
      if (abit == 1)
        return sameXBlackBoxDist(rank - 1, a, b, c, d);
      return sameXDist(rank - 1, a, b, c, d);
    }
    if (bbit == dbit)
    {
      if (bbit == 1)
        return sameXBlackBoxDist(rank - 1, b, a, d, c);
      return sameXDist(rank - 1, b, a, d, c);
    }
    if (abit != cbit && bbit != dbit)
      return mdist(a, b, c, d);
    throw "Fool!";
  }
}
int main()
{
  /*
  for (int i = 0; i < 30; i++)
    cout << pow3(i) << endl;
  /*/



  int Q;
  cin >> Q;
  for (int i = 0; i < Q; i++)
  {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << dist(30, a - 1, b - 1, c - 1, d - 1) << endl;
  }
  //*/
}

Measured memory_bytes: 384
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE FlexibleContexts #-}

import Data.Bits
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy.Char8 as BSL
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IMS
import Data.IntSet (IntSet)
import qualified Data.IntSet as IS
import qualified Data.Sequence as Seq
import Data.Sequence (Seq)
import qualified Data.Array.IArray as A
import qualified Data.Array.MArray.Safe as A
import qualified Data.Array.MArray as A
import Data.Array (Array)
import Data.Array.Unboxed (UArray)
import Data.Array.IArray (IArray)
import Data.Array.MArray.Safe (MArray)
import Data.Array.IO.Safe (IOArray, IOUArray)
import Data.Array.ST.Safe (STArray, STUArray, runSTArray, runSTUArray)
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import Control.Monad
import Control.Monad.ST
-- import Control.Monad.ST.Safe
import Control.Applicative
import Data.Maybe
import Data.Tuple
import Data.Ord
import Control.Monad.State.Strict
import Data.Int
import System.IO
import Data.Function
import Control.Monad.Primitive
import qualified Data.Vector.Primitive.Mutable as VPM
import qualified Data.Vector.Generic.Mutable as VGM
import Data.STRef
import Data.IORef

rInt :: StateT BSL.ByteString Maybe Int
rInt = StateT $ BSL.readInt . BSL.dropWhile (<'!')

main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  pts <- take n . unfoldr (runStateT $ (\x y -> (x,y,x+y)) <$> rInt <*> rInt)
          <$> BSL.getContents
  print $ sum $ zipWith ($) (cycle [\(x,y,z) -> x,\(x,y,z) -> -y])
    $ sortBy (compare `on` (Down . (\(x,y,z) -> z))) pts


Measured memory_bytes: 34044
#include <stdio.h>

int main()
{
    int K, N;
    int A[200000];
    scanf("%d %d", &K, &N);
    for (int i=0;i<N;i++) {
        scanf("%d", &A[i]);
    }
    //bubble sort
    int tmp, flag = 1;
    while (flag) {
        flag = 0;
        for (int j=N-1;j>0;j--) {
            if (A[j] < A[j-1]) {
                tmp = A[j];
                A[j] = A[j-1];
                A[j-1] = tmp;
                flag = 1;
            }
        }
    }
    
    int len_dif;
    for (int i=0;i<N;i++) {
        if (i==0) {
            len_dif = A[i] + K - A[N-1];
        } else {
            if (A[i] - A[i-1] > len_dif) {
                len_dif = A[i] - A[i-1];
            }
        }
    }

    printf("%d\n", K-len_dif);

    return 0;
}

Measured memory_bytes: 896
WW, HH, xx, yy, rr = map(int, input().split())
if xx > 0 and yy > 0:
    if WW - rr >= xx and HH - rr >= yy:
        print("Yes")
    else:
        print("No")
elif xx > 0 and yy <=0:
    if WW - rr >= xx and HH - rr <= yy and yy - rr < yy:
        print("Yes")
    else:
        print("No")
elif xx <= 0 and yy > 0:
    if WW - rr <= xx and xx - rr < xx and HH - rr >= yy:
        print("Yes")
    else:
        print("No")
else:
    if WW - rr <= xx and xx - rr < xx and HH - rr <= yy and yy - rr < yy:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 7740
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;
typedef long long ll;

int main(void)
{
    ll x;
    cin >> x;
    ll tmp = x / 11;
    ll ans = tmp * 2;
    ll amari = x % 11;
    if (amari > 0)
    {
        if (amari <= 6)
        {
            ans += 1;
        }
        else
        {
            ans += 2;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#define ll long long
const int N = 1e6 + 10;
using namespace std;
int n;
int min1=N;
int x;
int ans=0;
int main() {
  ios::sync_with_stdio(false);
   cin>>n;
   for(int i=1;i<=n;i++){
       cin>>x;
       min1=min(x,min1);
       if(min1==x)
           ans++;
   }
   cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#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++)

using namespace std;

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

  int x = 0, max_x = 0;
  REP(i, n)
  {
    if (s[i] == 'I') {
      x++;
    } else if (s[i] == 'D') {
      x--;
    }

    if (x > max_x)
      max_x = x;
  }

  cout << max_x;

  return(0);
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 28244
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

#define lpsbd(i, s, b, d) for(size_t i = (s); i < (b); i+=(d))
#define lpsb(i, s, b) for(size_t i = (s); i < (b); i++)
#define lpn(i, n) for(size_t i = 0; i < (n); i++)
#define fa(i, x) for(auto &i: x)
#define vcd(t, n, d) vector<t>(n, d)
#define vc(t, n) vector<t>(n)
#define all(x) (x).begin(), (x).end()

using namespace std;
using ll = long long;

const ll MOD = 1000000007;

int main(void)
{
    ll N, A, B;
    cin >> N >> A >> B;
    ll r = N % (A + B);
    cout << N / (A + B) * A + (r > A ? A : r) << endl;
    return 0;
}

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

int main(){
  int N;
  cin>>N;
  vector<int> l(N);
  int ans=0;
  
  for(int i=0; i<N; i++){
    cin>>l[i];
  }
  
  sort(l.begin(), l.end());
  
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      for(int d=j+1; d<N; d++){
        if(l[d]< (l[i]+l[j])) ans++;
      }
    }
  }
  
  cout<<ans<<endl;
}

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

int main() {
int n;
cin >> n;
vector<double> v(n);
rep(i,n) cin >> v.at(i);
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
double ans = 0;
for(int i = 0; i < n-1; i++){
  ans += v.at(i)/pow(2,i+1);
}
ans += v.back()/pow(2,n-1);
  
cout << ans << endl;

}


Measured memory_bytes: 4204
inf = float('inf')

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

def accmulate(arr):
    N = len(arr)
    cs = [0]*(N+1)
    for i in range(N):
        cs[i+1] = cs[i] + arr[i]
    return cs

# [l,r)
def query(cs, l, r):
    return cs[r] - cs[l]

cs = accmulate(A)[1:]
ans = inf

res = 0
tmp = 0
for i in range(len(cs)):
    if i % 2 == 0:
        # 負にする
        d = -1 - (cs[i] + tmp)
        d = min(d, 0)
        res += -d
        tmp += d
    else:
        # 正にする
        d = 1 - (cs[i] + tmp)
        d = max(d, 0)
        res += d
        tmp += d

ans = min(ans, res)

res = 0
tmp = 0
for i in range(len(cs)):
    if i % 2 == 1:
        # 負にする
        d = -1 - (cs[i] + tmp)
        d = min(d, 0)
        res += -d
        tmp += d
    else:
        # 正にする
        d = 1 - (cs[i] + tmp)
        d = max(d, 0)
        res += d
        tmp += d

ans = min(ans, res)
print(ans)

Measured memory_bytes: 14332
#include <bits/stdc++.h>
using namespace std;
int main(){
	int k, A, B, i;
	float c, d;
	scanf("%d%d%d", &k, &A, &B);
	c=B*1.0/k;
	d=A*1.0/k;
	c=ceil(c);
	for(i=d; i<=c; i++){
		if(k*i>=A && k*i<=B){
		printf("OK");
		break;
		}
		else if(i==c){
			if(k*i<=A || k*i>=B){
				printf("NG");
				break;
			}
			else printf("OK");
		}
		else continue;
	}
	return 0;
}

Measured memory_bytes: 3828
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int INF = 1e15;
const int MOD = 1e9 + 7;
const double PI = 3.14159265358979323846;

signed main() {
	int N;
	cin >> N;
	map<int, int>m;
	int num;
	rep(i, N) {
		cin >> num;
		m[num]++;
	}
	vector<int>v;
	int s = -INF;
	for (auto i : m) {
		if (i.second >= 4) {
			s = max(s, i.first * i.first);
			v.push_back(i.first);
		}
		else if (i.second >= 2)v.push_back(i.first);
	}
	if (v.size() < 2) {
		cout << 0;
	}
	else {
		int r = v[v.size() - 1] * v[v.size() - 2];
		int ans = max(r, s);
		cout << ans;
	}
}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define REP(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define DEBUG(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(ALL(x));
#define RSORT(x) sort(RALL(x));
#define SUM(x) accumulate(ALL(x),0);
#define FI first
#define SE second
#define PB push_back
#define EB emplace_back
#define SZ(x) (int)(x).size()
#define BN(x) ((1<<x)-1)
#define DUP(x,y) (((x)+(y)-1)/(y))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9+7;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int N; cin >> N;
  vi C(N-1), S(N-1), F(N-1); REP(i,N-1) cin >> C[i] >> S[i] >> F[i];

  REP(i,N) {
    int t = 0;
    FOR(j,i,N-1) {
      if (t < S[j]) {
        t = S[j];
      }
      else if (t%F[j]==0) {
        ;
      }
      else {
        t = t+F[j]-t%F[j];
      }
      t += C[j];
    }
    cout << t << "\n";
  }
}

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

/*bool subseq(string s,string t){
    ll y=0;
    for(ll i=0;y<s.size()&& i<t.size();i++){
        if(s[y]==t[i]){
            y++;
        }
    }
        if(y==s.size())
            return true;
        else  return false;
}*/
/*ll x=1000000001;
vector<bool>p(x,false);
void prime(){
    p[2]=true;
    for(ll i=3;i<x;i=i+2)
        p[i]=true;
    for(ll i=0;i<x;i=i+2){
        if(p[i]){
            for(ll j=i*i;j<x;j=j+i)
                p[j]=false;
        }
    }
}*/
/*vector<ll> divisor(ll n){
    vector<ll> d;
    for(ll i=1;i<=sqrt(n);i++){
        if(n%i==0){
        d.push_back(i);
        d.push_back(n/i);
        }
    }
    sort(d.begin(),d.end(),greater<ll>());
    return d;
}*/
/*bool bs(ll n,string s){
    ll a[4]={0};
    for(ll i=0;i<n-1;i++){
        a[s[i]-'0']++;
    }
    for(ll i=n-1;i<s.size();i++){
        a[s[i]-'0']++;
        if(a[1]>0 && a[2]>0 && a[3]>0)
        return true;
        a[s[i-n+1]-'0']--;
    }
    return false;
}*/


/*ll binarySearch(ll n,ll a[],ll x){
    ll low=0,high=n-1,mid,ans=-1;
    while(low<=high){
        mid=low+(high-low)/2;
        if(a[mid]>=x){

            high=mid-1;
        }
        else{
                ans=mid;
            low=mid+1;
        }
    }
    return a[ans];
}*/




/*bool subseq(string s,string t){
    ll y=0;
    for(ll i=0;y<s.size()&& i<t.size();i++){
        if(s[y]==t[i]){
            y++;
        }
    }
        if(y==s.size())
            return true;
        else  return false;
}*/
/*ll x=1000000001;
vector<bool>p(x,false);
void prime(){
    p[2]=true;
    for(ll i=3;i<x;i=i+2)
        p[i]=true;
    for(ll i=0;i<x;i=i+2){
        if(p[i]){
            for(ll j=i*i;j<x;j=j+i)
                p[j]=false;
        }
    }
}*/
/*vector<ll> divisor(ll n){
    vector<ll> d;
    for(ll i=1;i<=sqrt(n);i++){
        if(n%i==0){
        d.push_back(i);
        d.push_back(n/i);
        }
    }
    sort(d.begin(),d.end(),greater<ll>());
    return d;
}*/
/*bool bs(ll n,string s){
    ll a[4]={0};
    for(ll i=0;i<n-1;i++){
        a[s[i]-'0']++;
    }
    for(ll i=n-1;i<s.size();i++){
        a[s[i]-'0']++;
        if(a[1]>0 && a[2]>0 && a[3]>0)
        return true;
        a[s[i-n+1]-'0']--;
    }
    return false;
}*/


/*ll binarySearch(ll n,ll a[],ll x){
    ll low=0,high=n-1,mid,ans=-1;
    while(low<=high){
        mid=low+(high-low)/2;
        if(a[mid]>=x){

            high=mid-1;
        }
        else{
                ans=mid;
            low=mid+1;
        }
    }
    return a[ans];
}*/

void solve(vector<ll>a,ll n){

}
int main() {
    ll x,y;
    cin>>x>>y;
    if(y%2!=0){
        cout<<"No";
        return 0;
    }
    ll a,b;
    b=y/2-x;
    if (b<0){
        cout<<"No";
        return 0;
    }
    a=x-b;
    if(a<0){
        cout<<"No";
    }
    else cout<<"Yes";


}





Measured memory_bytes: 3624
#include <stdio.h>
#include <stdlib.h>
int main(){
  int L,R,d,i,count;
  count=0;
  scanf("%d %d %d",&L,&R,&d);
  for(i=L;i<R+1;i++) if(i%d==0) count++;
  printf("%d",count);
  return 0;
}

Measured memory_bytes: 1732
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    sort(a.begin(), a.end(), greater<int>());

    long long ans = 0;
    for (int i = 1; i < n; i++) {
        ans += a[i / 2];
    }

    cout << ans << endl;
}


Measured memory_bytes: 4056
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			if(in.equals("1")) {
				System.out.println("Hello World");

			}else {
				int a = Integer.parseInt(br.readLine());
				int b = Integer.parseInt(br.readLine());
				System.out.println(a+b);

			}
		}
	}
}

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

using namespace std;

#define ll long long int
#define MOD 1000000007
#define pb push_back
#define INF 1000000000

int main()
{ 
	int t,n,i;
	ll count,max_till;
	cin >> n;
	long long int *a = new long long int[n];

	for(i=0;i<n;i++)
		cin >> a[i];

	count = 0;
	max_till = a[0];
	for(i=1;i<n;i++)
	{
		if(a[i]==max_till)
			continue;
		else if(a[i] > max_till)
			max_till = a[i];
		else{
			count += max_till - a[i];
		}
	}
	cout << count << endl;

	delete [] a;
	return 0;
}




Measured memory_bytes: 4740
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int A, B, C;
    int ab = 0;
    int ac = 0;
    int bc = 0;

    if (scanf("%d %d %d", &A, &B, &C) < 3)
    {
        exit(1);
    }

    if (A < 1 && A > 100 && B < 1 && B > 100 && C < 1 && C > 100)
    {
        exit(1);
    }

    ab = A - B;
    if (ab < 0)
    {
        ab = -ab;
    }

    ac = A - C;
    if (ac < 0)
    {
        ac = -ac;
    }

    bc = B - C;
    if (bc < 0)
    {
        bc = -bc;
    }

    if (ac <= ab && bc <= ab)
    {
        printf("%d\n", ac + bc);
    }
    else if (ab <= ac && bc <= ac)
    {
        printf("%d\n", ab + bc);
    }
    else
    {
        printf("%d\n", ab + ac);
    }
    return 0;
}

Measured memory_bytes: 128
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
L = LIST()
L.sort()

ans = 0
for i in range(N-2):
	one = L[i]
	for j in range(i+1, N-1):
		two = L[j]
		val = one + two - 1
		idx = bisect(L, val)
		if idx-j <= 0:
			continue
		else:
			ans += (idx-j-1)
print(ans)


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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;

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

const ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll x,y; cin>>x>>y;
  ll now=x;
  ll ans=0;
  while(now<=y){
    now*=2;
    ans++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
using namespace std;
#define vel vector<long long>
#define vvel vector<vel>
#define int long long
#define rep(i,n) for(long long i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define V vector
long long p = 1000000007;
vel kai(200001, 1);
vel ink(200001, 1);
int le = (1 << 20) + 1;
vel BIT(le, 0);
vel uni(vel &list) {
	if (list.size() == 0) { return list; }
	sort(list.begin(), list.end());
	vel ql(1, list[0]);
	rep(i, list.size() - 1) {
		if (list[i] != list[i + 1]) { ql.push_back(list[i + 1]); }
	}
	list = ql;
	return ql;
}
int ru(int a, int r) {
	if (r == 0) { return 1; }
	int ans = ru(a, r / 2);
	ans *= ans; ans %= p;
	if (r % 2 == 1) { ans *= a; }
	return ans % p;
}
int inv(int a) {
	return ru(a, p - 2);
}
void make_kai() {
	rep(i, 200000) { kai[i + 1] = (kai[i] * (i + 1)) % p; }
	rep(i, 200001) { ink[i] = inv(kai[i]); }
}
int com(int n, int r) {
	int ans = kai[n] * ink[r];
	ans %= p; ans *= ink[n - r]; ans %= p;
	return ans;
}
int per(int n, int r) {
	int ans = kai[n] * ink[n-r];
	ans %= p;
	return ans;
}
signed main() {
	make_kai();
	int n, m, k; cin >> n >> m >> k;
	int ans = 0;
	int sum_x = 0;
	for (int i = 1; i < m; i++) {
		sum_x += 2 * i*(m - i);
		sum_x %= p;
	}
	sum_x *= (n*n) % p; sum_x %= p;
	int sum_y = 0;
	for (int i = 1; i < n; i++) {
		sum_y += 2 * i*(n - i);
		sum_y %= p;
	}
	sum_y *= (m*m) % p; sum_y %= p;
	ans = sum_x + sum_y;
	ans *= com(k, 2); ans %= p;
	ans *= per(n*m, k); ans %= p;
	ans *= inv(n*m); ans %= p;
	ans *= inv(n*m - 1); ans %= p;
	ans *= ink[k]; ans %= p;
	cout << ans << endl;
	return 0;
}


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

const int MAX_H = 6;
const int MAX_W = 6;
int H, W, K;
char c[MAX_H][MAX_W];

void solve() {
  int ans = 0;
  for (int i = 0; i < 1 << H; i++) {
  	for (int j = 0; j < 1 << W; j++) {
      int cnt = 0;
      for (int k = 0; k < H; k++) {
        for (int l = 0; l < W; l++) {
          if (c[k][l] == '#' && (i & (1 << k)) == 0 && (j & (1 << l)) == 0 ) {
            cnt += 1;
          }
        }
      }
      if (cnt == K) ans += 1;
    }
  }
  printf("%d\n", ans);
}

int main() {
  cin >> H >> W >> K;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> c[i][j]; 
    }
  }
  solve();
}

Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>

int main(){
    ll N, M;    cin >> N;
    VL T(N);    ll sum = 0;
    rep(i,0,N){        
        cin >> T[i];
        sum += T[i];
    }
    cin >> M;    VL P(M), X(M);
    rep(i,0,M){        
        cin >> P[i] >> X[i];
    }

    ll ans = sum;
    rep(i,0,M){
        ans = sum;
        ans += X[i] - T[P[i]-1];
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <set>
using namespace std;
int main()
{
    int n;
    string s;
    set<string> kind;
    cin >> n;
    for(int i=0;i<n;i++)
    {
        cin >> s;
        kind.insert(s);
    }
    cout << kind.size() << endl;
    return 0;
}

Measured memory_bytes: 19160
a=[]
d={}
for _ in range(3):
	a.append(list(map(int,input().split())))
for i in range(3):
	for j in range(3):
		d[a[i][j]]=[i,j]
n=int(input())
b=[]
for _ in range(n):
	t=int(input())
	if t in d:
		a[d[t][0]][d[t][1]]=0
f=0
for i in range(3):
	if(a[i][0]==0 and a[i][1]==0 and a[i][2]==0):
		f=1
		break
for i in range(3):
	if(a[0][i]==0 and a[1][i]==0 and a[2][i]==0):
		f=1
		break
if(a[0][0]==0 and a[1][1]==0 and a[2][2]==0):
	f=1
if(a[0][2]==0 and a[1][1]==0 and a[2][0]==0):
	f=1
if f==1:
	print("Yes")
else:
	print("No")


Measured memory_bytes: 3064
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn main() {
    input! {
        n: usize,
        m: usize,
        x: usize,
        ca: [(usize, [usize;m]); n],
    }

    macro_rules ! min { ( $ x : expr ) => ( $ x ) ; ( $ x : expr , $ ( $ z : expr ) ,+ ) => { { std :: cmp :: min ( $ x , min ! ( $ ( $ z ) ,* ) ) } } }
    let mut mn = std::usize::MAX;
    for i in 0..1 << n {
        let mut vec = vec![0; m];
        let mut cost = 0;
        for j in 0..n {
            if (i >> j) & 1 == 1 {
                cost += ca[j].0;
                for k in 0..m {
                    vec[k] += ca[j].1[k];
                }
            }
        }
        if vec.into_iter().all(|e| e >= x) {
            mn = min!(mn, cost);
        }
    }
    if mn == std::usize::MAX {
        println!("-1");
    } else {
        println!("{}", mn);
    }
}


Measured memory_bytes: 2180
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using ll = long long;
using itn = int;
using namespace std;
int GCD(int a, int b){
    return b ? GCD(b, a%b) : a;
}
int main(){
    int N,M;
    cin >> N >> M;
    int P[100007]={},Y[100007]={};
    vector<int> v[100007];
    for(int i=0; i<M; i++){
        cin >> P[i] >> Y[i];
        v[P[i]].push_back(Y[i]);
    }
    for(int i=0; i<100007; i++){
        sort(v[i].begin(),v[i].end());
    }
    for(int i=0; i<M; i++){
        cout << setfill('0') << setw(6) << right << P[i];
        cout << setw(6) << lower_bound(v[P[i]].begin(),v[P[i]].end(),Y[i])-v[P[i]].begin()+1 << endl;
    }
    return 0;
    
}


Measured memory_bytes: 7808
import Data.List
import Control.Applicative

type Shape =(Int,Int,Int)

isRombus :: Shape -> Bool
isRombus (a,b,_) = a == b

isRect :: Shape -> Bool
isRect (a,b,d) = a^2 + b^2 == d^2

splitWith :: Eq a => a -> [a] -> [[a]]
splitWith c = unfoldr f where
    f [] = Nothing
    f xs = let (pre,post) = break (== c) xs in
        Just (pre, drop 1 post)


parseLn :: String -> Shape
parseLn = (\(a:b:d:_) -> (a,b,d)) . map read . splitWith ','

main = do
    shapes <- map parseLn . lines <$> getContents
    let rects = length . filter isRect $ shapes
        rombs = length . filter isRombus $ shapes
    print rects
    print rombs

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

const lli MAXN = 100005;
const lli LG_NMAX = 64;

vector<lli> child[MAXN];

struct Edge {
  int v, w;
};
typedef vector<vector<Edge> > Graph;

class LCA {
private:
  const static int LG_VMAX = 64;
  int n;
  vector<vector<int> > dpar;
  vector<int> depth;

public:
  LCA(const vector<int> &par, int root) {
    n = par.size();

    dpar = vector<vector<int> >(n, vector<int>(LG_VMAX, 0));
    for (int v = 0; v < n; ++v) dpar[v][0] = par[v];
    dpar[root][0] = root;
    for (int d = 1; d < LG_VMAX; ++d) {
      for (int v = 0; v < n; ++v) {
        dpar[v][d] = dpar[dpar[v][d-1]][d-1];
      }
    }

    depth = vector<int>(n, -1);
    depth[root] = 0;
    for (int v = 0; v < n; ++v) {
      if (depth[v] != -1) continue;
      stack<int> stk;
      stk.push(v);
      while (depth[dpar[stk.top()][0]] == -1) {
        stk.push(dpar[stk.top()][0]);
      }
      while (stk.size()) {
        depth[stk.top()] = depth[dpar[stk.top()][0]] + 1;
        stk.pop();
      }
    }
  }

  LCA(const Graph &g, int root) {
    n = g.size();
    
    vector<int> par(n, -1);
    par[root] = root;
    queue<int> que;
    que.push(root);
    while (que.size()) {
      int v = que.front();
      que.pop();
      for (int i = 0; i < g[v].size(); ++i) {
        int nv = g[v][i].v;
        if (par[nv] != -1) continue;
        par[nv] = v;
        que.push(nv);
      }
    }
    LCA(par, root);
  }

  int get(int a, int b) const {
    if (depth[a] != depth[b]) {
      if (depth[a] > depth[b]) swap(a, b);
      for (int d = LG_VMAX - 1; d >= 0; --d) {
        if (depth[a] <= depth[dpar[b][d]]) {
          b = dpar[b][d];
        }
      }
    }
    if (a == b) return a;
    for (int d = LG_VMAX - 1; d >= 0; --d) {
      if (dpar[a][d] != dpar[b][d]) {
        a = dpar[a][d];
        b = dpar[b][d];
      }
    }
    return dpar[a][0];
  }

  const vector<int>& getDepth() const {
    return depth;
  }
};

int main() {
  lli N;
  while (cin >> N) {
    fill(child, child + MAXN, vector<lli>());
    vector<int> par(N, 0);
    for (lli i = 1; i < N; ++i) {
      cin >> par[i];
      par[i]--;
      child[par[i]].push_back(i);
    }
    for (lli i = 0; i < N; ++i) {
      sort(child[i].begin(), child[i].end());
    }

    LCA lca(par, 0);
    const vector<int> &depth = lca.getDepth();
    lli res = 0, prev = 0;
    queue<lli> que;
    que.push(0);
    while (que.size()) {
      const lli v = que.front();
      que.pop();
      res += depth[prev] + depth[v] - depth[lca.get(prev, v)] * 2;
      prev = v;
      for (lli i = 0; i < child[v].size(); ++i) {
        que.push(child[v][i]);
      }
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 64824
import java.util.*;
public class Main {
	

	static long dis[];
	static int N,M;
	static int a[];
	static int b[];
	static long c[];
	
	static {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		
		a = new int[M+1];
		b = new int[M+1];
		c = new long[M+1];
		dis = new long[N+1];
		
		for(int i=0; i<M+1; i++){
			a[i]=0;
			b[i]=0;
			c[i]=0;
		}
		
		
		for(int i=1; i<M+1; i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			c[i] = sc.nextLong();
			c[i]=-c[i];
		}
	}
	
	public static void main(String[] args){
		for(int i=1; i<N+1; i++){
			dis[i]=Long.MAX_VALUE;
		}
		dis[1]=0;
		for(int loop=0; loop<N-1; loop++){
			for(int i=1; i<M+1; i++){
				if(dis[a[i]]==Long.MAX_VALUE){
					continue;
				}
				if(dis[b[i]]>dis[a[i]]+c[i]){
					dis[b[i]]=dis[a[i]]+c[i];
				}
			}
		}
		boolean flag[] = new boolean[N+1];
		for(int i=0; i<N+1; i++){
			flag[i]=true;
		}
		for(int loop=0; loop<N-1; loop++){
			for(int i=1; i<M+1; i++){
				if(dis[a[i]]==Long.MAX_VALUE){
					continue;
				}
				if(dis[b[i]]>dis[a[i]]+c[i]){
					flag[b[i]]=false;
				}
				if(flag[a[i]]==false){
					flag[b[i]]=false;
				}
			}
		}
		if(flag[N]==false) System.out.println("inf");
		else System.out.println(-dis[N]);
	}
}

Measured memory_bytes: 28548
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<algorithm>

using namespace std;

int main(void) {

	long long n, m, stux[50], stuy[50], chex[50], chey[50];
	long long num, tmp, minl;

	cin >> n >> m;

	for (int i = 0; i < n; i++)cin >> stux[i] >> stuy[i];

	for (int i = 0; i < m; i++)cin >> chex[i] >> chey[i];

	for (long long istu = 0; istu < n; istu++)
	{
		minl = 1000000000000;
		num = 1;

		for (long long iche = 0; iche < m; iche++)
		{
			tmp = abs(stux[istu] - chex[iche]) + abs(stuy[istu] - chey[iche]);


			if (tmp < minl) {
				minl = tmp;
				num = iche + 1;
			}

		}
		cout << num << "\n";
	}
	

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d;cin >> a >> b >> c >> d;
	if(abs(c - a) <= d){
		cout << "Yes"<< endl;
		return 0;
	}else if(abs(b-a) <= d and abs(c-b) <= d){
		cout << "Yes" << endl;
		return 0;
	}else{
		cout << "No" << endl;
		return 0;
	}
}

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

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll LLINF = (ll)1e18;
const ll INTINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int A,B,T;
	cin >> A >> B >> T;
	int ans = 0;
	for(int t = 1; t <= T; t++){
		if(t%A==0)ans += B;
	}
	cout << ans << endl;

	

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n; cin >> n;
    ll cnt_odd = 0, cnt_4 = 0;
    rep(i, n){
        ll in; cin >> in;
        if(in%2 == 1) cnt_odd++;
        else if(in%4 == 0) cnt_4++;
    }
    if(n == cnt_odd+cnt_4){ (cnt_odd-1<=cnt_4) ? Yes() : No(); }
    else{ (cnt_odd<=cnt_4) ? Yes() : No(); }
}

Measured memory_bytes: 256
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<algorithm>
#include<iostream>
#include<cstring>
#include<fstream>
#include<bitset>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>
#define INF 0X3F3F3F3F
#define N 200005
#define M 200005
#define LL long long
#define FF(i,a,b) for(int i=a;i<=b;++i)
#define RR(i,a,b) for(int i=a;i>=b;--i)
#define FJ(i,a,b) for(int i=a;i<b;++i)
#define SC(x) scanf("%d",&x)
#define SCC(x,y) scanf("%d%d",&x,&y)
#define SCCC(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define SS(x) scanf("%s",x)
#define PR(x) printf("%d\n",x)
#define CL(a, x) memset(a, x, sizeof(a))
#define _q fd[rt]
#define _l fd[rt<<1]
#define _r fd[rt<<1|1]
#define MID int mid=((l+r)>>1)
#define lson rt<<1,l,mid
#define rson rt<<1|1,mid+1,r
#define PB push_back
#define SZ size
#define PII pair<int,int>
#define PLL pair<long long,long long>
#define MP make_pair
#define IN freopen("in.txt","r",stdin)
#define OUT freopen("out.txt","w",stdout)
using namespace std;
const int MOD=1000000007;
const double PI=acos(-1.0);
const double EPS=1e-8;
inline void II(int &n){char ch=getchar();n=0;bool t=0;
for(;ch<'0';ch=getchar())if(ch=='-')t=1;
for(;ch>='0';n=n*10+ch-'0',ch=getchar());if(t)n=-n;}
inline void OO(int a){if(a<0){putchar('-');a=-a;}
if(a>=10)OO(a/10);putchar(a%10+'0');}
inline int sgn(double x){return(x>EPS)-(x<-EPS);}
struct EE{int v,nx;}E[M*2+N*2];int hd[N],EN;
void init_edge(int num){EN=0;memset(hd,-1,(num+3)<<2);}
void add_edge(int u,int v){
    E[EN].v=v;E[EN].nx=hd[u];hd[u]=EN++;
    E[EN].v=u;E[EN].nx=hd[v];hd[v]=EN++;
}
LL down[N];
double g[N], f[N], s[N];
bool leaf[N];
void dfs1(int u, int fa){
    for(int k = hd[u]; ~k; k = E[k].nx){
        int v = E[k].v;
        if(v == fa)continue;
        ++down[u];
        dfs1(v, u);
        f[u] += f[v] + 1;
    }
    if(down[u])f[u] /= down[u];
}
void dfs2(int u, int fa){
    if(u != 1){
        if(fa == 1){
            if(down[fa] == 1)g[u] = 1;
            else g[u] = (f[fa] * down[fa] - f[u] - 1) / (down[fa] - 1) + 1;
            s[u] = (f[u] * down[u] + g[u]) / (down[u] + 1);
        }else {
            g[u] = (g[fa] + (f[fa] * down[fa] - f[u] - 1)) / down[fa] + 1;
            s[u] = (f[u] * down[u] + g[u]) / (down[u] + 1);
        }
    }
    for(int k = hd[u]; ~k; k = E[k].nx){
        int v = E[k].v;
        if(v == fa)continue;
        dfs2(v, u);
    }
}
int n;
int main(){
//IN;
    SC(n);
    init_edge(n);
    FF(i, 1, n - 1){
        int u, v;
        SCC(u, v);
        add_edge(u, v);
    }
    dfs1(1, 0);
    dfs2(1, 0);
    s[1] = f[1];
    FF(i, 1, n)printf("%.8f\n", s[i]);
    return 0;
}


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

int  gcd(int x, int y) {
    int r;
    if(x < y){
        swap(x, y);
    }

    while (y > 0) {
        r = x % y;
        x = y;
        y = r;
    }

    return x;
}

int main(void) {
    int x, y, ans;

    cin >> x;
    cin >> y;

    ans = gcd(x, y);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/
/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/
#define fRead(x)       freopen(x,"r",stdin)
#define fWrite(x)      freopen (x,"w",stdout)
#define ull            unsigned long long
#define ll             long long
#define pii            pair<int,int>
#define sit            set<int> :: iterator
#define vrit           vector<int> :: reverse iterator
#define ff             first
#define ss             second
#define endl           '\n';
#define sz(s)          (int)s.size()
#define all(s)         s.begin(),s.end()
#define IO             ios_base::sync_with_stdio(false),cin.tie(NULL);  
#define what_is(x)     cerr << #x << " is " << x << endl;
///*....Debugger....*///
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl;}
template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
///*....Input....*///
template <typename T> inline void Int(T &n) {
  n = 0; int f = 1; register int ch = getchar();
  for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
 
template <typename T, typename TT> inline void Int(T &n, TT &m) { Int(n); Int(m); }
template <typename T, typename TT, typename TTT> inline void Int(T &n, TT &m, TTT &l) { Int(n, m); Int(l);}
double ind(){double x; scanf("%lf",&x);return x;}

///*....Bitmask....*///
int set_1(int n,int pos){return n = (n | (1<<pos));}
int reset_0(int n,int pos){return n= n & ~(1<<pos);}
bool check_bit(int n,int pos){return n = n & (1<<pos);}

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

///*....Constraints....*///
const int N = (int) 1e6 + 5;
const int M = (int) 1e9 + 7;
const double pi=2* acos(0.0);
const double eps=1e-9;
std::vector<int> adj[N];
bool vis[N];
int ans[N];
void bfs(int u){
  queue<int>q;
  q.push(u);
  vis[u]=true;

  while(!q.empty()){
    u=q.front();
    q.pop();

    for(auto v: adj[u]){
      if(!vis[v]){
        ans[v]=u;
        q.push(v);
        vis[v]=true;
      }
    }
  }
}
int main()
{
    int t=1,te=0;
    //Int(t);
    while(t--){
      int n,m;
      Int(n,m);

      for(int i=1;i<=m;++i){
        int u,v;
        Int(u,v);

        adj[u].push_back(v);
        adj[v].push_back(u);
      }

      bfs(1);
      bool f=true;
      for(int i=2;i<=n;++i){
        if(ans[i]==0){
          f=false;
          break;
        }
      }

      if(f){
        printf("Yes\n");

        for(int i=2;i<=n;++i){
          printf("%d\n", ans[i]);
        }
      }
      else{
        printf("No\n");
      }

        //printf("Case %d: ",++te);
    }
    return 0;
}






Measured memory_bytes: 31772