akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#define MAX 100
#define INF (1<<28)
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n, M[MAX][MAX];

int prim () {
	int u, minv, d[MAX], p[MAX], color[MAX], i, v, sum;
	
	for (i = 0; i < n; i++ ) {
		d[i] = INF;
		p[i] = -1;
		color[i] = WHITE;
	}
	d[0] = 0;
	
	while(1) {
		minv = INF;
		u = -1;
		for ( i = 0; i < n; i++ ){
			if ( minv > d[i] && color[i] != BLACK ) {
				u = i;
				minv = d[i];
			}
		}
		if ( u == -1 ) break;
		
		color[u] = BLACK;
		
		for ( v = 0; v < n; v++ ) {
			if ( color[v] != BLACK && M[u][v] != INF ) {
				if ( d[v] > M[u][v] ){
					d[v] = M[u][v] ;
					p[v] = u;
					color[v] = GRAY;
				}
			}
		}
	}
	sum = 0;
	
	for ( i = 0; i < n; i++ ) {
		if ( p[i] != -1 ) sum += M[i][p[i]];
	}
	return sum;
}

int main () {
	int e, i, j;
	scanf ( "%d", &n );
	
	for ( i = 0; i < n; i++ ) {
		for ( j = 0; j < n; j++ ){
			scanf ("%d", &e );
			M[i][j] = (e == -1) ? INF : e;
		}
	}
	printf ( "%d\n", prim());
	return 0;
}


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


int main(){
    int n, ALP[26];
    rep(i,26) ALP[i] = 100;
    cin >> n;
    rep(i,n){
        int alp[26] = {};
        string s;
        cin >> s;
        rep(j,s.size()){
            int cn = s[j] - 97;
            alp[cn] ++;
        }
        rep(k,26){
            ALP[k] = min(ALP[k], alp[k]);
        }
    }
    string ans = "";
    rep(i,26){
        char c = i + 97;
        if(ALP[i] > 0) rep(j, ALP[i]) ans += c;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
<?php

list($n) = explode(" ", trim(fgets(STDIN)));

list($s) = explode(" ", trim(fgets(STDIN)));

for($i=0;$i<strlen($s);$i++){
  $a = $s[$i];
  for($j=0;$j<$n;$j++){
    $a++;
    if($a == "AA"){
      $a="A";
    }
  }
  echo $a;
}

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

using namespace std;

#define MAX 15
 
int main()
{
    int Mag[MAX][MAX], N;
     
    while (cin >> N, N) {
        memset(Mag, 0, sizeof(Mag));
         
        int dx = N/2+1, dy = N/2, cnt = N*N, num = 1;
        Mag[dx++][dy++] = num++;
        while (num < cnt+1) {
            if (dx >= N) {
                dx = 0;
            } else if(dy >= N) {
                dy = 0;
            } else if(dy < 0) {
                dy = N-1;
            } else if(Mag[dx][dy]) {
                dx++;
                dy--;
            } else {
                Mag[dx++][dy++] = num++;
            }
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                printf("%4d", Mag[i][j]);
            }
            puts("");
        }
    }
    return 0;
}

Measured memory_bytes: 3156
#include <iostream>
#include <string>
#include <vector>
#include <set>
using namespace std;

int main(){
    int N;
    cin >> N;
    int R =0,B=0;
    for(int i = 0 ; i < N ; i++){
        char tmp;
        cin >> tmp;
        if(tmp == 'R'){
            R++;
        }
        else if(tmp == 'B'){
            B++;
        }
    }
    if(R > B){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0,a, count,ans=1;
		for(int i = 1;i <= n;i++) {
			count = 0;
			if(i % 2 == 1)continue;
			a = i;
			for(;;) {
				if(a / 2 != 0) {
					a = a/2;
					count++;
				}
				else {
					count++;
					break;
				}
			}
			if(max < count) {
				max = count;
				ans = i;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 21844
#include <stdio.h>

int main(void){
    int cnt[8] = {0};
    double l,r;
    
    while (scanf("%lf%lf",&l,&r)!=EOF){
        if (l<0.2) cnt[3]++;
        else if (l<0.6) cnt[2]++;
        else if (l<1.1) cnt[1]++;
        else cnt[0]++;
        if (r<0.2) cnt[7]++;
        else if (r<0.6) cnt[6]++;
        else if (r<1.1) cnt[5]++;
        else cnt[4]++;
    }
    for (int i=0; i<4; i++){
        printf("%d %d\n",cnt[i],cnt[i+4]);
    }
    
    return 0;
}

Measured memory_bytes: 2680
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#define INF (1000000000)
#define MOD (1000000007)
using namespace std;

typedef vector<int> VI;
typedef vector<int>::iterator VII;
typedef vector<double> VD;
typedef vector<double>::iterator VDI;
typedef pair<int, int> PII;

int d[10][10];

int main()
{
	int n;
	while (scanf("%d", &n), n){
		for (int i = 0; i < 10; i++){
			for (int j = 0; j < 10; j++){
				d[i][j] = INF * (i != j);
			}
		}
		
		int v = 0;
		
		for (int i = 0; i < n; i++){
			int a, b, c;
			scanf("%d %d %d", &a, &b, &c);
			d[a][b] = c;
			d[b][a] = c;
			
			v = max(v, max(a, b));
		}
		
		for (int k = 0; k <= v; k++){
			for (int i = 0; i <= v; i++){
				for (int j = 0; j <= v; j++){
					d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
				}
			}
		}
		
		PII mini = PII(INF, INF);
		for (int i = 0; i <= v; i++){
			int sum = 0;
			
			for (int j = 0; j <= v; j++){
				sum += d[i][j];
			}
			
			if (mini.second > sum){
				mini = PII(i, sum);
			}
		}
		printf("%d %d\n", mini.first, mini.second);
	}
}

Measured memory_bytes: 1188
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
P A[200100];
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> A[i].sec >> A[i].fi;
	}
	sort(A,A+N);
	int t = 0;
	for(int i=0;i<N;i++){
		t += A[i].sec;
		if(t>A[i].fi){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define int               long long
#define fr                first
#define sc                second
#define vc                vector
#define endl              '\n'
#define pii               pair<int,int>
#define msi               map<string,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define LSB(i)            ((i)&-(i))

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

void solve()
{
    int h;
    cin >> h;
    int ans = 0;
    int count = 1;
    while (h > 0)
    {
        ans += count;
        h /= 2;
        count *= 2;
    }
    cout << ans << endl;
}
signed main() {
    ios_base::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t = 1;
    //cin>>t;
    while (t--) solve();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long                                    // long long省略
#define pb push_back                                    // push_back省略
#define mp make_pair                                    // make_pair省略
#define fi first                                        // first省略
#define se second                                       // second省略
#define itn int                                         // int誤字保険
#define count cout                                      // cout誤字保険
#define vecotr vector                                   // vector誤字保険
#define ednl endl                                       // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false)   // 入出力速度改善

#define rep(i,l,r) for(ll i=(l);i<(r);i++)               // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k))         // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--)           // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k))     // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end()                   // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q))                       // max拡張
#define min(p,q)((p)<(q)?(p):(q))                       // min拡張
#define bit(n,m)(((n)>>(m))&1)                          // 変数nのm番目のbitを取り出す

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; }

int dy[]={0, 1, 0, -1};                                 // 4方向近傍
int dx[]={1, 0, -1, 0};                                 // 4方向近傍

int main(){
	ll n,m;cin>>n>>m;
	vector<pair<ll,ll>> p;
	rep(i,0,n){
		ll a,b;cin>>a>>b;p.pb(mp(a,b));
	}
	sort(all(p));
	ll cnt = 0, res = 0;
	for(ll i=0;;i++){
      	//cout << res << endl;
		if(p[i].se + cnt < m){
			cnt += p[i].se;
			res += p[i].fi * p[i].se;
		}else if(p[i].se + cnt >= m){
			res += p[i].fi * (m - cnt);
			break;
		}
	}
	cout << res << ednl;



}

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

const int mod = 1000000007;

struct mint {
    ll x;

    mint(ll x = 0) : x((x % mod + mod) % mod) {}

    mint operator-() const { return mint(-x); }

    mint &operator+=(const mint a) {
      if ((x += a.x) >= mod) x -= mod;
      return *this;
    }

    mint &operator-=(const mint a) {
      if ((x += mod - a.x) >= mod) x -= mod;
      return *this;
    }

    mint &operator*=(const mint a) {
      (x *= a.x) %= mod;
      return *this;
    }

    mint operator+(const mint a) const {
      mint res(*this);
      return res += a;
    }

    mint operator-(const mint a) const {
      mint res(*this);
      return res -= a;
    }

    mint operator*(const mint a) const {
      mint res(*this);
      return res *= a;
    }

    mint pow(ll t) const {
      if (!t) return 1;
      mint a = pow(t >> 1);
      a *= a;
      if (t & 1) a *= *this;
      return a;
    }

    mint inv() const {
      return pow(mod - 2);
    }

    mint &operator/=(const mint a) {
      return (*this) *= a.inv();
    }

    mint operator/(const mint a) const {
      mint res(*this);
      return res /= a;
    }
};

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

  vector<ll> a(n);
  rep(i,n) cin >> a[i];

  vector<mint> pref_sum(n + 1);
  pref_sum[0] = a[0];
  for (int i = 1; i < n; i++) {
    pref_sum[i] += pref_sum[i - 1] + a[i];
  }

  mint ans = 0;
  mint sum = pref_sum[n - 1];
  for (int i = 0; i < n - 1; i++) {
    mint v = sum - pref_sum[i];
    mint x = a[i];
    ans += x * v;
  }

  cout << ans.x << '\n';

}


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

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (auto& a : A) {
        cin >> a;
    }
    vector<int> B(N);
    for (int i = N; i >= 1; i--) {
        int cnt = 0;
        for (int j = N / i; j >= 2; j--) {
            cnt += B[i * j - 1];
        }
        if (cnt % 2 != A[i - 1]) {
            B[i - 1] = 1;
        }
    }
    int M = 0;
    vector<int> ans;
    for (int i = 0; i < N; i++) {
        if (B[i] == 1) {
            M++;
            ans.push_back(i + 1);
        }
    }
    cout << M << endl;
    for (auto a : ans) {
        cout << a << " ";
    }
    return 0;
}


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

int main(){
	int N;
	cin >> N;
	vector<long long> L(100); for(int i = 0; i < 100; ++i) L[i] = 0;

	L[0] = 2;
	L[1] = 1;
	for(int i = 2; i <= N; ++i) {
		L[i] = L[i - 1] + L[i - 2];
	}

	cout << L[N] << endl;
}


Measured memory_bytes: 256
import sys
N=int(input())
if N%2==1:
    L=[]
    for i in range(1,N):
        for j in range(i,N):
            if i==j or i+j==N:
                continue
            L.append((i,j))
    for i in range(1,N):
        L.append((i,N))
    print(len(L))
    for a,b in L:
        print(a,b)
else:
    L=[]
    for i in range(1,N+1):
        for j in range(i,N+1):
            if i==j or i+j==N+1:
                continue
            L.append((i,j))
    print(len(L))
    for a,b in L:
        print(a,b)

Measured memory_bytes: 47472
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

nums = [a, b, c, d, e]
l = [math.ceil(num/10)*10 for num in nums]
l_sub = [l[i] - nums[i] for i in range(5)]
print(sum(l) - max(l_sub))

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n,m;
    cin >> n >> m;
    long long x[n];
    long long y[n];
    long long z[n];
    long long a1[n],a2[n],a3[n],a4[n],a5[n],a6[n],a7[n],a8[n];
    for(int i=0;i<n;i++){
        cin >> x[i] >> y[i] >> z[i];
        a1[i]=x[i]+y[i]+z[i];
        a2[i]=x[i]+y[i]-z[i];
        a3[i]=x[i]-y[i]+z[i];
        a4[i]=x[i]-y[i]-z[i];
        a5[i]=-x[i]+y[i]+z[i];
        a6[i]=-x[i]+y[i]-z[i];
        a7[i]=-x[i]-y[i]+z[i];
        a8[i]=-x[i]-y[i]-z[i];
    }
    sort(a1, a1 + n, greater<long long>());
    sort(a2, a2 + n, greater<long long>());
    sort(a3, a3 + n, greater<long long>());
    sort(a4, a4 + n, greater<long long>());
    sort(a5, a5 + n, greater<long long>());
    sort(a6, a6 + n, greater<long long>());
    sort(a7, a7 + n, greater<long long>());
    sort(a8, a8 + n, greater<long long>());
    long long c[8];
    for(int i=0;i<8;i++){
        c[i]=0;
    }

        for(int j=0;j<m;j++){
            c[0]+=a1[j];
            c[1]+=a2[j];
            c[2]+=a3[j];
            c[3]+=a4[j];
            c[4]+=a5[j];
            c[5]+=a6[j];
            c[6]+=a7[j];
            c[7]+=a8[j];
        }
    sort(c, c + 8, greater<long long>());
    cout << c[0] << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, cnt = 0, monster = 0;
  cin>>n;
  vector<int> a(n), list(8, 0);
  for (int i = 0; i < n;i++){
    cin >> a[i];
    if(a[i]>=1&&a[i]<=399){
      list[0]++;
    }else if(a[i]>=400&&a[i]<=799){
      list[1]++;
    }else if(a[i]>=800&&a[i]<=1199){
      list[2]++;
    }else if(a[i]>=1200&&a[i]<=1599){
      list[3]++;
    }else if(a[i]>=1600&&a[i]<=1999){
      list[4]++;
    }else if(a[i]>=2000&&a[i]<=2399){
      list[5]++;
    }else if(a[i]>=2400&&a[i]<=2799){
      list[6]++;
    }else if(a[i]>=2800&&a[i]<=3199){
      list[7]++;
    }else{
      monster++;
    }
  }
  for (int i = 0; i < 8;i++){
    if(list[i]>=1){
      cnt++;
    }
    //cout << list[i] << " list" << endl;
  }
  if(cnt==0){
    cnt++;
    monster--;
  }
  cout << cnt << " " << cnt + monster << endl;
  return 0;
}

Measured memory_bytes: 3528
///
// File:  b.go
// Author: ymiyamoto
//
// Created on Sat May  5 21:01:31 2018
//
package main

import (
	"fmt"
)

var A, B, C, K int

func pow2(n int) int {
	if n == 0 {
		return 1
	} else {
		return 2 * pow2(n-1)
	}
}

func main() {
	fmt.Scan(&A, &B, &C)
	fmt.Scan(&K)

	ans := 0
	if A < B {
		if B < C {
			ans = A + B + C*pow2(K)
		} else {
			ans = A + B*pow2(K) + C
		}
	} else {
		if A < C {
			ans = A + B + C*pow2(K)

		} else {
			ans = A*pow2(K) + B + C
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    long double area;
    int ways;
    if(2*c==a&&2*d==b)ways=1;
    else ways=0;
    area=(long double)a*b/2.0;
    cout<<fixed<<setprecision(15)<<area<<" ";
    cout<<ways<<endl;
}

Measured memory_bytes: 256
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=500000;
typedef struct R { double t; int vol; } R;
R merge(const R &a,const R &b) { R ret; ret.t=(a.t*a.vol+b.t*b.vol)/(a.vol+b.vol); ret.vol=a.vol+b.vol; return ret; }

int n,need;
R q[MAXN]; int qhead,qtail;

void run() {
	scanf("%d%d",&n,&need);
	double tavg; qhead=qtail=0;
	REP(i,n) {
		R have; scanf("%lf%d",&have.t,&have.vol);
		//FOR(j,qtail,qhead) { printf("\t%d*%.9lf\n",q[j].vol,q[j].t); if(j>10) exit(0); }
		if(i==0) {
			tavg=have.t; q[qhead++]=have;
		} else {
			tavg=(tavg*need+have.t*have.vol)/(have.vol+need);
			int rem=have.vol;
			while(rem>0) {
				assert(qtail<qhead); R &cur=q[qtail];
				int now=min(rem,cur.vol);
				//printf("removing %d of temp %.9lf\n",now,cur.t);
				rem-=now; cur.vol-=now; tavg=(tavg*(need+rem+now)-1.0*cur.t*now)/(need+rem);
				while(qtail<qhead&&q[qtail].vol==0) ++qtail;
			}
			while(qtail<qhead&&have.t<q[qhead-1].t) have=merge(have,q[--qhead]);
			//printf("-> %d of temp %.9lf (%.9lf)\n",have.vol,have.t,qtail<qhead?q[qhead-1].t:-1.0);
			q[qhead++]=have;
		}
		printf("%.9lf\n",tavg);
	}
}

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


Measured memory_bytes: 17920
a,b = sorted([int(s) for s in input().split()])
def p(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

ls = [s[0] for s in p(a)]
p = 1

for i in ls:
  if b % i == 0:
    p += 1
if a == 1:
  print(1)
else:
	print(p)

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

using namespace std;

int main(void) {
    int a, b;
    cin >> a >> b;
    for (int x = 1; x <= 1000; x++) {
        if ((int)(x * 0.08) == a && (int)(x * 0.1) == b) {
            cout << x << endl;
            return 0;
        }
    }

    cout << -1 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;

int a[10][10];

int main() {
    for(int cs = 1; ; cs++) {
        int n; scanf("%d", &n);
        if(n == 0) break;
        int num = 1;
        memset(a, 0, sizeof(a));
        for(int k = 0; k < 2 * n - 1; k += 2) {
            for(int y = k; y >= 0; y--) {
                int x = k - y;
                if(0 <= x && x < n && 0 <= y && y < n) {
                    a[y][x] = num++;
                }
            }

            for(int y = 0; y < k + 2; y++) {
                int x = k + 1 - y;
                if(0 <= x && x < n && 0 <= y && y < n) {
                    a[y][x] = num++;
                }
            }
        }
        printf("Case %d:\n", cs);
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                printf("%3d", a[i][j]);
            }
            printf("\n");
        }
    }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

//using namespace atcoder;
using namespace std;

int main(void){
  string s;
  cin >> s;
  
  if (s[0] == s[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
    

  return 0;
}


Measured memory_bytes: 3604
n = int(input())
a = list(map(int, input().split()))
p = 1000000007
 
z = 0
for i in range(n):
    z += a[i]
    z = z % (2 * p)
 
y = (z ** 2) % (2 * p)
 
x = 0
for j in range(n):
    x += a[j] ** 2
    x = x % (2 * p)
 
w = int(((y - x) / 2) % p)
print(w)

Measured memory_bytes: 31448
from collections import Counter
n=int(input())
aa=list(map(int,input().split()))
a=Counter(aa)
aa=sum(aa)
aaa=[]
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  aa+=(c-b)*a[b]
  if c in a.keys():
    a[c]+=a[b]
  else:
    a[c]=a[b]
  a[b]=0
  aaa.append(str(aa))
print('\n'.join(aaa))

Measured memory_bytes: 27244
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;
#[allow(dead_code)]
const MOD:i64 = 1e9 as i64 + 7;


fn main() {
    input!{n:i64, k:i64};
    println!("{}", k * (k-1).pow((n-1) as u32));

}





Measured memory_bytes: 4352
/**
	If you only do what you can do, 
	You will never be more than you are now!
	----------------------------------------
	We must all suffer from one of two pains: the pain of discipline or the pain of regret. 
	The difference is discipline weighs grams while regret weighs tons.
**/
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define F first
#define S second
#define show(a) cerr << #a <<" -> "<< a <<"\n"
#define fo(a, b, c, d) for(int (a) = (b); (a) <= (c); (a) += (d))
#define foo(a, b, c ,d) for(int (a) = (b); (a) >= (c); (a) -= (d))
//#define int ll

const int N = 300;
const int INF = 1e9;

int n, a[N], ans;

int main () {
	ios_base::sync_with_stdio(false);
	cin >> n;
	fo(i, 1, 2 * n, 1) {
		cin >> a[i];
	}	
	sort(a + 1, a + 2 * n + 1);
	fo(i, 1, 2 * n, 2) {
		ans += a[i];
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
"""nを素因数分解"""
"""2以上の整数n => [(素因数, 指数), ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n**0.5)+1):
        if temp%i == 0:
            cnt = 0
            while temp%i == 0:
                cnt += 1
                temp //= i
            arr.append((i, cnt))
    if temp != 1:
        arr.append((temp, 1))
    if arr == []:
        arr.append((n, 1))
    return arr

n = int(input())
k = 0
for j in range(1, n+1):
    if j%2==1:
        li = factorization(j)
        l = []
        for (x, y) in li:
            l.append(y)
        count = 1
        for i in l:
            count *= i+1
        if count == 8:
            k += 1
print(k)

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

using namespace std;

int main() {
    vector<int> L = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K; cin >> K;

    cout << L[K-1] << endl;

    return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int live[100010];
int p[100010];
int gcd(int a,int b){
    int m=a%b;
    while(m){
        a=b;b=m;
        m=a%b;
    }
    return b;
}
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>live[i];
	}
	for(int i=1;i<=n-1;i++)
	{
		live[i+1]=gcd(live[i],live[i+1]);
		//cout<<gcd(live[i],live[i+1]); 
	}
	cout<<live[n];
	return 0;
} 

Measured memory_bytes: 640
# coding: utf-8


def solve(*args: str) -> str:
    d, g = map(int, args[0].split())
    pc = [tuple(map(int, a.split())) for a in args[1:]]
    inf = 10**5

    count = inf
    for b in range(2**d):
        score, cnt = 0, 0

        for i in range(d):
            p, c = pc[i]
            if b >> i & 1:
                score += p*100*(i+1)+c
                cnt += p

        if score < g:
            for i in reversed(range(d)):
                if b >> i & 1:
                    continue
                else:
                    p, c = pc[i]
                    j = 0
                    while score < g and j < p:
                        score += 100*(i+1)
                        cnt += 1
                        j += 1

                    if j == p:
                        score += c

        count = min(count, cnt)

    return str(count)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i,N) {cin >> A.at(i);}
    int c = 0;
    while (1) {
        rep(i,N) {
            if (A.at(i) % 2 == 0) A.at(i) /= 2;
            else goto LABEL;
        }
        c++;
    }
LABEL:
    cout << c << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() (rand() >> 3)*rand()
#define scan(X) do{while((X=getchar())<'0'); for(X-='0'; '0'<=(_=getchar()); X=(X<<3)+(X<<1)+_-'0');}while(0)
char _;
#define pi 3.14159265358979323846

int n, m, a[100005], x, y, p, c, cnt[100005], k;
ll ans;
vector<int> v[100005];
vector<pii> w;
bool u[100005];
void dfs(int N){
    if (u[N]) return; u[N]=1;
    fox(l, v[N].size()){
        dfs(v[N][l]);
    }
    w.pb(mp(a[N], p));
}
int main(){
    //find top (N-1-M)*2 values
    //no more than (N-1-M) from the same component
    cin >> n >> m;
    if (m==n-1){
        cout << 0;
        return 0;
    }
    fox(l, n) scanf("%i", a+l);
    fox(l, m){
        scanf("%i%i", &x, &y);
        v[x].pb(y);
        v[y].pb(x);
    }
    fox(l, n){
        if (!u[l]){
            dfs(l);
            ++p;
        }
    }
    sort(w.begin(), w.end());
    k=n-1-m;
    fox(l, w.size()){
        if (cnt[w[l].y]==1) continue;
        //cout << w[l].x <<  ' ' << w[l].y << endl;
        cnt[w[l].y]++;
        ans+=w[l].x;
        c++;
    }
    //cout << c << ' ' << p<< endl;
    if (c!=p){
        cout << "Impossible";
        return 0;
    }
        if (c==2*k){
            cout << ans;
            return 0;
        }
    fox(l, w.size()){
        if (cnt[w[l].y]==1){
            cnt[w[l].y]=0;
            continue;
        }
        //cout << w[l].x <<  ' ' << w[l].y << endl;
        ans+=w[l].x;
        c++;
        //cout << c << ' ' << k << endl;
        if (c==2*k){
            cout << ans;
            return 0;
        }
    }
    cout << "Impossible";
    return 0;
}


Measured memory_bytes: 7420
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;
 
int main() {
    int n;
    cin >> n;
    vector<int> l(n);
    rep(i, n)cin >> l[i];
    int ans = 0;
    sort(all(l));
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            ans += ( lower_bound(all(l), l[i]+l[j]) - l.begin() ) - j - 1;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 10, M = 1e3 + 5;
int h, w, k, ans, row[M];
char a[N][M];
bool valid(int mask){
    deque<int>dq, tmp;
    for(int i = 0; i < h - 1; i++){
        if(mask & (1 << i))
            tmp.push_back(i);
    }
    tmp.push_back(h - 1);
    int i = 0, j = 0, cnt = 0;
    while(j < w){
        dq = tmp;
        cnt = i = 0;
        while(!dq.empty()){
            while(i <= dq.front())
                cnt += (a[i++][j] == '1');
            dq.pop_front();
            if(cnt > k) return 0;
            cnt = 0;
        }
        j++;
    }
    return 1;
}
int solve(int mask){
    deque<int>dq, tmp;
    for(int i = 0; i < h - 1; i++){
        if(mask & (1 << i))
            tmp.push_back(i);
    }
    tmp.push_back(h - 1);
    int mx = 0, ans = 0;
    for(int j = 0; j < w; j++){
        for(int i = 0; i < h; i++){
            if(!mx) row[i] = (a[i][j] == '1');
            else row[i] += (a[i][j] == '1');
        }
        dq = tmp;
        int ii = 0, cnt = 0;
        while(!dq.empty()){
            cnt = 0;
            while(ii <= dq.front())
                cnt += row[ii++];
            dq.pop_front();
            mx = max(mx, cnt);
        }
        if(mx > k){
            ans++;
            j--;
            mx = 0;
            memset(row, 0, sizeof row);
        }
    }
    if(mx > k) ans++;
    return ans;
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> h >> w >> k;
    for(int i = 0; i < h; i++)
        for(int j = 0; j < w; j++)
            cin >> a[i][j];
    ans = 1e9;
    for(int i = 0; i < 1 << (h - 1); i++){
        if(valid(i)){
            int ones = __builtin_popcount(i);
            ans = min(ans, ones + solve(i));
        }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
from itertools import combinations
import sys
from collections import defaultdict, deque
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
DDX = (-1, 0, 1, 0, -1, -1, 1, 1)
DDY = (0, 1, 0, -1, -1, 1, -1, 1)
DX = DDX[:4]
DY = DDY[:4]


H, W = map(int, input().split())
Cx, Cy = map(int, input().split())
Dx, Dy = map(int, input().split())

grid = ["#" * (W + 2)]
for _ in range(H):
    inp = "#" + input().strip() + "#"
    grid.append(inp)
grid.append("#" * (W + 2))


area = [[-1] * (W + 2) for _ in range(H + 2)]
cnt = 0
for i in range(1, H + 1):
    for j in range(1, W + 1):
        if grid[i][j] == "#" or area[i][j] != -1:
            continue
        cnt += 1
        node = [(i, j)]
        area[i][j] = cnt
        while node:
            x, y = node.pop()
            for dx, dy in zip(DX, DY):
                nx = x + dx
                ny = y + dy
                if grid[nx][ny] == "#":
                    continue
                if area[nx][ny] == -1:
                    area[nx][ny] = cnt
                    node.append((nx, ny))


used = defaultdict(int)

edge = [[] for _ in range(cnt + 1)]
for i in range(1, H + 1):
    for j in range(1, W + 1):
        memo = set()
        if grid[i][j] == ".":
            memo.add(area[i][j])
        for dx, dy in zip(DDX, DDY):
            if area[i + dx][j + dy] == -1:
                continue
            memo.add(area[i + dx][j + dy])
        for x, y in combinations(memo, 2):
            if x > y:
                x, y = y, x
            if used[(x, y)]:
                continue
            edge[x].append(y)
            edge[y].append(x)
            used[(x, y)] = 1


dist = [-1] * (cnt + 1)
ci = area[Cx][Cy]
di = area[Dx][Dy]
dist[ci] = 0
node = deque([ci])
while node:
    s = node.popleft()
    for t in edge[s]:
        if dist[t] != -1:
            continue
        dist[t] = dist[s] + 1
        node.append(t)

print(dist[di])

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  int x; std::cin >> x;
  int ans = 1;
  srep(i, 2, x) {
    int xx = i*i;
    while (xx*i <= x) xx *= i;
    if (xx <= x) chmax(ans, xx);
  }
  std::cout << ans << "\n";
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main{
	public static final long MODULO= 1000000007;
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		long power = 1;
		for(int i=1; i<=n; i++){
			power = (power*i)%MODULO;
		}
		System.out.println(power);		
	}
}

Measured memory_bytes: 21844
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
a,b,c = [list(i) for i in zip(*l)]
dp = [[0,0,0] for i in range(n+1)]
for i in range(n):
    dp[i+1][0] = max(dp[i][1]+a[i],dp[i][2]+a[i])
    dp[i+1][1] = max(dp[i][0]+b[i],dp[i][2]+b[i])
    dp[i+1][2] = max(dp[i][0]+c[i],dp[i][1]+c[i])
print(max(dp[-1]))

Measured memory_bytes: 120868
#include "bits/stdc++.h"
#define rep(i,n) for(ll i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
#define ll long long

int main(void){
  int x;
  cin>>x;
  for(int now=1;now<=100000;now++){
    if((int)((float)now*1.08)==x){
      cout<<now<<endl;
      return 0;
    }
  }
  cout<<":("<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define intm INT_MAX
#define llm LLONG_MAX

using namespace std;
int intmod = 998244353;

pair<ll,ll> ar[200030];
ll j[200030];
ll dp[200030];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
    int N;
    ll x,d;
    cin >> N;
    for(int i=0; i < N; i++){
        cin >> x >> d;
        ar[i] = make_pair(x,d);
    }
    sort(ar,ar+N);
    stack<pair<ll,ll> > st;
    st.push(make_pair(N,llm));
    for(int i=N-1; i >=0 ; --i){
        while( ar[i].first + ar[i].second > st.top().second ) st.pop();
        j[i] = st.top().first;
        st.push( make_pair(i,ar[i].first) );
    }
    dp[N] = 1; // no robots && dp[N-1] = 2;
    for(int i=N-1; i >=0; --i){
        dp[i] = (dp[i+1] + dp[j[i]]) % 998244353;
    }
    cout << dp[0];
    /*
    for(int i=0; i <= N-1; i++) cout << j[i] << " ";
    cout <<  endl;
    for(int i=0; i <= N-1; i++) cout << dp[i] << " ";
    */


}



Measured memory_bytes: 8192
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			var nm = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
			int n = (int)nm[0];
			long m = nm[1];
			long[] a = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

			long[] sums = new long[n + 1];
			for (int i = 0; i < n; i++) {
				sums[i + 1] = (sums[i] + a[i]) % m;
			}

			var counts = new Dictionary<long, long>();
			for (int i = 0; i < n + 1; i++) {
				if (counts.ContainsKey(sums[i])) {
					counts[sums[i]]++;
				} else {
					counts[sums[i]] = 1;
				}
			}

			long ans = 0;
			foreach (var count in counts) {
				ans += (count.Value * (count.Value - 1) / 2);
			}

			Console.WriteLine(ans);
		}
	}
}


Measured memory_bytes: 25952
#include<stdio.h>
int main()
{
  	int n;
	scanf("%d",&n);
	int d[n];
  int i,j;
  for(i=0;i<n;i++)
  scanf("%d",&d[i]);
	int sum=0;
for(i=0;i<n;i++)
{
  for(j=i+1;j<n;j++)
  {
    sum=sum+(d[i]*d[j]);
  }
}
printf("%d",sum);
  return 0;
}

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

// DP テーブル (配列全体が false に自然に初期化される)
bool dp[110000]; // 局面数は最大 100001 だが少し余裕もたせる

int main() {
    // 入力受け取り
    int N, K; cin >> N >> K;
    vector<int> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];

    // DP
    for (int i = 1; i <= K; ++i) {
        for (int j = 0; j < N; ++j) {
            if (i - a[j] >= 0) dp[i] |= !dp[i - a[j]];
        }
    }

    // 答え
    if (dp[K]) cout << "First" << endl;
    else cout << "Second" << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    string s; cin >> s;
    int cnt = 0;
    for(int i = 0; i < a+b+1; i++) if(s[i] == '-') cnt++;
    if(cnt != 1){
        puts("No");
        return 0;
    }
    for(int i = 0; i < a+b+1; i++){
        int x = s[i] - '0';
        if(s[i] == '-'){
            if(i != a){
                puts("No");
                return 0;
            }
        }
        else{
            if(!(0 <= x && x <= 9)){
                puts("No");
                return 0;
            }
        }
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VL vector<long long>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int main(){
    DRI(n);
    map<int,int>H;
    REP(i,n){
        DRI(x);
        H[x]^=1;
    }
    int an=0;
    for(auto x=H.begin();x!=H.end();x++)an+=x->S;
    return 0*printf("%d\n",an);
}


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

using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;

#define Max 1000001
#define intinf 2147483647
#define longlonginf 9223372036854775807
#define MOD 998244353
#define MOD2 1000000007
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define vint vector<int>
#define vll vector<long long>
#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define F(i,n) for(int i = 0;i<n;i++)
#define Fr(i,l,r) for(int i = l;i <= r;i++)
#define rF(i,n) for(int i = n-1;i>=0;i--)
#define all(arr) arr.begin(),arr.end()


ll Lpow(ll a,ll b)
{
    ll ans = 1;
    while(b > 0)
    {
        if(b%2)
            ans = (ans*a);
        a = (a*a);
        b = b/2;
    }
    return ans;
}

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

ll dp[105][100005];

signed main()
{
    fastio;
    
    ll n,k;
    cin >> n >> k;
    
    vector<ll> arr(n+1);
    
    F(i,n)
        cin >> arr[i+1];
    
    dp[0][k] = 1;
    for(int i = 1;i<=n;i++)
    {
        for(int j = 1;j<=100000;j++)
        {
            dp[i-1][j] = (dp[i-1][j] + dp[i-1][j-1])%MOD2;
        }
        for(int j = 0;j<=100000;j++)
        {
            if(j >= 1)
                dp[i][j] = (dp[i][j] + (dp[i-1][min(arr[i] + j,100000ll)] - dp[i-1][j-1] + MOD2)%MOD2)%MOD2;
            else
                dp[i][j] = (dp[i][j] + dp[i-1][min(arr[i] + j,100000ll)])%MOD2;
        }
    }
    
    cout << dp[n][0] << endl;
    
    return 0;
}


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



class UnionFind{
    public:
    //親の番号を格納する。親だった場合は-(その集合のサイズ)
    vector<ll> parent;

    //-1で初期化。最初はすべてバラバラ
    UnionFind(ll N){
        parent = vector<ll>(N,-1);
    }

    //Aがどのグループに属しているか(Aの根)を調べる
    ll root(ll A){
        if(parent[A] < 0) return A;
        return parent[A]=root(parent[A]);
    }

    //自分のいるグループの頂点数を調べる
    ll size(ll A){
        return -parent[root(A)];
    }

    //AとBをくっつける
    bool unite(ll A, ll B) {
    //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        //既にくっついているからくっつけない
        if(A == B) return false; 

        //大きいほう(A)に小さいほう(B)をくっつける
        //大小が逆ならひっくり返す
        if(size(A) < size(B)) swap(A,B);

        //Aのサイズを更新する
        parent[A] += parent[B];
        //Bの親をAに変更する
        parent[B] = A;

        return true;
    }

    //AとBが同じグループならtrueを返す
    bool same(ll A, ll B){
        return root(A)==root(B);
    } 
};

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    ll n,m,q;
    cin>>n>>m>>q;
    UnionFind uni(n);
    vector<pair<ll,ll>> v;
    for(ll i=0;i<q;i++){
        ll a,b,c;
        cin>>a>>b>>c;
        if(c==0) uni.unite(a,b);
        else v.push_back(make_pair(a,b));
    }
    ll cnt=0,siz=0;
    for(ll i=0;i<n;i++){
        if(i==uni.root(i)){
            cnt++;
            siz += uni.size(i)-1;
        }
    }

    for(auto i:v){
        if(uni.same(i.first,i.second)){
            cout << "No" << endl;
            return 0;
        }
    }
    if(v.size() && cnt<=2){
        cout << "No" << endl;
        return 0;
    }
    ll s=(v.size()? 1:0);
    if(m>=siz+cnt-1+s && m<=siz + cnt*(cnt-1)/2){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
    // cerr << siz << " " << cnt << endl;
    // cerr << siz+cnt-1 << " " << m << " " << siz + cnt*(cnt-1)/2 << endl;




}

Measured memory_bytes: 3188
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int main(){
  int N, T;
  int cost, time;
  int ans = 10000;
  bool flag = false;

  cin >> N >> T;
  for(int i=0;i<N;i++){
  	cin >> cost >> time;
  	if(time<=T){
  		ans = min(ans, cost);
  		flag = true;
  	}
  }

  if(flag) cout << ans <<endl;
  else cout << "TLE" <<endl;

  return 0;
}

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

#define ll long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

//const int MOD = 1e9 + 7;
const int MAX = 1e5 + 1;
int a[MAX];

int main()
{
	//IOS
	int t = 1;
	//cin >> t;
	while(t--)
	{
		int a, b, c;
		cin >> a >> b >> c;
		int k;
		cin >> k;
		while(b <= a && k > 0)
		{
			b *= 2;
			k -= 1;
		}
		while(c <= b && k > 0)
		{
			c *= 2;
			k -= 1;
		}
		if(b > a && c > b) cout << "Yes";
		else cout << "No";
	}
	return 0;
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef double db;
#define fir first
#define sec second
#define rep(i,a,b) for (int i = (a); i <= (b); ++ i)
#define rrp(i,a,b) for (int i = (a); i >= (b); -- i)
#define gc() getchar()
template <typename tp>
inline void read(tp& x) {
  x = 0; char tmp; bool key = 0;
  for (tmp = gc(); !isdigit(tmp); tmp = gc())
    key = (tmp == '-');
  for (; isdigit(tmp); tmp = gc())
    x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x,tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x,tp y) {
  x = x < y ? y : x;
}

int MOD;
inline void Add(int& x,int y) {
  x = x + y >= MOD ? x + y - MOD : x + y;
}
inline void Sub(int& x,int y) {
  x = x - y < 0 ? x - y + MOD : x - y;
}

const int N = 160;
int n, k, dp[N][N][N];
void solve0() {
  k >>= 1; ++ k;
  dp[0][0][0] = 1;
  // continus odd (even) 1s less than k
  rep (i, 1, n) {
    if (i&1) {
      rep (a, 0, k-1) rep (b, 0, k-1) {
	Add(dp[i][0][b], dp[i-1][a][b]);
	if (a + 1 < k) Add(dp[i][a+1][b], dp[i-1][a][b]);
      }
    } else {
      rep (a, 0, k-1) rep (b, 0, k-1) {
	Add(dp[i][a][0], dp[i-1][a][b]);
	if (b + 1 < k) Add(dp[i][a][b+1], dp[i-1][a][b]);
      }
    }
  }
  int ans = 0;
  rep (a, 0, k-1) rep (b, 0, k-1)
    Add(ans, dp[n][a][b]);
  cout << ans << endl;
}
pii arr[N];
int acnt;
void solve1() {
  rep (i, 1, (k+1)/2) arr[++acnt] = pii(1, i);
  rep (i, (k+1)/2 + 1, (n+1)/2) {
    arr[++acnt] = pii(1, i);
    arr[++acnt] = pii(0, i - (k+1)/2);
  }
  rep (i, (n+1)/2-(k+1)/2+1, n/2)
    arr[++acnt] = pii(0, i);
  dp[0][0][0] = 1;
  rep (i, 1, n) {
    int tp = arr[i].fir, p = arr[i].sec;
    if (tp == 0) {
      rep (a, 0, n) rep (b, 0, n) if (dp[i-1][a][b]) {
	Add(dp[i][0][b], dp[i-1][a][b]);
	if (p+(k+1)/2 > (n+1)/2 || b == 0) {
	  if (a == 0 || a > p)
	    Add(dp[i][a][b], dp[i-1][a][b]);
	} else if ((a == 0 || a > p) && p+k-b+1 > p)
	  Add(dp[i][a == 0 ? p+k-b+1 : min(a, p+k-b+1)][b], dp[i-1][a][b]);
      }
    } else {
      rep (a, 0, n) rep (b, 0, n) if (dp[i-1][a][b]) {
	Add(dp[i][a][0], dp[i-1][a][b]);
	Add(dp[i][a][b+1], dp[i-1][a][b]);
      }
    }
  }
  int ans = 0;
  rep (a, 0, n) rep (b, 0, n)
    Add(ans, dp[n][a][b]);
  cout << ans << endl;
}
int main() {
  read(n), read(k), read(MOD);
  if (k % 2 == 0) solve0();
  else solve1();
  return 0;
}


Measured memory_bytes: 13952