akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
int cmp(const void *a,const void *b)
{
    return(*(int*)a-*(int*)b);
}
int main()
{
  int a[20];
  scanf("%d %d %d",&a[0],&a[1],&a[2]);
  qsort(a,3,sizeof(a[0]),cmp);
  if(a[0]==5&&a[1]==5&&a[2]==7)
    printf("YES\n");
  else
    printf("NO\n");
    return 0;
}


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

int main(){
	int h, w;

	while(1){
		cin >> h >> w;

		if(h == 0 && w == 0){
			break;
		}

		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				if(i == 0 || i == h-1 || j == 0 || j == w-1){
					cout << '#' << flush;
				}else{
					cout << '.' << flush;
				}
			}
			cout << endl;
		}
		cout << endl;
	}

	return(0);
}

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

using namespace std;

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

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

  int cnt = 0;
  for (auto i : mp) {
    cnt += i.second - 1;
  }

  cout << n - (cnt + 2 - 1) / 2 * 2 << endl;

  return 0;
}

Measured memory_bytes: 4992
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define primeDEN 727999983
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


int main(){
    std::ios::sync_with_stdio(false); cin.tie(NULL);
    int n,t;
    cin>>n>>t;
    int i;
    int mini=inf;
    int c,h;
    rep(i,n){
    	cin>>c>>h;
    	if(h<=t)
    		mini=min(mini,c);
    }
    if(mini!=inf)
    	cout<<mini<<endl;
    else
    	cout<<"TLE"<<endl;
    return 0;   
}



Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <math.h>
long long gcd(long long a,long long b)
{
	long long n=a%b;
	while(n!=0)
	{
		a=b;
		b=n;
		n=a%b;
	}
	return b;
}
long long i,n,m;
long long ans=1;
int main(void)
{
	scanf("%lld",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%lld",&m);
		ans=ans/gcd(ans,m)*m;
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 128
//C - Traveling: 
//Assunto:
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define loop(i, a, b) for(int i = a; i < b; i++)
#define loopBack(i, a, b) for(int i = a; i >= b; i--)
#define INF INT_MAX
#define LINF LLONG_MAX
#define DINF DBL_MAX
#define MAX 100005
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    int n, changeT, changeP;
    bool ans = true;
    cin >> n;
    vector<int> t(n+1), x(n+1), y(n+1);
    t[0] = x[0] = y[0] = 0;
    loop(i, 1, n+1) cin >> t[i] >> x[i] >> y[i];
    loop(i, 1, n+1) {
        changeT = t[i] - t[i-1];
        changeP = abs((x[i] + y[i]) - (x[i-1] + y[i-1]));
        //cout << changeT << " " << changeP << "\n";
        if(changeT == 1 and changeP == 0) ans = false;
        if(changeP == 0 and changeT % 2 != 0) ans = false;
        if(changeP > changeT) ans = false;
    }
    if(ans) cout << "Yes\n";
    else cout << "No\n";
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <sstream>
#include <string>
#include <complex>
#include <cstdio>
using namespace std;

int dp2[6][310] = {};

int item[5][256];
int main(){
	int N,M,L;
	cin >> N >> M >> L;
	
	for(int i = 0 ; i < M ; i++){
		int d,a,k,t;
		cin >> d >> a >> k >> t;
		--a;
		int x = (1<<k) - 1;
		x = x << a;
		item[d][x] = max(item[d][x],t);
	}
	int ans = 0;
	for(int i = 0 ; i < 5 ; i++){
		int dp[256][300] = {};
		
		for(int j = 0 ; j < 256 ; j++){
			for(int k = 0 ; k < 256 ; k++){
				if( j & k ) continue;
				for(int l = 0 ; l <= 256 ; l++){
				 	dp[j|k][l+1] = max(dp[j|k][l+1],dp[k][l] + item[i][j]);
				}
			}
		}
		int s[310] = {};
		
		for(int l = 0 ; l <= 300 ; l++)
			for(int j = 0 ; j < 256 ; j++)
				s[l] = max(s[l],dp[j][l]);

		for(int l = 0 ; l <= 300 ; l++){
			for(int j = 0 ; j < 300 ; j++){
				if( l + j <= 300 ){
					dp2[i+1][l+j] = max(dp2[i+1][l+j], dp2[i][j] + s[l]);
				} 
			}
		}

	}
	cout << dp2[5][L] << endl;
}

Measured memory_bytes: 3388
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define DEBUG true
#ifdef ONLINE_JUDGE
#undef DEBUG
#define DEBUG false
#endif 

using namespace std;

#define MAXN ((ll)2e3+15)
#define MOD ((ll)1e9 + 7)
#define INF ((int)1e9 + 9)
#define ll long long
#define _ << " " <<
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define TRACE(x) if(DEBUG) cerr << #x << " = " << x << endl;
#define TRACE2(x,y) if(DEBUG) cerr << #x << " = " << x << " | " << #y << " = " << y << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl "\n"
#define pii pair<int,int>
#define mid ((l+r)/2)

ll n,R,B;
ll fac[MAXN];
ll rev[MAXN];

ll modInverse(ll a)
{
	ll m = MOD;
	ll y = 0, x = 1;
	if (m == 1)
		return 0;
	while (a > 1)
	{
		ll q = a / m;
		ll t = m;
		m = a % m, a = t;
		t = y;
		y = x - q * y;
		x = t;
	}
	if (x < 0)
		x += MOD;
	return x;
}

void setup()
{
	fac[0] = 1;
	for (ll i = 1; i < MAXN; ++i)
		fac[i] = (fac[i-1] * i) % MOD; 

	for (int i = 0; i < MAXN; ++i)
		rev[i] = modInverse(fac[i]);
}

void mul(ll& a, ll b)
{
	a = a*b;
	a = a%MOD;
}

ll C(ll a, ll b)
{
	if(b > a) return 0;
	// a! / (a-b)!(b)!
	ll res = fac[a];

	mul(res, rev[a-b]);
	mul(res, rev[b]);

	return res;
}

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	cin >> n >> B;
	R = n-B;
	setup();
	for (ll i = 1; i <= B; ++i)
	{
		// ans for i :
		// C(B-1,i-1) * C(R+1,i) 
		ll t = C(B-1, i-1);
		mul(t, C(R+1,i));

		cout << t << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
	int H, W, i, ii;
	while (scanf("%d %d", &H, &W) == 2) {
		if (H == 0 && W == 0) break;
		for (i = 1; i <= H; i ++) {
			for (ii = 1; ii <= W; ii ++) printf("#");
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 572
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int a;
	cin >> a;
	cout << 3*a*a << endl;
}


Measured memory_bytes: 256
n=input()
k=int(input())
l=len(n)

dp=[[[0 for _ in range(2)] for _ in range(5)] for _ in range(l+1)]

dp[0][1][1]=int(n[0])-1
dp[0][1][0]=1
dp[0][0][1]=1

for i in range(1,l):
  for j in range(4):
    b=i-1
    now=int(n[i])
    if now==0:
      dp[i][j][0]+=dp[b][j][0]
    else:
      dp[i][j][1]+=dp[b][j][0]
      dp[i][j+1][1]+=dp[b][j][0]*(now-1)
      dp[i][j+1][0]+=dp[b][j][0]
    dp[i][j][1]+=dp[b][j][1]
    dp[i][j+1][1]+=9*dp[b][j][1]
print(dp[l-1][k][0]+dp[l-1][k][1])


Measured memory_bytes: 9184
s = list( raw_input( ) )
n = int( raw_input( ) )
for i in range( n ):
	cmd = raw_input( ).split( " " )
	a = int( cmd[1] )
	b = int( cmd[2] ) + 1
	if "print" == cmd[0]:
		print( "".join( s[ a:b ] ) )
	elif "reverse" == cmd[0]:
		for i, ss in enumerate( reversed( s[ a:b ] ) ):
			s[ a+i ] = ss
	elif "replace" == cmd[0]:
		for i, ss in enumerate( cmd[3] ):
			s[ a+i ] = ss

Measured memory_bytes: 4236
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (ll)(v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(o,0,n)cout<<v[o]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

#define M 100010


int main(){
    IOS;
     
    ll n;cin>>n;
    ll x=n%1000;
    if(!x){
    	cout<<0;
    	return 0;
    }
    cout<<1000-x;
     
     
     
     
    return 0;
}


Measured memory_bytes: 3644
#include <stdio.h>

int main(void){
	int fives, twos, x, t, i;
	
	while(scanf("%d",&x), x!=0){
		fives=0, twos=0;
		
		for(i=1; i<=x; i++){
			t=i;
			while(t%2==0) t/=2, twos++;
			while(t%5==0) t/=5, fives++;
		}
		
		if(twos<fives) printf("%d\n",twos);
		else printf("%d\n",fives);
	}
	
	return 0;
}

Measured memory_bytes: 0
N = int(input())
m = [0]*4
for i in range(N):
    s = input()
    if s == 'AC':
        m[0] += 1
    elif s == 'WA':
        m[1] += 1
    elif s == 'TLE':
        m[2] += 1
    else:
        m[3] += 1
print('AC x', m[0])
print('WA x', m[1])
print('TLE x', m[2])
print('RE x', m[3])

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

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  if(a+b>=c)
    cout << "Yes";
  else
  {
    cout << "No";
  }

}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
const int N = 2e5+10;
const int M =1e9+7;
#define int long long int
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define MAX 1e15+1
#define pi  pair<int,int>




int a[N];

signed main(){
    fast;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    int val=1,ans=0;
    for(int i=0;i<n;i++){
        if(a[i]==val){
            val++;

        }
        else{
            ans++;
        }
    }
    if(ans==n)cout<<-1;
    else cout<<ans;



    
 
    
 
 
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll a7=1000000007;
ll inf=1000000000000000;
#define rep(i,l,r) for(ll i=l;i<=r;i++)

ll min(ll a,ll b){
    if(a<b)return a;
    return b;
}
ll max(ll a,ll b){
    if(a>b)return a;
    return b;
}

string memo[1000000];
string bina(ll i,ll j){
    if(memo[i]!=""){
        return memo[i];
    }
    ll ii=i;
    string ans="";
    while(i>0){
        if(i%2==1){
            ans='1'+ans;
            i=i/2;
        }else{
            ans='0'+ans;
            i=i/2;
        }
    }
    
    while(ans.size()<j){
        ans='0'+ans;
    }
    memo[ii]=ans;
    
    return ans;
}


int main(){
    ll d,g;cin>>d>>g;
    ll p[d],c[d];
    rep(i,0,d-1){
        cin>>p[i]>>c[i];
    }
    string b;
    ll ans=inf;
    ll maxi;
    ll sum;
    ll sol;
    ll cc;
    rep(i,0,pow(2,d)-1){
        b=bina(i,d);
        maxi=-1;
        sum=0;
        sol=0;
        rep(j,0,d-1){
            if(b[j]=='0'){
                maxi=j;
            }else{
                sum+=((j+1)*100*p[j]+c[j]);
                sol+=p[j];
            }
        }
        if(sum>=g){
            ans=min(ans,sol);
        }else{
            cc=0;
            while(sum<g && cc<p[maxi]){
                sol++;
                sum+=(maxi+1)*100;
                cc++;
            }
            if(sum>=g){
                ans=min(ans,sol);
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 8064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
struct STR
{
  vector<int> s;
  int sl;
  vector<int> table;
  
  STR(vector<int> _s)
  {
    s = _s;
    sl = s.size();
  }
  
  void kmp_table(vector<int> t)
  {
    int tl = t.size();
    table.resize(tl+1);
    table[0] = -1;
    int i = 1;
    int j = 0;
    int cnt = 0;
    while(1){
      while(t[i]==t[j]){
	cnt++;
	table[i] = ((t[0]==t[i])?-1:0);
	++i;
	if(i == tl){
	  table[i] = cnt;
	  break;
	}
	++j;
      }
      if(i == tl){
	break;
      }
      table[i] = ((t[0]==t[i])?-1:cnt);    
      cnt = 0;
      ++i;
      if(i == tl){
	table[i] = cnt;
	break;
      }
      j = 0;
    }
  }

  vector<int> kmp(vector<int> t)
  {
    vector<int> res;
    int tl = t.size();
    if(tl > sl) return res;
    if(tl==1){
      rep(i,sl){
	if(s[i]==t[0]){
	  res.push_back(i);
	}
      }
      return res;
    }
    kmp_table(t);

    int cnt = 0;
    int i = 0;
    int j = 0;
    while(1){
      while(s[i] == t[j]){
	++j;
	if(j==tl){
	  ++cnt;
	  res.push_back(i-tl+1);
	  j = table[j];
	}
	++i;
	if(i == sl){
	  return res;
	}
      }
      if(table[j] == -1){
	++i;
	if(i == sl){
	  return res;
	}
	j = 0;
      }
      else{
	j = table[j];
      }
    }
    return res;
  }
};


int main()
{
  int n;
  cin >> n;
  vector<int> a(n),b(n);
  rep(i,n){
    cin >> a[i];
  }
  rep(i,n){
    cin >> b[i];
  }
  if(n==1){
    cout << 0 << ":" << (a[0]^b[0]) << "\n";
  }
  vector<int> c,d;
  rep(i,2*n-2){
    c.push_back(a[i%n]^a[(i+1)%n]);
    //    cout << a[i%n] << ":" << a[(i+1)%n] << "\n";
  }
  rep(i,n-1){
    d.push_back(b[i]^b[(i+1)%n]);
  }

  // rep(i,c.size()){
  //   cout << c[i] << " ";
  // }
  // cout  << "\n";
  // rep(i,d.size()){
  //   cout << d[i] << " ";
  // }
  // cout  << "\n";  
  
  STR st(c);
  vector<int> res = st.kmp(d);
  //  if(res.size()==0) return 0;
  rep(i,res.size()){
    cout << res[i] << " " << (a[res[i]]^b[0]) << "\n";
  }
  
  return 0;
}


Measured memory_bytes: 12756
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
ll psum[MAXN];
char S[MAXN];

int main()
{
    int n,m,k,a,b,c,x,y,q;
    int sum = 0;
    int cnt = 0;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;

    for(int i=1;i<=n;i++)
    {
        cin>>A[i];
        psum[i] = psum[i-1]+(ll)A[i];
    }
    a = 1;
    c = 3;
    ll mn,mx;
    ll res = psum[n];

    for(b=2;b<n-1;b++){

        while(psum[a]<psum[b]-psum[a]&&a<b)a++;
        while(psum[c]-psum[b]<psum[n]-psum[c]&&c<n)c++;
        for(int j=0;j<4;j++){
            mn = psum[n]; mx = 0;
            x = ((j&2)>>1); y = (j&1);
            mn = min(psum[b]-psum[a-x],psum[a-x]);
            mx = max(psum[b]-psum[a-x],psum[a-x]);
            mn = min(mn,min(psum[n]-psum[c-y],psum[c-y]-psum[b]));
            mx = max(mx,max(psum[n]-psum[c-y],psum[c-y]-psum[b]));
            res = min(res,mx-mn);
        }

    }

    cout<<res<<"\n";

    return 0;
}


Measured memory_bytes: 2560
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n, m, q = Is()
LR = TIR(m)
PQ = TIR(q)

X = [[0]*(n+1) for _ in range(n+1)]
for l, r in LR:
    X[l][r] += 1

Acc = deepcopy(X)
for i in range(n+1):
    for j in range(n):
        Acc[i][j+1] += Acc[i][j]
for i in range(n):
    for j in range(n+1):
        Acc[i+1][j] += Acc[i][j]

# X[p][p] + X[p][p+1] + ... + X[p][q] + X[p+1][p] + ... + X[q][q]
# -> Acc[q][q] - Acc[q][p-1] - Acc[p-1][q] + Acc[p-1][p-1]

for p, q in PQ:
    ans = Acc[q][q] - Acc[q][p-1] - Acc[p-1][q] + Acc[p-1][p-1]
    print(ans)


Measured memory_bytes: 122584
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#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 RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n;
  cin >> n;

  vector<int> a(n);
  REP(i,n) cin >> a[i];
  
  int ans = 0;
  REP(i,n) FOR(j,i+1,n) ans += a[i]*a[j];

  cout << ans << endl;

  return 0;
}

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

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

int main()
{
    long long n;
    scanf("%lld", &n);
    vector<int> oddCount(1000000, 0);
    vector<int> evenCount(1000000, 0);

    for (int i = 0; i < n; i++)
    {

        int temp;
        cin >> temp;
        if (i % 2 == 0)
        {
            evenCount.at(temp)++;
        }
        else
        {
            oddCount.at(temp)++;
        }
    }

    int oddMax = 0;
    int oddMax2 = 0;
    int evenMax = 0;
    int evenMax2 = 0;
    int oddI, evenI;

    for (int i = 1; i <= 100000; i++)
    {
        if (oddCount[i] < oddMax && 0 < oddCount[i])
            oddMax2 = max(oddMax2, oddCount[i]);
        if (evenCount[i] < evenMax && 0 < evenCount[i])
            evenMax2 = max(evenMax2, evenCount[i]);
        if (oddMax <= oddCount[i])
        {
            oddI = i;
            oddMax2 = oddMax;
            oddMax = oddCount[i];
        }
        if (evenMax <= evenCount[i])
        {
            evenI = i;
            evenMax2 = evenMax;
            evenMax = evenCount[i];
        }
    }

    int ans = 0;
    if (oddI != evenI)
    {
        ans = n - oddMax - evenMax;
    }
    else
    {
        if (oddMax2 > evenMax2)
        {
            ans = n - oddMax2 - evenMax;
        }
        else
        {
            ans = n - oddMax - evenMax2;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8064
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = input()

dp = [0]
kl = [-1 for i in range(N)]
for i in range(N):
    tmp = dp[i]
    k = -1
    if kl[N-K+i] != 2 and T[i] == "r":
        tmp += P
        k = 2
    elif kl[N-K+i] != 0 and T[i] == "s":
        tmp += R
        k = 0
    elif kl[N-K+i] != 1 and T[i] == "p":
        tmp += S
        k = 1
    dp.append(tmp)
    kl.append(k)

print(dp[N])


Measured memory_bytes: 8684
#include <iostream>
using namespace std;
 
int main(void){
    // Your code here!
    int N,M;
    cin >> N >> M;

    int count = 0;
    
    if(N!=0){
        for(int i = N-1; i > 0;i--){
            count += i;
        }
    }

    if(M!=0){
        for(int i = M-1; i > 0;i--){
            count += i;
        }
    }

    cout << count << endl;
    return 0;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

#define rep(i, o) for (ll i = 0; i < (o);i++)
#define rep_s(i, o) for (int i = 1; i <= (o);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
#define NUM 1e5

typedef long long ll;
typedef unsigned long long ull;

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


template<class T>
bool chmax(T &a, const T &b) { if (a < b) { return b; } return a; }

template<class T>
bool chmin(T &a, const T &b) { if (a > b) { a = b; return a; } return a; }

const int MOD = 1000000007;
int main() {
    ll n; cin >> n;
    ll l[n]; rep(i, n) cin >> l[i];

    ll ans = 0;
    rep(i, n-2) {
        REP(j, i+1, n-1) {
            REP(k, j+1, n) {
                if (l[i] != l[j] && l[i] != l[k] && l[j] != l[k] &&
                    l[i] < l[j] + l[k] &&
                    l[j] < l[k] + l[i] &&
                    l[k] < l[i] + l[j])
                    ans++;

                    // cout << l[i] << " " << l[j] << " " << l[k] << " "<< endl;
                    // cout << ans << endl;
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define mp make_pair
#define PII pair<int,int>
#define fi first
#define se second
#define pb push_back
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define sci(x) scanf("%d",&x)
#define scs(s) scanf("%s",s)
#define scc(c) scanf("%c",c)
#define scd(d) scanf("%lf",&d)
#define scld(ld) scanf("%Lf",&ld)
using namespace std;

//********************************************
//Error tracking
#define show(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }

vector<string> split(const string& s, char c) {
    vector<string> v;
    stringstream ss(s);
    string x;
    while (getline(ss, x, c))
        v.emplace_back(x);
    return move(v);
}

void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
    cerr << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
    err(++it, args...);
}
//********************************************



int main()
{
    //freopen("input","r",stdin);
    //freopen("output","w",stdout);
    cin.sync_with_stdio(false);
	
	int x;
	cin >> x;
	
	int act = 0;
	for (int i = 1; i <= 500000; i++)
		{
			act += i;
			if (act >= x) 
			{
				cout << i << "\n";
				return 0;
			}
		}

    return 0;   
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;

public class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);

		while(true){
			int a = stdIn.nextInt();
			int d = stdIn.nextInt();
			int n = stdIn.nextInt();

			if(a==0 && d==0 && n==0) break;

			boolean[] prime = new boolean[1000000];
			Arrays.fill(prime,true);
			prime[0] = false;
			prime[1] = false;

			for(int i=2; i<prime.length; i++){
				int j = i;
				if(prime[i] == true)
				while((i+j)<prime.length){
					j+=i;
					prime[j] = false;
				}
			}

			int value = a;
			int count = prime[value]?1:0;

			while(count!=n){
				value+=d;
				if(prime[value]) count++;
			}
			System.out.println(value);
		}
	}
}

Measured memory_bytes: 55532
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MAX_P 1*1000+5*1000+10*1000+50*1000+100*1000+500*1000

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int P, N[6], p[6] = {1, 5, 10, 50, 100, 500};

int change(int m){
  int c = m-P, res = 0;
  //  printf("%d %d\n", c, res);
  if(c/500){
    int use = c/500;
    res += use;
    c -= use*500;
  }
  //  printf("%d\n", res);
  if(c/100){
    int use = c/100;
    res += use;
    c -= use*100;
  }
  //  printf("%d\n", res);
  if(c/50){
    int use = c/50;
    res += use;
    c -= use*50;
  }
  //  printf("%d\n", res);
  if(c/10){
    int use = c/10;
    res += use;
    c -= use*10;
  }
  //  printf("%d\n", res);
  if(c/5){
    int use = c/5;
    res += use;
    c -= use*5;
  }
  //  printf("%d\n", res);
  res += c;

  return res;
}

int pay(int m){
  int res = 0, use;
  if(m/500){ use = min(m/500, N[5]); res += use; m -= use*500;}
  //  printf("%d\n", res);
  if(m/100){ use = min(m/100, N[4]); res += use; m -= use*100;}
  //  printf("%d\n", res);
  if(m/50){ use = min(m/50, N[3]); res += use; m -= use*50;}
  //  printf("%d\n", res);
  if(m/10){ use = min(m/10, N[2]); res += use; m -= use*10;}
  //  printf("%d\n", res);
  if(m/5){ use = min(m/5, N[1]); res += use; m -= use*5;}
  //  printf("%d\n", res);
  if(m){ use = min(m, N[0]); res += use; m -= use;}
  if(m) return INF;
  else return res;
}

int main(){
  while(scanf("%d%d%d%d%d%d%d", &P, &N[0], &N[1], &N[2], &N[3], &N[4], &N[5]) && P){
    int res = INF, sum = N[0]*p[0]+N[1]*p[1]+N[2]*p[2]+N[3]*p[3]+N[4]*p[4]+N[5]*p[5];
    //    printf("%d %d\n", P, sum);
    REP(i, P, sum+1){
      //            printf("%d %d %d\n", i, change(i), pay(i));
      res = min(res, change(i)+pay(i));
    }

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

Measured memory_bytes: 1184
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)

void solve(long long N, std::vector<long long> A){
    //* A: 0->A1->A2->A3-> ... -> AN -> 0
    ll ans = 0;
    rep(i, A.size()-1){
        ans += abs(A[i+1]-A[i]);
    }

    rep(i, N){
        cout << ans - abs(A[i+1]-A[i]) - abs(A[i+2]-A[i+1]) + abs(A[i+2]-A[i]) << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N+2, 0LL);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i+1]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 2048
firstint = int(input())
inputary = [int(input()) for i in range(firstint)]
inputary.sort(reverse=True)
counter = 1
Comparisoner = inputary[0]
for elm in inputary:
    if Comparisoner > elm:
        counter +=1
    elif Comparisoner is elm:
        continue
    else:
        break
    Comparisoner = elm

print(counter)
    

Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0; i<n; i++)
#define REP(i,x,n) for (int i=x; i<n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
const int mod = 1e9+9;
const int INF = 1e9;

int main(){
    ll n, k;
    cin >> n >> k;

    if (k % 2 == 1){
        ll m = n / k;
        m = pow(m, 3);
        printf("%lld\n", m);
        return 0;
    }
    else {
        ll m = n / k;
        m = pow(m, 3);
        ll o = 0;
        REP(i,1,n+1){
            if (i % k == (k / 2)) o++;
        }
        //cout << m << endl;
        //cout << o << endl;
        o = pow(o, 3);
        printf("%lld\n", m+o);
        return 0;
    }
}


Measured memory_bytes: 3940
n = int(input())
x = [0] * n
u = ['.'] * n


for i in range(n):
    tmp = input().split()
    x[i], u[i] = float(tmp[0]), str(tmp[1])


total = 0
for i in range(n):
    if u[i] == 'JPY':
        total += x[i]
    else:
        total += 380000 * x[i]

print(total)


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

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

ll strtoll(string s){
    ll ret = 0;
    FOR(i, 0, s.length()){
        ret += pow(10, s.length()-i-1) * (s[i]- '0');
    }
    return ret;
}

int main(void){
    string s;
    cin>>s;
    int N =s.length();
    vector<string> vs(N);
    ll ans = 0;
    FOR(i, 0, N) vs[i] = s[i];//1文字ずつ保存
    FOR(i, 0, 1<<(N-1)){
        vector<string> num;
        string ss = vs[0];
        FOR(j, 0, N-1){
            //bitが0の時
            if((i>>j)%2==0) ss += vs[j+1];
            //1の時
            else{
                num.push_back(ss);
                ss = vs[j+1];
            }
        }
        num.push_back(ss);
        FOR(i, 0, num.size()) ans += strtoll(num[i]);
    }
    cout << ans << endl;
}

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

#define rand() ((rand()<<15)+rand())

using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

template<typename Key, typename Value>
using hash_map = cc_hash_table<Key, Value>;
template<typename T, typename Cmp = less<T>>
using oset = tree<T, null_type, Cmp, rb_tree_tag, tree_order_statistics_node_update>;
*/
typedef long long lint;
typedef complex<double> point;

const int INF = 0x3f3f3f3f;
const lint INFL = 0x3f3f3f3f3f3f3f3fLL;
const double E = 1e-9, pi = 2 * acos(0);

template<typename T, typename U> void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> void amax(T &x, U y) { if (x < y) x = y; }

bool solve(int testNumber) {
	int n, m;
	if (!(cin >> n >> m)) {
		return false;
	}
	lint ans = (lint)(n >= 2 ? n - 2 : 1) * (m >= 2 ? m - 2 : 1);
	cout << ans << endl;
	return true;
}

void init(const char *in = nullptr, const char *out = nullptr) {
	if (in) freopen(in, "r", stdin);
	if (out) freopen(out, "w", stdout);
	srand(unsigned((long long)new char));
}

int main() {
	ios_base :: sync_with_stdio(false);
	cin.tie(nullptr);
	init();
	for (int i=1; solve(i); i++);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    vector<int> m(0);
    int n,s,t;
    cin >> n >> t;
    int b[n][2];
    double a = 0;

    for(int i = 0; i < n; i++){
        for(int k = 0; k < 2; k++){
            cin >> b[i][k];
        }
    }
    int ans = 1001;
    for(int l = 0; l < n; l++){
        for(int o = 0; o < 2; o++){
            if(t >= b[l][1]){
                ans = min(b[l][0], ans);
            }
        }
    }


    if(ans == 1001){
        cout << "TLE";
    }else{
        cout << ans;
    }

}

Measured memory_bytes: 256
x, y = map(str,input().split())
if x == 'A':
  xx = 10
elif x == 'B':
  xx = 11
elif x == 'C':
  xx = 12
elif x == 'D':
  xx = 13
elif x == 'E':
  xx = 14
elif x == 'F':
  xx = 15
  
if y == 'A':
  yy = 10
elif y == 'B':
  yy = 11
elif y == 'C':
  yy = 12
elif y == 'D':
  yy = 13
elif y == 'E':
  yy = 14
elif y == 'F':
  yy = 15
  
if xx > yy:
  print('>')
elif xx == yy:
  print('=')
else:
  print('<')

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

int N, M ,Q;
int sum[600][600];

signed main()
{
    cin >> N >> M >> Q;
    for(int i = 0; i < M; i++){
        int a, b;
        cin >> a >> b;
        sum[a][b]++;
    }
    for(int i = 1; i <= N; i++){
        for(int j = 1; j <= N; j++){
            sum[i][j] += sum[i][j - 1];
        }
    }
    for(int i = 1; i <= N; i++){
        for(int j = 1; j <= N; j++){
            sum[i][j] += sum[i - 1][j];
        }
    }
    for(int i = 0; i < Q; i++){
        int a, b;
        cin >> a >> b;
        cout << sum[b][b] + sum[a - 1][a - 1] - sum[b][a - 1] - sum[a - 1][b] << endl;
    }


    return 0;
}


Measured memory_bytes: 2048
def dfs(expression, val, rest_nums):
#    print(expression, val, rest_nums)
    if len(rest_nums) == 0:
        if val == 7:
            return expression+"=7"
        else:
            return False

    new_num = rest_nums[0]
    # +
    result = dfs(expression+"+{}".format(new_num), val+new_num, rest_nums[1:])
    if result:
        return result

    # -
    result = dfs(expression+"-{}".format(new_num), val-new_num, rest_nums[1:])
    if result:
        return result
    return False


def main():
    A, B, C, D = [int(n) for n in list(input())]

    result = dfs(str(A), A, [B,C,D])
    print(result)

if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int  long long
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mod 998244353
// order_of_key and *find_by_order
#define N 100001

int32_t main() {
	fast;
	int n; cin >> n;
	int a[n];
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		int x;
		cin >> x;
		if (i & 1 and x & 1) {
			ans++;
		}
	}
	cout << ans;
}











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


int main(){
  int n,x,y;
  cin >>n>>x>>y;
  vector <int> a(n);
  for(int i=1;i<n;++i){
    for(int j =i+1;j<=n;++j){
      int dis1=j-i;
      int dis2 =abs(i-x) + 1 +abs(j-y);
      int ans =min(dis1,dis2);
      a.at(ans)++;

    }
  }
  for(int i=1;i<n;i++){
    cout<<a.at(i)<<endl;
  }

}


Measured memory_bytes: 256
/*
  A - Fighting over Candies
  Contest 047
  Rakesh Kumar --> 03/08/2020
 */

#include <bits/stdc++.h>

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

    int a = 0, b = 0, c = 0;
    std::cin >> a >> b >> c;
    std::vector<int> v = {a, b, c};
    std::sort(v.begin(), v.end());
    if (v[0] + v[1] == v[2])
        std::cout << "Yes" << std::endl;
    else
        std::cout << "No" << std::endl;

    return 0;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace         std;
#define                 int long long
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<endl
#define                 real signed
#define                 endl '\n'              
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 314159

int arr[N];

signed main() 
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
     int ans=0;
     int n;
     cin>>n;
     forn(i,1,n)
        cin>>arr[i];
    
    forn(i,2,n)
    {
        if(arr[i]==arr[i-1])arr[i]=0,ans++;
    }
    cout<<ans;




     return 0;

}

//       g++ -g c.cpp ; ./a.exe

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

int main() {
  int N;
  cin >> N;
  
  vector<int> vec(N);
  
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
    
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  
  int A, B = 0;

  for (int i = 0; i < N; i +=2) {
    A += vec.at(i);
  }
  
  for (int i = 1; i < N; i +=2) {
    B += vec.at(i);
  }
    
  cout << A - B << endl;
  
}


Measured memory_bytes: 256
import sys, collections, bisect, itertools, heapq, math, copy
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = LI()

    sum = 0
    for i in a:
        sum ^= i

    print(*[sum ^ i for i in a])

if __name__ == '__main__':
    resolve()


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

int main()
{
  int n;
  int a=0,b=0,c=0,d=0;

  while(cin>>n){
    int count=0;
    for(int a=0;a<10;a++){
      for(int b=0;b<10;b++){
        for(int c=0;c<10;c++){
          for(int d=0;d<10;d++){
            if(a+b+c+d==n)
              count++;
          }
        }
      }
    }
    cout<<count<<endl;
  }
  
  return 0;
}



Measured memory_bytes: 3016
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[100005], finv[100005], inv[100005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge>>G;

bool g[10][10], used[10];;
int dfs(int a, int b, bool visited[10]) {
	bool mon = 1;
	for (int i = 0; i < b; ++i) {
		if (!visited[i]) { mon = 0; }
	}
	if (mon) { return 1; }
	int res = 0;
	for (int i = 0; i < b; ++i) {
		if (!g[a][i] || visited[i]) { continue; }
		visited[i] = 1;
		res += dfs(i, b, visited);
		visited[i] = 0;
	}
	return res;
}

int main() {
	int a, b, c, d;
	cin >> a >> b;
	for (int i = 0; i < b; ++i) {
		cin >> c >> d;
		--c; --d;
		g[c][d] = g[d][c] = 1;
	}
	used[0] = 1;
	cout << dfs(0, a, used) << endl;

}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<bitset>

#define ls (t<<1)
#define rs ((t<<1)+1)
#define mid ((l+r)>>1)
#define fi first
#define se second
#define mk make_pair
#define pb push_back

#define N 305
#define M 200005
#define seed 23333
#define Mo 998244353

using namespace std;
const int inf=(int)1e9;
int i,j,m,n,p,k,tot,S,T,L,k1=1,fox[N],Q[N],st,ed,dis[N];
struct Node{int ed,before;long long flow;}s[M];
void add(int x,int y,long long flow)
{
	s[++k1].ed=y; s[k1].before=fox[x]; fox[x]=k1; s[k1].flow=flow;
	s[++k1].ed=x; s[k1].before=fox[y]; fox[y]=k1; s[k1].flow=0;
}
int bfs()
{
   Q[Q[0]=1]=st; memset(dis,-1,sizeof(dis));
   dis[st]=0;
   int l=1,i;
   for (;l<=Q[0]&&dis[ed]==-1;++l)
  {
        int p=Q[l];
        for (i=fox[p];i;i=s[i].before)
          if (s[i].flow&&dis[s[i].ed]==-1)
            {
            	dis[s[i].ed]=dis[p]+1;
            	Q[++Q[0]]=s[i].ed;
			}
  }
  return dis[ed]!=-1;
}
//By Qiaoranliqu
long long dfs(int x,long long flow)
{
	if (x==ed) return flow;
	int i; long long nowans=0,a;
	for (i=fox[x];i&&flow;i=s[i].before)
	  if (dis[s[i].ed]==dis[x]+1&&s[i].flow)
	  {
	  		   a=dfs(s[i].ed,min(flow,s[i].flow));
	  		   if (a) 
	  		   	{
	  		   		nowans+=a;
	  		   		flow-=a;
	  		   		s[i].flow-=a;
	  		   		s[i^1].flow+=a;
				}
	  }
	 if (!nowans) dis[x]=(int)1e9;
	 return nowans;
}
long long maxflow()
{ 
   long long ans=0,j;
   while (bfs()) ans+=dfs(st,(long long)(1e18)); 
   return ans;
}

long long ans=0;

int a[N];

int main()
{
		scanf("%d",&n);
		for (i=1;i<=n;++i) scanf("%d",&a[i]),ans+=a[i];
		st=n+1; ed=st+1;
		for (i=1;i<=n;++i)
		{
				a[i]=-a[i];
				if (a[i]>0) ans+=a[i],add(st,i,a[i]);
				if (a[i]<0) add(i,ed,-a[i]);
				for (j=i+i;j<=n;j+=i) add(i,j,(long long)1e18);
		}
		ans-=maxflow();
		printf("%lld\n",ans);
}


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

int keta(long long int n) {
  int keta = 0;
  while(n != 0) {
    n /= 10;
    keta++;
  }

  return keta;
}

int main() {
  long long int N;
  cin >> N;
  int sq = floor(sqrt(N));
  int ans = 0;
  for(int i=1;i<=sq;i++) {
    if(N % i == 0) {
      ans = keta(N/i);
    }
  }

  cout << ans << endl;
}

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

int main(){
  long long n,m,ans=1;cin>>n>>m;
  if(abs(n-m)<=1){
    REP(i,n){
      ans*=(i+1);
      ans%=MOD;
    }
    REP(i,m){
      ans*=(i+1);
      ans%=MOD;
    }
    if(n==m){
      ans*=2;
      ans%=MOD;
    }
  }else ans=0;
  cout<<ans;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template <class _T> static _T tp_abs(const _T& a) {
	//	usage:  tp_abs<type name>(a);
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}

static void CADDi2018D_Harlequin();

#if 1
int main()
{
	CADDi2018D_Harlequin();
	fflush(stdout);
	return 0;
}
#endif

static void CADDi2018D_Harlequin()
{
	int N;
	get1int(N);
	
	const char* ans = "second\n";
	for (int i = 0; i < N; i++) {
		int num;
		get1int(num);
		if (num % 2) ans = "first\n";
	}
	printf(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <algorithm>

using namespace std;

void showIntArray(int a[], int n) {
    for (int i=0; i<n; i++) {
        cout << a[i] << ' ';
    } cout << endl;
}

int main() {
    int N, T, A;
    cin >> N;
    cin >> T >> A;

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

    double t;
    double diff_from_A;
    double min = 11451400;
    int min_i;

    for (int i=0; i<N; i++) {
        t = T - H[i] * 0.006;
        diff_from_A = A - t;
        if (diff_from_A < 0) diff_from_A *= -1;
        if (min > diff_from_A) {
            min = diff_from_A;
            min_i = i;
        }
    }
    cout << min_i + 1 << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int[] p = new int[n];
		for (int i = 0; i < n; i++) {
			p[i] = sc.nextInt();
		}
		int cnt = 0;
		for (int i = 1; i < n - 1; i++) {
			if ((p[i - 1] < p[i] && p[i] < p[i + 1])
					|| (p[i - 1] > p[i] && p[i] > p[i + 1])) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;

int main() {
    while (1) {
        string s;
        cin >> s;
        if (s == "0")
            return 0;

        long long dp[2][11];
        for (int i = 0; i < 2; ++i) {
            for (int j = 0; j < 11; ++j) {
                dp[i][j] = 0;
            }
        }
        long long ans = 0;
        for (char c : s) {
            int k = c - '0';
            long long nex[2][11];
            for (int i = 0; i < 2; ++i) {
                for (int j = 0; j < 11; ++j) {
                    nex[i][j] = 0;
                }
            }
            ++dp[0][0];
            for (int i = 0; i < 2; ++i) {
                for (int j = 0; j < 11; ++j) {
                    if (k | i) {
                        nex[1][((k - j) % 11 + 11) % 11] += dp[i][j];
                    }
                    else if (i == 1) {
                        nex[i][((k - j) % 11 + 11) % 11] += dp[i][j];
                    }
                }
            }
            for (int i = 0; i < 2; ++i) {
                for (int j = 0; j < 11; ++j) {
                    dp[i][j] = nex[i][j];
                }
            }
            ans += dp[1][0];
        }
        cout << ans << "\n";
    }
}

Measured memory_bytes: 3228
sx, sy, tx, ty = map(int, input().split())
ans = ""

dir_x = ["", "R", "L"]
dir_y = ["", "U", "D"]

dx = 1 if (tx - sx > 0) else -1
dy = 1 if (ty - sy > 0) else -1

ans += dir_x[dx] * abs(tx - sx)
ans += dir_y[dy] * abs(ty - sy)

ans += dir_x[-dx] * abs(tx - sx)
ans += dir_y[-dy] * abs(ty - sy)

ans += dir_y[-dy]
ans += dir_x[dx] * (abs(tx - sx) + 1)
ans += dir_y[dy] * (abs(ty - sy) + 1)
ans += dir_x[-dx]

ans += dir_y[dy]
ans += dir_x[-dx] * (abs(tx - sx) + 1)
ans += dir_y[-dx] * (abs(ty - sy) + 1)
ans += dir_x[dx]

print(ans)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

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

  int** G = new int*[n+1];
  for (int i = 0; i < n; i++) {
    int u,k,v;
    cin >> u >> k;
    G[u] = new int[n+1];
    for (int j = 0; j < k; j++) {
      cin >> v;
      G[u][v] = 1; 
    }
  }

  for (int i = 1; i <= n; i++) {
    cout << G[i][1];
    for (int j = 2; j <= n; j++) {
      cout << " " << G[i][j];
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 1228
#include <iostream>
using namespace std;
int main(){
    int n,x[3000]={};
    int ans=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
    }
    for(int i=0;i<n;i++){
        ans+=x[i]-1;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256