akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vecpll vector<pll>
#define vecbl vector<bool>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}

int main(){
    string s=stin(),t=stin();
    int ans=0;
    rep(i,s.size())if(s[i]!=t[i])ans++;
    cout<<ans<<endl;
}

Measured memory_bytes: 3904
/***********************************************************
	When you are inspired by passion 
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

					huzaifa242©

***********************************************************/
#include <bits/stdc++.h>
using namespace std;
#define int int32_t
#define MAX 100005
#define x first 
#define y second

int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l=0,int r=INT_MAX)
{return uniform_int_distribution<int>(l,r)(rng);}

template <typename T,typename G>
ostream& operator << (ostream& out, const pair<T,G> &a) 
{return out<<"( "<<a.x<<", "<<a.y<<")";}

template <typename T>
ostream& operator << (ostream& out, const vector<T> &a) 
{out<<"[ ";for(const auto &i:a)out<<i<<", ";return out<<"]"<<endl;}

template <typename T>
ostream& operator << (ostream& out, const set<T> &a) 
{out<<"{ ";for(const auto &i:a)out<<i<<", ";return out<<"}"<<endl;}

template <typename T,typename G>
ostream& operator << (ostream& out, const map<T,G> &a) 
{out<<"< ";for(const auto &i:a)out<<i<<", ";return out<<">"<<endl;}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<"[ ";for(size_t i=0;i<N;++i)out<<a[i]<<", ";out <<"]"<<endl;return out;}

void debug_out(){cerr<<endl;} 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{cerr<<(H)<<" ";debug_out(T...);}
 
#ifdef LOCAL
#define debug(...) cerr<<"#"<<#__VA_ARGS__<<":\n",debug_out(__VA_ARGS__)
#else
#define debug(...) 24
#endif

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	string s;
	cin>>s;
	for(auto &c:s){
		cout<<"x";
	}
	cout<<"\n";
	return 0;
}


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

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<char>> board(h, vector<char>(w));
    rep(i, 0, h){
        rep(j, 0, w){
            cin >> board[i][j];
            if(board[i][j] == '.') board[i][j] = '0';
        }
    }
    rep(i, 0, h){
        rep(j, 0, w){
            if(board[i][j] == '#'){
                if(i-1 >=0 && board[i-1][j] != '#') board[i-1][j]++;
                if(i+1 <h && board[i+1][j] != '#') board[i+1][j]++;
                if(j-1 >=0 && board[i][j-1] != '#') board[i][j-1]++;
                if(j+1 <w && board[i][j+1] != '#') board[i][j+1]++;
                if(i+1 <h && j+1 <w && board[i+1][j+1] != '#') board[i+1][j+1]++;
                if(i-1 >=0 && j+1 <w && board[i-1][j+1] != '#') board[i-1][j+1]++;
                if(i+1 <h && j-1 >=0 && board[i+1][j-1] != '#') board[i+1][j-1]++;
                if(i-1 >=0 && j-1 >=0 && board[i-1][j-1] != '#') board[i-1][j-1]++;

            }
        }
    }
    rep(i, 0, h){
        rep(j, 0, w){
            cout << board[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var b = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

        var c = new int[n];
        c[0] = a[0];
        for (int i = 1; i < n; i++)
        {
            c[i] = c[i - 1] + a[i];
        }

        var d = new int[n];
        d[n - 1] = b[n - 1];
        for (int i = n - 2; i >= 0; i--)
        {
            d[i] = d[i + 1] + b[i];
        }

        var ans = 0;
        for (int i = 0; i < n; i++)
        {
            ans = Math.Max(ans, c[i] + d[i]);
        }
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;


unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll h, w, k;
    cin >> h >> w >> k;
    k--;
    vector<ll> m;
    m = { 1,1,2,3,5,8,13,21,34,55 };
    vector<ll> dp(w);
    dp[0] = 1;
    for (int i = 0; i < h; i++) {
        vector<ll> zdp(w);
        for (int i = 0; i < w-1; i++) {
            zdp[i] += dp[i + 1]*m[i]*m[w-i-2];
        }
        for (int i = 1; i < w; i++) {
            zdp[i] += dp[i - 1] *m[i-1]*m[w-i-1];
        }
        for (int i = 0; i < w; i++) {
            zdp[i] += dp[i] * m[i] * m[w - i-1];
        }
        for (int i = 0; i < w; i++) {
            dp[i] = zdp[i]%1000000007;
        }
    }
    cout << dp[k] << endl;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

map<ll, ll> prime_factorization(ll n){
  map<ll, ll> ans;
  ll a = 2;
  while(n >= a*a){
    if(n % a == 0){
      ans[a]++;
      n /= a;
    }else{
      a++;
    }
  }
  ans[n]++;

  return ans;
}

int main(){
  int n;
  cin >> n;
  map<ll, ll> pm;
  rep2(i, 1, n+1){
    auto add = prime_factorization(i);
    for(auto p : add){
      pm[p.first] += p.second;
    }
  }
  // for(auto p : pm){
  //   cerr << p.first << " " << p.second << endl;
  // }
  int ans = 0;
  for(auto aitr = pm.begin(); aitr != pm.end(); aitr++){
    int ac = aitr->second;
    if(ac >= 74) ans++;
    auto bitr = aitr;
    bitr++;
    for(; bitr != pm.end(); bitr++){
      int bc = bitr->second;
      if(ac >= 14 && bc >= 4) ans++;
      if(ac >= 4 && bc >= 14) ans++;
      if(ac >= 24 && bc >= 2) ans++;
      if(ac >= 2 && bc >= 24) ans++;
      auto citr = bitr;
      citr++;
      for(; citr != pm.end(); citr++){
        int cc = citr->second;
        if(ac >= 2 && bc >= 4 && cc >= 4) ans++;
        if(bc >= 2 && ac >= 4 && cc >= 4) ans++;
        if(cc >= 2 && ac >= 4 && bc >= 4) ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[61];
        for (int i = 0; i < n; i++) {
            long x = sc.nextLong();
            for (int j = 0; j <= 60; j++) {
                if((x >> j & 1) == 1){
                    a[j]++;
                }
            }
        }
        long ans = 0L;
        long b = 1L;
        for (int i = 0; i <= 60; i++) {
            ans = (ans + ((b * (long)a[i])%MOD * (long)(n-a[i]))%MOD ) % MOD;
            b = (b * 2L) % MOD;
        }
        System.out.println(ans);
        sc.close();

    }

}


Measured memory_bytes: 88292
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    var ans = 0
    var c = ' '
    for (i in 0 until n) {
        if (c != s[i]) {
            ans++
        }
        c = s[i]
    }
    println(ans)
}


Measured memory_bytes: 34332
#include<iostream>

int a, b, c, d;
int s[3], e = s[0];

int main()
{
	std::cin >> a >> b >> c >> d;

	s[0] = a + c;
	s[1] = a + d;
	s[2] = b + c;
	s[3] = b + d;

	for(int i = 0; i < 4; i++)
	{
		if(s[i] < e)
		{
			e = s[i];
		}
	}
	std::cout << e << std::endl;
	return 0;
}

Measured memory_bytes: 504
using System;
using System.Linq;

namespace _1616
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                if (x[0] == 0 && x[1] == 0) break;
                int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
                int max = 0;
                for (int i = 0; i < x[0]; i++)
                {
                    for (int j = i + 1; j < x[0]; j++)
                    {
                        int n = a[i] + a[j];
                        if (max < n && n <= x[1]) max = n;
                    }
                }
                Console.WriteLine(max == 0 ? "NONE" : max.ToString());
            }
        }
    }
}

Measured memory_bytes: 9940
#pragma GCC optimize("Ofast")
  #pragma GCC target("avx,avx2,fma")
  #include <bits/stdc++.h>
  using namespace std;
  //---------------------------------//
  void __print(int x) {cerr << x;}
  void __print(long x) {cerr << x;}
  void __print(long long x) {cerr << x;}
  void __print(unsigned x) {cerr << x;}
  void __print(unsigned long x) {cerr << x;}
  void __print(unsigned long long x) {cerr << x;}
  void __print(float x) {cerr << x;}
  void __print(double x) {cerr << x;}
  void __print(long double x) {cerr << x;}
  void __print(char x) {cerr << '\'' << x << '\'';}
  void __print(const char *x) {cerr << '\"' << x << '\"';}
  void __print(const string &x) {cerr << '\"' << x << '\"';}
  void __print(bool x) {cerr << (x ? "true" : "false");}

  template<typename T, typename V>
  void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  template<typename T>
  void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  void _print() {cerr << "]\n";}
  template <typename T, typename... V>
  void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  #ifndef ONLINE_JUDGE
  #define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
  #else
  #define deb(x...)
  #endif
 //------------------------------//

  typedef long long int ll;
  typedef pair<int,int> pi;
  typedef pair<ll,ll> pll;
  typedef vector<int> vi;
  typedef vector<ll> vll;
  typedef vector<pi> vpi;
  typedef vector<pll> vpll;

  #define  ff           first
  #define  ss           second
  #define  pb           push_back
  #define  IOS          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  #define  all(x)       (x).begin(), (x).end()
  #define  ps(x,y)      fixed<<setprecision(y)<<x
  #define  rep(i,a,b)   for(ll i=a ; i<b ; ++i)

  const ll MOD = 1e9 + 7;
  const ll INF = 1e18;
  const ll maxn = 1e6 + 4;


  void solve(){
    int n;
    cin >> n;
    vll sum(n);
    ll ans=0;
    vll v(n);
    for(int i=0;i<n;i++){
      cin >> v[i];
    }
    for(int i=n-1;i>=0;i--){
       if(i==n-1){
         sum[i] = 0;
       }
       else{
         sum[i] = (sum[i+1]+v[i+1])%MOD;
       }
       
    }
    for(int i=0;i<n-1;i++){
      ans = (ans+((sum[i])*(v[i]))%MOD)%MOD;
    }
    cout << ans;
  }

  int main(){
    IOS
    	solve();
    //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
  }

// integer overflow

Measured memory_bytes: 6360
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	ll x;
	cin >> x;

	ll ans = (x/11)*2;
	if (x%11 > 0 && x%11 <= 6) ans++;
	else if (x%11 >= 7) ans += 2;
	
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int h = Integer.parseInt(sc.next());
        int w = Integer.parseInt(sc.next());
        char[][] a = new char[h][w];
        for (int i = 0; i < h; i++) {
            a[i] = sc.next().toCharArray();
        }
        sc.close();

        // 主処理
        String head = "";
        for (int i = 0; i < w + 2; i++) {
            head += "#";
        }

        StringBuilder sb = new StringBuilder();
        sb.append(head + "\n");
        for (int i = 0; i < h; i++) {
            String line = "#";
            for (int j = 0; j < w; j++) {
                line += a[i][j];
            }
            line += "#";
            sb.append(line + "\n");
        }
        sb.append(head);

        String result = sb.toString();

        // 出力
        System.out.println(result);
    }
}


Measured memory_bytes: 28244
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = INT32_MAX;
const ll INFL = INT64_MAX;
const int mod = 1e9 + 7;

template <typename T>
void print_vec(vector<T> v) {
  for (T i : v) cout << i << " ";
  cout << endl;
}

int main() {
  int r, d, x;
  cin >> r >> d >> x;
  rep(i, 10) {
    x = r * x - d;
    cout << x << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define MP make_pair
#define PB push_back
#define ll long long
#define sz size()
#define clr clear()
#define len length()
#define gcd(a,b)  __gcd(a,b)
#define newLine "\n"
using namespace std;
const int maxN = 1e5 + 1;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin >> t;
    if(t % 2){
    	cout << t / 2 + 1;
    }
    else{
    	cout << t / 2;
    }

    return 0;
}

Measured memory_bytes: 256
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n; readV(n);
  string s; readV(s);

  auto x = 0, m = 0;
  foreach (si; s) {
    x += si == 'I' ? +1 : -1;
    m = max(m, x);
  }

  writeln(m);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a[5];
	for (int i = 0; i < 5; i++){
	 cin >> a[i];
	if (a[i] == 0){
	printf("%d",i+1);
	return 0;
	}
	}
	
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    vi sum(n + 3);
    rep(loop, n){
        int a, b; cin >> a >> b;
        chmin(a, n + 2);
        chmin(b, n + 1);
        sum[a]++, sum[b + 1]--;
    }

    int res = 0;
    rep(i, 1, n + 2){
        sum[i] += sum[i - 1];

        if(sum[i] + 1 >= i){
            chmax(res, i - 1);
        }
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 3408
from operator import itemgetter

N = int(input())
city_point_list = []
for i in range(N):
    c, p = input().split()
    pair = (c, int(p))
    city_point_list.append(pair)

cp_num_dict = {}
for i in range(len(city_point_list)):
    cp_num_dict[city_point_list[i]] = i + 1

point_sort_rev = sorted(city_point_list, key=itemgetter(1), reverse=True)
city_sort = sorted(point_sort_rev, key=itemgetter(0))

for cp in city_sort:
    print (cp_num_dict[cp])


Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;

bool check(int a, int b, int c){
		return max(a, max(b, c)) < (a + b + c) - max(a, max(b, c));
}

int main(int argc, char const* argv[])
{
	int a, b, c;
	int tyo = 0, don = 0, ei = 0;
	while(true){
			cin >> a >> b >> c;
			if(check(a, b, c)){
					int emax = max(a, max(b, c));
					int emin = min(a, min(b, c));
					int emid = a + b + c - emax - emin;
					if(emax * emax == emin * emin + emid * emid)tyo++;
					else if(emax * emax > emin * emin + emid * emid)don++;
					else if(emax * emax < emin * emin + emid * emid)ei++;
			}else{
					cout << tyo + don + ei << " " << tyo << " " << ei << " " << don << endl;
					return 0;
			}
	}
	return 0;
}



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

int main()
{
    ll n, k, ans = 0;
    cin >> n >> k;
    rep(i, n)
    {
        ll h;
        cin >> h;
        if (h >= k)
            ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3592
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;

    void calc()
    {
        cin = new Scanner();
        string S = cin.next();
        int[] cnt = new int[26];
        for (int i = 0; i < S.Length; i++)
        {
            cnt[S[i] - 'a']++;
        }

        long ans = ((long)S.Length) * (S.Length - 1) / 2 + 1;

        for (int i = 0; i < cnt.Length; i++)
        {
            long A = cnt[i];
            ans -= A * (A - 1) / 2;
        }
        Console.WriteLine(ans);
    }
    
}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

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

  int a,b;
  while(cin >> a >> b){
    if(abs(a-b)%2==1){
      cout << "IMPOSSIBLE" << endl;
    }else{
      cout << min(a,b) + abs(a-b)/2 << endl;
    }
  }
  
  return 0;
}


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

int main()
{
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    if(s[0]==s[1]&&s[2]==s[3]&&s[0]!=s[2])
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
n,k=map(int,input().split())
li=[[0,0] for i in range(n)]
for i in range(n):
    li[i][0],li[i][1]=map(int,input().split())



def find_num_neta(choice,li):
    k=[]
    for i in choice:
        k.append(li[i][0])
    return len(set(k))
#-----------------------------------------

li.sort(reverse=True,key=lambda x:x[1])
s2=min(find_num_neta(list(range(n)),li),k)
s1=find_num_neta(list(range(k)),li)
oishisa=sum([li[i][1] for i in range(k)])
score=oishisa+s1**2

#-----------------------------------------
li.sort(key=lambda x:x[0])
best_list=[]
not_best_list=[]


m=-1
for i in li:
    if m==i[0]:
        not_best_list.append(i)
    else:
        best_list.append(i)
        m=i[0]
        
not_best_list.sort(reverse=True,key=lambda x:x[1])
best_list.sort(reverse=True,key=lambda x:x[1])



 
 
for i in range(s1+1,s2+1):
    oishisa=oishisa+best_list[i-1][1]-not_best_list[k-i][1]
    
    new_score=i**2+oishisa
    
    if score<new_score:
        score=new_score
        
    
print(score)

Measured memory_bytes: 31116
N, W = map(int, input().split())

dp = [[0 for i in range(W + 1)] for j in range(N + 1)]

for i in range(1, N + 1):
    w, v = map(int, input().split())
    for j in range(1, W + 1):
        if j - w >= 0:
            dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w] + v)
        else:
            dp[i][j] = dp[i - 1][j]

print(dp[N][W])

Measured memory_bytes: 218684
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
    	InputStream inputStream = System.in;
    	OutputStream outputStream = System.out;
    	Scanner sc = new Scanner(inputStream);
    	PrintWriter out = new PrintWriter(outputStream);
      	int N = Integer.parseInt(sc.next());
      	String S = sc.next();
      	int Wn[] = new int[N + 1];
      	int En[] = new int[N + 2];
      	Wn[0] = 0;
      	for(int i = 1; i <= N; i++){
        	if(S.charAt(i - 1) == 'W'){
              	Wn[i]++;
            }
            Wn[i] += Wn[i - 1];
        }
      	En[N + 1] = 0;
      	for(int i = N; 1 <= i; i--){
      		if(S.charAt(i - 1) == 'E'){
            	En[i]++;
            }
          En[i] += En[i + 1];
      	}
      	int min = Integer.MAX_VALUE;
      	for(int i = 1; i <= N; i++){
        	min = (int)Math.min(min, Wn[i - 1]+En[i + 1]);
        }
      	out.println(min);
    	out.close();
    }
}

Measured memory_bytes: 31172
#include <iostream>
#include <queue>
#include <vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<pair<int, int>> v;
	for (int i = 0; i < n; i++) {
		int m;
		cin >> m;
		v.emplace_back(m, i+1);
	}
	sort(v.begin(), v.end());
	for (auto e : v) {
		cout << e.second << " ";
	}
	cout << endl;
	return 0;
}


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

class FC{
public:
		int p[31];
		int n;

		bool is_over()
		{
			return p[1]==p[2] && p[2]==p[3] && p[4]==p[5] && p[5]==p[6] && p[6]==p[7] && p[7]==p[8]
				&&  p[8]==p[9] && p[10]==p[11] && p[11]==p[12] && p[13]==p[14] && p[14]==p[15] && p[16]==p[17]
				&&  p[17]==p[18] && p[19]==p[20] && p[20]==p[21] && p[22] == p[23]
				&&  p[23]==p[24] && p[24]==p[25] && p[25]==p[26] && p[26] == p[27] && p[27]==p[28] && p[28]==p[29]
				&&  p[29]==p[30];
		}
		void rot1()
		{
			swap(p[7],p[22]); swap(p[8],p[23]); swap(p[9],p[24]); swap(p[13],p[18]); swap(p[10],p[12]);
		}
		
		void rot2()
		{
			swap(p[1],p[28]); swap(p[2],p[29]); swap(p[3],p[30]); swap(p[15],p[16]); swap(p[19],p[21]);
		}
		void rot3()
		{
			swap(p[1],p[24]); swap(p[4],p[27]); swap(p[7],p[30]); swap(p[10],p[21]); swap(p[16],p[18]);
		}
		void rot4()
		{
			swap(p[3],p[22]); swap(p[6],p[25]); swap(p[9],p[28]); swap(p[12],p[19]); swap(p[13],p[15]);
		}
};

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

	for(int i=0; i<N; i++){
		FC now;
		for(int j=1; j<=30; j++){
		cin >> now.p[j];
	}
	now.n = 0;

	queue<FC> que;
	que.push(now);

	while(!que.empty()){
		now = que.front();
		que.pop();

		if(now.is_over()){
			cout << now.n << endl;
			break;
		}

		FC nex1 = now; nex1.rot1(); nex1.n++; que.push(nex1);
		FC nex2 = now; nex2.rot2(); nex2.n++; que.push(nex2);
		FC nex3 = now; nex3.rot3(); nex3.n++; que.push(nex3);
		FC nex4 = now; nex4.rot4(); nex4.n++; que.push(nex4);
	}
}

return 0;
}

Measured memory_bytes: 12172
import Control.Arrow
import Control.Monad
import Data.Bits
import Data.Char
import Data.List

main :: IO ()
main = do
  n <- getInt
  xs <- getInts
  print $ sum xs - n

getInt :: IO Int
getInt = readLn

getInts :: IO [Int]
getInts = map read . words <$> getLine


Measured memory_bytes: 2044
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn], b[maxn];
int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; i ++) cin >> a[i];
    for(int i = 1; i <= n; i ++) cin >> b[n-i+1];
    int ok = 0;
    for(int i = 1; i <= n; i ++){
        if(a[i] != b[i]) continue;
        int f = 0;
        for(int j = 1; j <= n; j ++){
            if(a[i] != b[j] && a[j] != b[i]){
                f = 1;
                swap(b[i], b[j]);
                break;
            }
        }
        if(!f){
            ok=1;
            goto outer;
        }
    }
	outer:;
    if(ok==1){
        cout << "No" << endl;
    }else{
		cout << "Yes" << endl;
		for(int i = 1; i <= n; i ++){
			if(i != 1)cout << " ";
			cout << b[i];
		}
    	cout << endl;
	}
    return 0;
}


Measured memory_bytes: 5140
//
//  main.cpp
//  AtCoderD
//
//  Created by Shivam on 19/09/20.
//  Copyright © 2020 Shivam. All rights reserved.
//

#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<climits>
#include<cmath>
#include<cstring>
#include<unordered_set>
#include<unordered_map>
#include<set>
#include<stack>
#include<queue>
#include<map>
#include<list>
using namespace std;
#define x first
#define y second
#define mp make_pair
#define endl "\n"
typedef long long ll;
int mod=998244353;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    cin>>n>>k;
    vector<pair<int,int>> intervals(k);
    for(int i=0;i<k;++i)
        cin>>intervals[i].x>>intervals[i].y;
    sort(intervals.begin(),intervals.end());
    vector<ll> dp(n+1,0),suffix(n+1,0);
    dp[n-1]=1;
    suffix[n-1]=1;
    for(int i=n-2;i>=0;--i) {
        for(auto range:intervals) {
            if(i+range.x>n-1)
                break;
            int m=min(range.y,n-1-i);
            dp[i]+=suffix[i+range.x]-suffix[i+m+1]+mod;
            if(dp[i]>=mod)
                dp[i]%=mod;
        }
        suffix[i]=dp[i]+suffix[i+1];
        if(suffix[i]>=mod)
            suffix[i]%=mod;
        //cout<<i<<" "<<dp[i]<<" "<<suffix[i]<<endl;
    }
    cout<<dp[0]<<endl;
    return 0;
}


Measured memory_bytes: 6372
#include <iostream>

using namespace std;

int main()
{
    int x,r,d,s;
    cin>>r>>d>>x;
    for(int i=0;i<10;i++){
        s=x;
        cout<<(r*s)-d<<endl;
        x=(r*s)-d;
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A=0;
		int B=0;

		int n = sc.nextInt();
		List<Integer> list=new ArrayList<Integer>();
		for(int i=0;n>i;i++) {
			int b=sc.nextInt();
			list.add(b);
		}
		//System.out.println(list.size());
        for(int i=0;list.size()>i;i++) {
        	A=list.get(i);
        	//System.out.println(A);
        	for(int j=i;list.size()>j;j++) {
        		if(A==list.get(j)&&i!=j) {
        			break;
        		}
        		else if((j+1)==list.size()) {
        			B++;
        		}
        		//System.out.println(j);
        	}
        }
        System.out.println(B);
	}

}


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

int main() {
  vector<int> vec;
  vec={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;
   K-=1;
  cout<<vec.at(K)<<endl;
}
  

Measured memory_bytes: 256
package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
)

//=====I/O=====

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

func scanInt() int {
	sc.Scan()
	a,_ := strconv.Atoi(sc.Text())
	return a
}

func scanInt64() int64 {
	sc.Scan()
	a,_ := strconv.ParseInt(sc.Text(),10,64)
	return a
}

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ { res[i] = scanInt() }
	return res
}

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

func printInts(a ...int) {
	for i, e := range a {
		fmt.Fprint(wr, e)
		if i != len(a)-1 { fmt.Fprint(wr, " ") }
	}
	fmt.Fprintln(wr)
	wr.Flush()
}

//=====main=====

func main() {
	sc.Split(bufio.ScanWords)

	n := scanInt()
	_ = scanInt()
	w := scanInt()

	as := scanInts(n)

	if n == 1 {
		fmt.Println(abs(w-as[n-1]))
		return
	}
	fmt.Println(max(abs(w-as[n-1]),abs(as[n-2]-as[n-1])))
}

func abs(a int) int {
	if a<0 {
		return -a
	}
	return a
}

func min(a ...int) int {
	res := a[0]
	for i := 1; i < len(a); i++ {
		if res > a[i] { res = a[i] }
	}
	return res
}

func max(a ...int) int {
	res := a[0]
	for i := 1; i < len(a); i++ {
		if res < a[i] { res = a[i] }
	}
	return res
}



Measured memory_bytes: 640
//============================================================================
// 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

//============================================================================
#define PI 3.14159265359
#define succ(x) ((x)+1)
#define pred(x) ((x)-1)
//============================================================================
void enter()
{
    int x,y,i,j;

    while(1){
        scanf("%d", &y);
        scanf("%d", &x);
        if (!x && !y)
            return;
        for (i=0; i<y; i++){
            for (j=0; j<x; j++)
                printf("%c", (i==0)?'#':(i==pred(y))?'#':(!j)?'#':(j==pred(x))?'#':'.');
            printf("\n");
        }
        printf("\n");
    }
}
//============================================================================
int main(void)
{
    enter();
    return 0;
}
//============================================================================

Measured memory_bytes: 572
#include <stdio.h>
#include <stdbool.h>
long long MOD=1e9+7;
int popcount(int x){
    int num  = 0;
    for (int mask=1; mask <(1<<30) ; mask = mask << 1 ){
        if (x & mask )
            num++;
    }

    return num;
}
int main(void){
    // Your code here!
    int N;
    char X[200001];
    scanf("%d %s",&N,X);
    int Xbit_num=0;
    for(int i=0;i<N;i++){
        if(X[i]=='1'){
            Xbit_num++;
        }
    }
    bool bit_one=false;
    long long minusnum=Xbit_num-1;
    long long plusnum=Xbit_num+1;
    if(Xbit_num==0){
        for(int i=0;i<N;i++){
            printf("%d\n",1);
        }
        return 0;
    }
    if(Xbit_num==1){
        bit_one=true;
        minusnum=2;
    }
    long long minussum=0;
    long long plussum=0;
    //printf("%d %d \n",minusnum,plusnum);
    //printf("%d %d \n",minussum,plussum);
    long long pow_index_minus[N+1];
    long long pow_index_plus[N+1];
    for(int i=0;i<N;i++){
        if(i==0){
            pow_index_minus[0]=1;
            pow_index_plus[0]=1;
            continue;
        }
        pow_index_minus[i]=pow_index_minus[i-1]*2%minusnum;
        pow_index_plus[i]=pow_index_plus[i-1]*2%plusnum;
        //printf("%d\n",pow_index_plus[i]);
    }
    for(int i=N-1;i>=0;i--){
        int index=N-i-1;
        //printf("%d\n",index);
        minussum+=pow_index_minus[i]*(X[index]-'0');
        plussum+=pow_index_plus[i]*(X[index]-'0');
        minussum%=minusnum;
        plussum%=plusnum;
       // printf("plussum %d %d %d\n", plussum,plusnum);
    }
    for(int i=0;i<N;i++){
        if(X[i]=='1'&&bit_one){
            printf("%d\n",0);
            continue;
        }
        int finalsum=0;
        if(X[i]=='1'){
            finalsum=(minussum+minusnum*300000-pow_index_minus[N-i-1])%minusnum;
        }else{
            finalsum=(plussum+pow_index_plus[N-i-1])%plusnum;
        }
        //printf("%d\n",pow_index_minus[N-i-1]);
        //printf("sum1 %d\n",finalsum);
        int res=1;
        while(finalsum!=0){
            finalsum=finalsum%popcount(finalsum);
            res++;
        }
        printf("%d\n",res);
    }
}


Measured memory_bytes: 5048
#include <stdio.h>
int main(){
  int A;
  scanf("%d", &A);
  int D = A % 10;
  int C = A % 100 / 10;
  int B = A % 1000 / 100;
  A /= 1000;
  if(A + B + C + D == 7) printf("%d+%d+%d+%d=7\n", A, B, C, D);
  else if(A + B + C - D == 7) printf("%d+%d+%d-%d=7\n", A, B, C, D);
  else if(A + B - C + D == 7) printf("%d+%d-%d+%d=7\n", A, B, C, D);
  else if(A - B + C + D == 7) printf("%d-%d+%d+%d=7\n", A, B, C, D);
  else if(A + B - C - D == 7) printf("%d+%d-%d-%d=7\n", A, B, C, D);
  else if(A - B + C - D == 7) printf("%d-%d+%d-%d=7\n", A, B, C, D);
  else if(A - B - C + D == 7) printf("%d-%d-%d+%d=7\n", A, B, C, D);
  else if(A - B - C - D == 7) printf("%d-%d-%d-%d=7\n", A, B, C, D);
}

Measured memory_bytes: 128
import sys

L = []
for l in sys.stdin:
  L.append(l) 
A = list(map(int, L[1].split()))

if 0 in A:
  print(0)
else:
  answer = 1
  for a in A:
    answer = answer * a
    if answer > 1000000000000000000:
      print(-1)
      break
  if answer <= 1000000000000000000:
    print(answer)

 

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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;


const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = INT_MAX / 2;

int H, W;
VS cs;

VS solve() {
	VS res;
	for (string s : cs) {
		res.pb(s);
		res.pb(s);
	}
	return res;
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	cin >> H >> W;
	rep (i, H) {
		string s;
		cin >> s;
		cs.pb(s);
	}
	VS ans = solve();
	for (string s : ans) {
		cout << s << endl;
	}
	return 0;
}



Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<cmath>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int i;
	bool k=0;
	int len=s.size();
	for(i=97;i<=122;i++)
	{
		k=0;
		for(int j=0;j<len;j++)
		{
			if(s[j]==char(i))
			{
				k=1;
			}
		}
		if(k==0)
		{
			break;
		}
	}
	if(k==0)
	{
		cout<<char(i)<<endl;
	}
	else
	{
		cout<<"None"<<endl;
	}
	return 0;
}

Measured memory_bytes: 512
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
char A[105];
char B[105];
int main(){
	scanf("%s %s",A,B);
    int len1 = strlen(A);
    int len2 = strlen(B);
	if(len1 > len2) printf("GREATER");
	if(len1 < len2) printf("LESS");
	if(len1 == len2) {
		if(strcmp(A,B) > 0) printf("GREATER");
		else if(strcmp(A,B) < 0)  printf("LESS");
		else printf("EQUAL");
	}
	return 0;
}

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



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

	int N; cin >> N;
	VI A(N);
	REP(i, N)cin >> A[i];

	vector<VI> dp(N + 1, VI(3, 0));

	eFOR(i, 1, N) {

		if (i % 2) {
			if (i != 1)dp[i][2] = max(dp[i - 1][1], dp[i - 2][2]) + A[i - 1];
			else dp[i][2] = max(dp[i - 1][1], 0LL) + A[i - 1];

			if (i != 1)dp[i][1] = max(dp[i - 1][0] + A[i - 1], dp[i - 2][0] + A[i - 1]);
			else dp[i][1] = max(dp[i - 1][0] + A[i - 1], A[i - 1]);

			dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]);
		}
		else {
			if (i != 1)dp[i][2] = max(dp[i - 1][0], dp[i - 2][1]) + A[i - 1];
			else dp[i][2] = max(dp[i - 1][0], A[i - 1]);

			dp[i][1] = dp[i - 1][2];
			dp[i][0] = max(dp[i - 1][0], dp[i - 1][1]);
		}

	}




	if (N % 2)cout << max(dp[N][0],dp[N][1]) << endl;
	else cout << max(dp[N][2], dp[N][1]) << endl;



	return 0;
}



Measured memory_bytes: 15932
// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
 
#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl
 
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,x,y;
	cin>>n>>x>>y;
	ll A[n] = {0};
	rep(i,1,n+1)	rep(j,i+1,n+1){
		ll k = min(j-i, min(abs(x-i)+abs(y-j), abs(x-j)+abs(y-i))+1);
		A[k]++;
	}
	rep(i,1,n)	cout<<A[i]<<endl;
    return 0;
}

Measured memory_bytes: 256
n,c = map(int,input().split())
stc = [[int(i) for i in input().split()] for j in range(n)]

ans = 0

stc.sort(key=lambda x:(x[2],x[1],x[0]))

time = 10**5+3

c_imos = [[0 for i in range(time)] for j in range(c)]

for i in range(n):
    c_imos[stc[i][2]-1][stc[i][0]-1] += 1
    c_imos[stc[i][2]-1][stc[i][1]] -= 1

nd_v = [[0 for i in range(time)] for j in range(c)]

for i in range(c):
    for j in range(time):
        if j == 0:
            if c_imos[i][j] == 1:
                nd_v[i][j] = 1
        else:
            nd_v[i][j] = nd_v[i][j-1] + c_imos[i][j]

for i in range(c):
    for j in range(time):
        if nd_v[i][j] >= 2:
            nd_v[i][j] = 1
ans = 1

for i in range(time-1):
    tmp = 0
    for j in range(c):
        tmp += nd_v[j][i]
    ans = max(tmp,ans)

print(ans)

exit()
    
c_num = stc[0][2]
t_num = stc[0][1]
idx = 0
print(stc)
for i in range(1,n):
    print(t_num,i)
    if stc[idx+i][2] == c_num:
        if stc[idx+i][0] == t_num:
            stc[idx+i-1][1] = stc[idx+i][1]
            t_num = stc[idx+i][1]
            del stc[idx+i]
            idx -= 1
        else:
            print(t_num,t_num,t_num)
            c_num = stc[idx+i][2]
            t_num = stc[idx+i][1]

stc.sort(key=lambda x:x[1])
print(stc)
exit()
tmp = stc[0][1]

ans = 1
ans_tmp = 1

for i in range(1,len(stc)):
    for j in range(i+1,len(stc)):
        if tmp >= stc[j][0]:
            ans_tmp += 1
        else:
            tmp = stc[j][0]
            ans = max(ans_tmp,ans)

Measured memory_bytes: 142212
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>

#define MAX_INT 2147483647
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::string;
using std::pair;
using std::cin;
using std::cout;

// @author: pashka

int main() {
    std::ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }
    int res = 0;
    for (int i = 0; i < n; i++) {
        if (a[i] == i) {
            res++;
            if (i < n - 1) {
                std::swap(a[i], a[i + 1]);
            }
        }
    }

    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 640
lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
ingredients = lines[1].sort

pre_ans = ingredients[0].to_f
for i in 2..N do
  pre_ans += ingredients[i-1].to_f * (2 ** (i-2))
end

print pre_ans / (2 ** (N-1))

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

using namespace std;

int main() {
	string str;
	while (getline(cin, str)) {
		int cnt = 0;
		for (int i = 0; i < 26; ++i) {
			for (int j = 0; j < (int)str.size(); ++j) {
				if (str[j] >= 'a' && str[j] <= 'z') {
					str[j] = (str[j] - 'a' + 1) % 26 + 'a';
				}
			}
			cnt++;
			if (str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break;
		}
		for (int i = 0; i < 26; ++i) {
			for (int j = 0; j < (int)str.size(); ++j) {
				if (str[j] >= 'a' && str[j] <= 'z') {
					str[j] = (str[j] - 'a' + cnt) % 26 + 'a';
				}
			}
		}
		cout << str << endl;
	}
}

Measured memory_bytes: 1180
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	unordered_set<string> s;
	string i;
	for(int j=0;j<n;j++)
	{
		cin>>i;
		s.insert(i);
	}
	cout<<s.size();
	
}

Measured memory_bytes: 17532
local n=io.read("n","l")
local s=io.read()
local t=s:gsub("%b()","")
local l,r=0,0
for i=1,#t do
    if t:sub(i,i)==")" then
        l=l+1
    else
        r=r+1
    end
end
print(string.rep("(",l)..s..string.rep(")",r))


Measured memory_bytes: 2776
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;

bool wa[31],su[3000+1];

int A,B,C,D,E,F;

int main(){
	cin>>A>>B>>C>>D>>E>>F;
	int answ=A,anss=0;
	wa[0]=true;
	su[0]=true;
	REP(i,30){
		if (wa[i] && i+A<=30){
			wa[i+A]|=wa[i];
		}
	}
	REP(i,30){
		if (wa[i] && i+B<=30){
			wa[i+B]|=wa[i];
		}
	}
	REP(i,3000){
		if (su[i] && i+C<=3000){
			su[i+C]|=su[i];
		}
	}
	REP(i,3000){
		if (su[i] && i+D<=3000){
			su[i+D]|=su[i];
		}
	}
	FOR(i,1,31){
		FOR(j,1,3000+1){
			if (j*(100*answ+anss)>anss*(100*i+j) && wa[i] && su[j] && 100*i+j<=F && j<=i*E){
				answ=i;
				anss=j;
			}
		}
	}
	cout<<100*answ+anss<<" "<<anss<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main () {
	string S, T;
	cin>>S>>T;
	int len1 = S.length();
	int len2 = T.length();
	int num = INT_MAX;
	for (int i=0; i<=len1-len2; i=i+1) {
		int diff = 0;
		for (int j=0, k=i; j<len2 && k<i+len2; j=j+1, k=k+1) {
			if (T[j] != S[k]) {
				diff += 1;
			}
		}
		num = min(num, diff);
	}
	cout<<num;
	return 0;
}

Measured memory_bytes: 3604