akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define For(i, a, b) for (int i = int(a); i < int(b); i++)
#define Dor(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define Foz(i, a) For(i, 0, a)
#define Doz(i, a) Dor(i, 0, a)
#define Trav(e, v) for (auto& e : v)
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#ifdef XVENOM
	#define errp(...) fprintf(stderr, __VA_ARGS__)
	#define dbg(...) errp("[%s]: ", #__VA_ARGS__), dbg_str(__VA_ARGS__)
#else
	#define errp(...)
	#define dbg(...)
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
	string s = "[ ";
	for (auto& x : e) s += to_string(x) + " ";
	return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
	return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str () { errp(" \n"); }
template <typename U, typename... V> void dbg_str (U u, V... v) {
 	errp(" %s", to_string(u).c_str()); dbg_str(v...);
}
/* --- */
const int N = 55;
string grid[N];
int n, m;
int dr[] = {0, 0, -1, 1};
int dc[] = {1, -1, 0, 0};

bool isIsolated (int r, int c) {
	Foz(i, 4) {
		int r1 = r + dr[i], c1 = c + dc[i];
		if (r1 < 0 || r1 >= n || c1 < 0 || c1 >= m) continue;
		if (grid[r1][c1] == '#') return false;
	}
	return true;
}

bool can() {
	Foz(i, n) Foz(j, m) if (grid[i][j] == '#' && isIsolated(i, j)) return false;
	return true;
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	/* --- */
	cin >> n >> m;
	Foz(i, n) cin >> grid[i];
	if (can()) cout << "Yes\n";
	else cout << "No\n";
}



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

int main() {
  int n,m,x;cin>>n>>m>>x;
  int a,s=0,l=0;
  for(int i=0;i<m;i++){
  	cin>>a;
    if(a<x){
    	s++;
    }else if(x<a){
    	l++;
    }
  }
   cout<<min(s,l)<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
priority_queue<int>Q;
int A[200001];
int main(){
	int a,i,m,s=0;
	cin>>a;
	for(i=1;i<=a;i++)cin>>A[i],Q.push(A[i]);
	m=Q.top(),Q.pop(),s=Q.top();
	for(i=1;i<=a;i++)if(A[i]==m)cout<<s<<endl;
		else cout<<m<<endl;
}

Measured memory_bytes: 3316
//Patwari26
//#include template<t> as mine
#include<bits/stdc++.h>
using namespace std;

#define ll          long long
#define pb          push_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    ll d,t,s;
    cin>>d>>t>>s;
    if(s*t>=d) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    // time
    return 0;
}

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

int main(){
  long long N, K;
  cin >> N >> K;
  vector<long long> H(N);
  for (long long i = 0; i < N; i++){
    cin >> H[i];
  }
  
  sort(H.begin(), H.end());
  for (int i = 0; i < K; i++){
    H.pop_back();
  }
  
  long long ans = 0;
  for (long long i = 0; i < N - K; i++){
    ans += H[i];
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 4808
import java.util.Scanner

object Main extends App{
  val sc = new Scanner(System.in)
  val n = sc.nextInt()
  val l = new Array[Int](2*n)
  for(i <- 0 until 2*n)
    l(i) = sc.nextInt()

  val l2 = l.sorted
  var ans = 0
  for(i <- 0 until n)
    ans += l2(2*i)
  println(ans)
}


Measured memory_bytes: 22596
n, h = input().split()
n = int(n)
h = int(h)

a = []
b = []
for i in range(n):
    a_, b_ = input().split()
    a.append(int(a_))
    b.append(int(b_))

import numpy as np
a = np.array(a)
b = np.array(b)

to_throw = b[b>max(a)]
sum_throw = sum(to_throw)

d = h - sum_throw

if d <= 0:
    cum = np.cumsum(np.sort(to_throw)[::-1])
    print(len(to_throw) - len(cum[cum>=h]) + 1)
else:
    import math
    print(len(to_throw) + math.ceil(d/max(a)))


Measured memory_bytes: 20948
#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[]) {

    int n,i = 0;
    double x1,y1,x2,y2,x3,y3;
    double px,py,r;
    scanf("%d",&n);
    while(i++ < n){
        scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
        px = ((y1 - y3) * (pow(y1,2) - pow(y2,2) + pow(x1,2) - pow(x2,2)) - (y1 - y2) * (pow(y1,2) - pow(y3,2) + pow(x1,2) - pow(x3,2))) /
             (2 * (y1 - y3) * (x1 -x2) - 2* (y1 - y2) * (x1 -x3));
        
        py = ((x1 - x3) * (pow(x1,2) - pow(x2,2) + pow(y1,2) - pow(y2,2)) - (x1 - x2) * (pow(x1,2) - pow(x3,2) + pow(y1,2) - pow(y3,2))) /
             (2 * (x1 - x3) * (y1 - y2) - 2 * (x1 - x2) * (y1 -y3));
        
        r = sqrt(pow(px,2) - 2 * px * x1 + pow(x1,2) + pow(py,2) - 2 * py * y1 + pow(y1,2));
        
        printf("%.3f %.3f %.3f\n",px,py,r);
    }
    return 0;
}

Measured memory_bytes: 664
#include<stdio.h>
int main(void)
{
	int a,b,c,k,i;
	scanf("%d%d%d%d",&a,&b,&c,&k);
	for(i=0;i<k;i++){
		if(a>=b){
			b*=2;
		}
		else{
			c*=2;
		}
	}
	if(a<b&&b<c){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 1644
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1LL << 60;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using pLL = std::pair<long long, long long>;
using ll = long long;
#define SORT(v) std::sort(v.begin(), v.end())
#define rSORT(v) std::sort(v.begin(), v.end(),std::greater<int>())

int L[100010] = { 0 };
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n,m;
    cin >> n >> m;
    vector<ll> a(n);
    vector<pLL>b(m);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    SORT(a);
    vector<ll> s(n + 1, 0);
    
    for (int i = 0; i < m; ++i) {
        cin >> b[i].second >> b[i].first;
    }
    SORT(b);
    
    int j = 0;
    auto itr = upper_bound(a.begin(), a.end(), b[m-1].first);
    int index = itr - a.begin();
    index--;
    for (int i = m-1; i >= 0; --i) {
        int count = 0;
        while (count<b[i].second&&j<=index) {
            if (a[j] < b[i].first) {
                a[j] = b[i].first;
                count++;
            }
            j++;
        }
    }
    for (int i = 0; i < n; ++i) {
        s[i + 1] = s[i] + a[i];
    }
    cout << s[n] << endl;
    return 0;
}


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

int getRandomNum(int a, int b, int c, int x){
  return (a * x +b) % c;
}

int getShortestFlame(int n, int a, int b, int c, int x, int array[]){
  int cnt=0,xd=x;
  for(int i=0;i<=10000;i++){
    if(array[cnt] == xd) cnt++;
    xd = getRandomNum(a,b,c,xd);
    if(cnt == n) return i;
  }
  return -1;
}

int main(){
  int n,a,b,c,x;
  int array[100];
  while(1){
    cin >> n >> a >> b >> c >>x;
    
    if(n+a+b+c+x==0) break;
    for(int i=0;i<n;i++){
      cin >> array[i];
    }
    cout << getShortestFlame(n,a,b,c,x,array) << endl;
  }
}

Measured memory_bytes: 1160
while 1 do
    a,op,b = gets.chomp.split
    a = a.to_i
    b = b.to_i
case op
when '+' then
    puts a+b
when '-' then
    puts a-b
when '*' then
    puts a*b
when '/'
    puts a/b
when '?'
    break;
end
end

Measured memory_bytes: 6100
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

inline int getint_mae() {
	char C = getchar_unlocked();
	int A = C - '0';
	while (isdigit(C = getchar())) A = A * 10 + C - '0';
	return A;
}

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

const int dm = 1 << 21;
char dn[dm], *di = dn, dt;
inline void putint(int X) {
	if (X == 0) {
		*di++ = '0';
		*di++ = '\n';
		return;
	}
	int keta = 0;
	char C[10];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--) *di++ = (*(C + i));
	*di++ = '\n';
}

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


	int N = getint_mae(), M = getint_mae(), Q = getint_mae();
	char S[2000][2001];
	rep(i, N) fread_unlocked(S[i], 1, M + 1, stdin);
	int B[2001][2001], C[2001][2001], D[2001][2001];
	rep(i, M + 1) {
		B[0][i] = 0;
		C[0][i] = 0;
		D[0][i] = 0;
	}
	rep(i, N + 1) {
		B[i][0] = 0;
		C[i][0] = 0;
		D[i][0] = 0;
	}
	rep(i, N) {
		rep(j, M) {
			B[i + 1][j + 1] = B[i + 1][j] + S[i][j] - '0';
			if (i != 0) C[i + 1][j + 1] = C[i + 1][j] + ((S[i - 1][j] - '0') & (S[i][j] - '0'));
			if (j != 0) D[i + 1][j + 1] = D[i + 1][j] + ((S[i][j - 1] - '0') & (S[i][j] - '0'));
		}
	}
	rep(j, M) rep(i, N) {
		B[i + 1][j + 1] += B[i][j + 1];
		C[i + 1][j + 1] += C[i][j + 1];
		D[i + 1][j + 1] += D[i][j + 1];
	}

	rep(q, Q) {
		int a = getint(), b = getint(), c = getint(), d = getint();

		int kotae = B[c][d] - B[c][b - 1] - B[a - 1][d] + B[a - 1][b - 1] - C[c][d] + C[c][b - 1] + C[a][d] - C[a][b - 1] - D[c][d] + D[c][b] + D[a - 1][d] - D[a - 1][b];
		putint(kotae);

	}

	fwrite_unlocked(dn, di - dn, 1, stdout);

	Would you please return 0;
}

Measured memory_bytes: 54400
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define FILL(a, b) memset(a, b, sizeof(a))

void dout() { cerr << endl; }

template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

LL INF = 1e16;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    LL minX = INF, minY = INF; 
    LL maxX = -INF, maxY = -INF; 
    FOR(i, 0, n)
    {
        LL x, y;
        cin >> x >> y;
        LL xx = x + y;
        LL yy = x - y;
        minX = min(minX, xx);
        minY = min(minY, yy);
        maxX = max(maxX, xx);
        maxY = max(maxY, yy);
    }
    cout << max(maxX - minX, maxY - minY);
    return 0;
}

Measured memory_bytes: 3640
n = int(input())
data = list(map(int,input().split()))
mini = 100000
maxi = -100000
for i in range(n):
    if mini > data[i]:
        mini = data[i]
    if maxi < data[i]:
        maxi = data[i]
mincost = 1000000000
ans = 0
for i in range(mini,maxi+1):
    cost = 0
    for j in range(n):
        cost += (data[j] - i)**2
    if mincost > cost:
        ans = i
        mincost = cost
print(mincost)

Measured memory_bytes: 3064
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String in = sc.next();
        int n=in.length();
        char[] inArray = in.toCharArray();
        int pt=-1;
        char[] display = new char[n];

        for(int i=0;i<n;i++)display[i]='\0';

        for(int i=0;i<n;i++){
            if(inArray[i]=='B'){
                if(pt!=-1){
                    display[pt]='\0';
                    pt--;
                }
            }else{
                pt++;
                display[pt]=inArray[i];
            }
        }

        for(int i=0;i<n;i++){
            if(display[i]!='\0')System.out.print(display[i]);
        }




    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <set>
#include <cmath>
using namespace std;
#define lli long long int

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,d;
	cin>>n>>d;
	int coord[10][10];
	int i,j;
	for(i=0;i<n;i++)
	{
		for(j=0;j<d;j++)
			cin>>coord[i][j];
	}
	int ans = 0;
	int k;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			int val = 0;
			for(k=0;k<d;k++)
				val = val + (coord[i][k]-coord[j][k])*(coord[i][k]-coord[j][k]);
			int sqrt_val = (int)sqrt(val);
			if(sqrt_val*sqrt_val == val)
				ans++;
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ENDL '\n'
#define print(i) std::cout << (i) << '\n'

#define int long long // at least int64 > 9*10^18
#define all(v) (v).begin(), (v).end()
/* libraries */

constexpr int MOD = 1e9+7;
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v+MOD)%MOD){}
	mint operator-()const{ return mint(0) - *this; }
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this; }
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this; }
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this; }
	mint& operator/=(const mint& a){ (*this) *= a.inv(); return *this; }
	mint operator+(const mint& a)const{ return mint(*this) += a; }
	mint operator-(const mint& a)const{ return mint(*this) -= a; }
	mint operator*(const mint& a)const{ return mint(*this) *= a; }
	mint operator/(const mint& a)const{ return mint(*this) /= a; }
	bool operator<(const mint& a)const{ return v < a.v; }
	bool operator==(const mint& a)const{ return v == a.v; }
	mint pow(int k)const{ mint r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }
	mint inv()const{ return pow(MOD-2); }
	static mint comb(int n, int k) {
		if(n-k<k) k=n-k;
		mint num(1), dom(1);
		for(int i=0;i<k;i++) { num*=n-i; dom*=i+1; }
		return num/dom;
	}
};
std::istream& operator>>(std::istream&i,mint&a){ int t; i>>t; a=mint(t); return i; }
std::ostream& operator<<(std::ostream&o,const mint&a){ o<<a.v; return o; }


signed main() {
	// A-Robot Racing
	int n;
	std::cin >> n;
	std::vector<int> x(n);
	rep(i,n) std::cin >> x[i];

	mint ans = 1;
	int stack = 0;
	rep(i,n) {
		stack++;
		if(stack*2-1>x[i]) {
			ans*=stack;
			stack--;
		}
	}
	rep(i,stack) ans*=i+1;
	print(ans);

	return 0;
}


Measured memory_bytes: 1024
//Never stop trying
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

typedef string str;
typedef long long ll;
typedef double db;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<str> vs;
typedef vector<ld> vd;
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define endl "\n"

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

const int MOD = 1e9 + 7; //998244353
const ll INF = 1e18;
const int MX = 2e5 + 10;
const int nx[4] = {0, 0, 1, -1}, ny[4] = {1, -1, 0, 0}; //right left down up

template<class T> using V = vector<T>;
template<class T> bool ckmin(T& a, const T& b) { return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

ll cdiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); } // divide a by b rounded up
constexpr int log2(int x) { return 31 - __builtin_clz(x); } // floor(log2(x))

#define dbg(x) cerr << " - " << #x << " : " << x << endl;
#define dbgs(x,y) cerr << " - " << #x << " : " << x << " / " << #y << " : " << y << endl;
#define dbgv(v) cerr << " - " << #v << " : " << endl << "[ "; for(auto it : v) cerr << it << ' '; cerr << ']' << endl;

void IO() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


int main() {
	boost; IO();

	int N; cin>>N;
	vi a(N),b(N); 
	FOR(i,0,N) cin>>a[i];

	multiset <int> s;
	FOR(i,0,N) cin>>b[i],s.insert(b[i]);

	vi res(N,-1);
	FOR(i,0,N){
		int x=a[i];
		auto it=s.begin();
		if(*it!=x) res[i]=(*it);
		else{
			it=s.upper_bound(x);
			if(it!=s.end()) res[i]=(*it);
		}
		if(it!=s.end()) s.erase(it);
	}


	if(!s.empty()){

		//of only one integer is remaining 
		bool y=true; int p=-1;
		for(auto x: s){
			if(p!=-1 && x!=p) y=false;
			p=x;
		}
		assert(y==true);


		vi v;
		int x=(*s.begin());
		FOR(i,0,N) if(res[i]!=-1 && res[i]!=x && a[i]!=x){
			v.pb(res[i]),res[i]=x;
			s.erase(s.begin());
			if(s.empty()) break;
		}
		if(!s.empty()){
			cout << "No" << endl;
				return 0;
		}

		FOR(i,0,N) if(res[i]==-1){
			if(v.empty()){
				cout << "No" << endl;
				return 0;
			}
			if( a[i]!=v.back() ) { res[i]=v.back(); v.pop_back(); }
		}	
		if(!v.empty()){cout << "No" << endl; return 0;}
	}

	cout << "Yes" << endl;
	FOR(i,0,N) cout << res[i] << ' '; cout << endl;
	

	




	return 0;
}

/* Careful!!!
	.Array bounds
	.Infinite loops
	.Uninitialized variables / empty containers
	.Order of input

   Some insights:
	.Binary search
	.Graph representation
	.Write brute force code
	.Change your approach
*/


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

int main(){
  int N,K,count;
  cin>>N>>K;
  count=0;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(),vec.end());
  for(int i=0;i<N;i++){
    if(vec.at(i)-K>=0){
      break;
    }
    count++;
  }
  cout<<N-count<<endl;
}
  


Measured memory_bytes: 640
import math

a, b, x = map(int, input().split())
if 2 * x <= (a ** 2) * b:
    print(math.degrees(math.atan((a * (b ** 2)) / (2 * x))))
else:
    print(math.degrees(math.atan((2 / a) * (b - (x / a ** 2)))))


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

int main() {
    int sx, sy, tx, ty;
    string ans = "";
    cin >> sx >> sy >> tx >> ty;
    for(int i=0; i<ty-sy; i++) ans = ans + "U";
    for(int i=0; i<tx-sx; i++) ans = ans + "R";
    for(int i=0; i<ty-sy; i++) ans = ans + "D";
    for(int i=0; i<tx-sx; i++) ans = ans + "L";
    ans = ans + "L";
    for(int i=0; i<ty-sy+1; i++) ans = ans + "U";
    for(int i=0; i<tx-sx+1; i++) ans = ans + "R";
    ans = ans + "D";
    ans = ans + "R";
    for(int i=0; i<ty-sy+1; i++) ans = ans + "D";
    for(int i=0; i<tx-sx+1; i++) ans = ans + "L";
    ans = ans + "U";
    cout << ans << endl;
}

Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];puts("");}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};//RDLU
#define yes puts("YES")
#define no puts("NO")

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

	int n,m,q;
	cin>>n>>m>>q;
	set<int>a={-inf,inf},b=a;
	rep(i,n){
		int c;cin>>c;
		a.insert(c);
	}
	rep(i,m){
		int c;cin>>c;
		b.insert(c);
	}
	while(q--){
		int c;cin>>c;
		int l1,l2,r1,r2;
		auto it=a.lower_bound(c);
		r1=*it;it--;
		l1=*it;
		it=b.lower_bound(c);
		r2=*it;it--;
		l2=*it;
		int out=inf;
		cmin(out,abs(c-l1)+abs(l1-l2));
		cmin(out,abs(c-l1)+abs(l1-r2));
		cmin(out,abs(c-r1)+abs(r1-l2));
		cmin(out,abs(c-r1)+abs(r1-r2));
		cmin(out,abs(c-l2)+abs(l2-l1));
		cmin(out,abs(c-l2)+abs(l2-r1));
		cmin(out,abs(c-r2)+abs(r2-l1));
		cmin(out,abs(c-r2)+abs(r2-r1));
		cout<<out<<endl;
	}
}


Measured memory_bytes: 10752
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const ll MAX = 510000;
const ll MOD = 1000000007;

int main(){
  ll N; cin>>N;
  ll ans = 0;

  if(N%2 == 1){
    cout<<0<<endl;
    return 0;
  }
  else{
    N /= 2;
    while(N>=5){
      N/=5;
      ans += N;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<char> S(N);
  bool  flag=false;
  for(int i=0;i<N;i++){
    cin >> S.at(i);
    if(S.at(i)=='Y')  flag=true;
  }
  if(flag)  cout << "Four" << endl;
  else  cout << "Three" << endl;

  return 0;
}


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

int N = 0, M = 0;
int points[1001];
int scores[1002001];

bool check(int a, int c){
    if(a >= (N + 2) * (N + 1) / 2 - 1){
        return true;
    }
    return (scores[a] <= c && scores[a + 1] > c);
}

int search2(int a, int b, int c){
    int pib = a + b - b / 2;
    if(check(pib, c)){
        return pib;
    }else if(scores[pib] < c){
        return search2(pib, b / 2, c);
    }else{
        return search2(a, b / 2, c);
    }
}

int main(){
    for(;;){
        for(int i = 0; i < 1001; i++){
            points[i] = 0;
        }
        for(int i = 0; i < 1002001; i++){
            scores[i] = 0;
        }
        if(cin >> N){
            if(N == 0){
                break;
            }
            cin >> M;
            for(int i = 1; i <= N; i++){
                cin >> points[i];
            }
            for(int i = 0; i <= N; i++){
                for(int j = i; j <= N; j++){
                    scores[(2 * N - i + 1) * i / 2 + j] = points[i] + points[j];
                }
            }
            int mxsco = 0;
            sort(scores, scores + ((N + 2) * (N + 1)) / 2);
            for(int i = 0; i < (N + 2) * (N + 1) / 2; i++){
                if(scores[i] > M){
                    break;
                }
                int nosco = scores[i] + scores[search2(0, (N + 2) * (N + 1) / 2, M - scores[i])];
                if(nosco >= mxsco &&  nosco <= M){
                    mxsco = nosco;
                }
            }
            cout << mxsco << endl;
        }else{
            break;
        }
    }
    return 0;
}

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

const ll INF = 1LL << 60;

string S;

int main() {
    cin >> S;

    vector<ll> a(S.size() + 1);

    // < をみる
    rep(i, S.size()) {
        if (S[i] == '<') {
            a[i + 1] = max(a[i + 1], a[i] + 1);
        }
    }

    // > をみる
    for (int i = S.size() - 1; i >= 0; i--) {
        if (S[i] == '>') {
            // cout << "i: " << i << endl;
            // cout << i - 1 << " " << i << endl;
            a[i] = max(a[i], a[i + 1] + 1);
        }
    }
    
    // rep(i, a.size()) {
    //     cout << a[i] << endl;
    // }

    cout << accumulate(a.begin(), a.end(), 0LL) << endl;
}

Measured memory_bytes: 4740
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using System.Collections;

class Program
{
    static void Main()
    {
        int[] abk = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int A = abk[0];
        int B = abk[1];
        int K = abk[2];

        var ans = Enumerable.Range(1, Math.Max(A, B)).Where(n => (A % n == 0) && (B % n == 0)).OrderByDescending(n => n).ElementAt(K - 1);

        Console.WriteLine(ans);
        
    }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define fi first
#define se second

using namespace std;

typedef pair<int,int>P;
typedef pair<P,int>pi;

int pena[55][15];

int main()
{
    while(1){
        int m,t,p,r;
        cin >> m >> t >> p >> r;
        if(m == 0){
            break;
        }
        vector<pi> vec(t);
        rep(i,t){
            rep(j,p+1){
                pena[i][j] = 0;
            }
            vec[i] = pi(P(0,0),-i);
        }
        rep(i,r){
            int a,b,c,d;
            cin >> a >> b >> c >> d;
            b--;
            if(d){
                pena[b][c]++;
            }else{
                (vec[b].fi).fi--;
                (vec[b].fi).se += a + pena[b][c]*20;
            }
        }
        sort(vec.begin(),vec.end());
        P prv = P(-1,-1);
        rep(i,(int)vec.size()){
            if(prv == vec[i].fi){
                if(i){
                    cout << "=" << -vec[i].se+1;
                }else{
                    cout << -vec[i].se+1;
                }
            }else{
                prv = vec[i].fi;
                if(i){
                    cout << "," << -vec[i].se+1;
                }else{
                    cout << -vec[i].se+1;
                }
            }
        }
        cout << "\n";
    }
}



Measured memory_bytes: 3092
def func(n):
    cnt = 0
    a = int(n**0.5)
    for x in range(1, a+1):
        for y in range(x, a+1):
            z = y
            while(x**2+y**2+z**2+x*y+y*z+z*x <= n):
                if(x**2+y**2+z**2+x*y+y*z+z*x == n):
                    if(x == y == z):
                        cnt += 1
                    elif(x != y and y != z and z != x):
                        cnt += 6
                    else:
                        cnt += 3    
                    break
                z += 1
    return cnt

N = int(input())
    
for i in range(1, N+1):
    print(func(i))

Measured memory_bytes: 70676
a, v = map(int,input().split())

b, w = map(int,input().split())

t = int(input())

at = abs(v*t)
bt = abs(w*t)
if v<=w:
    print('NO')
elif v>w and (at-bt < abs(a-b)):
    print('NO')
else:
    print('YES')

Measured memory_bytes: 9188
n = int(input())
a = list(map(int, input().split()))

def color(point):
  if point < 3200:
    return point // 400
  else:
    return 8

vals = {}
for i in a:
  cl = color(i)
  vals.setdefault(cl, 0)
  vals[cl] += 1

# print(vals)
  
if 8 not in vals.keys():
  print(len(vals), len(vals))
else:
  print(max(1, len(vals) - 1), len(vals) + vals[8] - 1)

Measured memory_bytes: 3064
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;


int main()
{
	double t, x;
	cin >> t >> x;

	cout << t / x << endl;

	return 0;
}

Measured memory_bytes: 256
def BFS(K,edges,N):
  roots=[ [] for i in range(N)]
  for a,b,c in edges:
    roots[a-1]+=[(b-1,c)]
    roots[b-1]+=[(a-1,c)]
  dist=[-1]*N
  stack=[]
  stack.append(K)
  dist[K]=0
  while stack:
    label=stack.pop(-1)
    for i,c in roots[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        stack+=[i]
  return dist
 
N=int(input())
edges=[]
for i in range(N-1):
  edges+=[list(map(int,input().split()))]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,edges,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])

Measured memory_bytes: 86008
def choco(xa,ya,xb,yb,xc,yc,xd,yd): return 1 if abs((yb-ya)*(yd-yc)+(xb-xa)*(xd-xc))<1.e-10 else 0
while 1:
    try:
        xa,ya,xb,yb,xc,yc,xd,yd=map(float,raw_input().split())
        print 'YES' if choco(xa,ya,xb,yb,xc,yc,xd,yd) else 'NO'
    except:
        break

Measured memory_bytes: 6328
#include <iostream>

 

using namespace std;

 

int main()
{
   int a , b;
   cin >> a >> b;
   if (a > b)
       cout << "a > b" << endl; 
   else if (a < b)
       cout << "a < b" << endl;
   else
       cout << "a == b" << endl;
   
   return 0;
}


Measured memory_bytes: 3092
package main

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

func main() {
	sc := NewScanner()

	a := sc.ReadInt()

	ans := a + a*a + a*a*a

	fmt.Println(ans)
}

// util
// *   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base int, exponent uint) int {
	answer := 1
	for i := uint(0); i < exponent; i++ {
		answer *= base
	}
	return answer
}

func Ceil(divident, dividor int) int {
	quo := divident / dividor
	rem := divident % dividor

	if rem != 0 {
		if (divident > 0 && dividor > 0) ||
			(divident < 0 && dividor < 0) {
			return quo + 1
		}
	}
	return quo
}

// *   sortutil

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

func ReverseStrings(a []string) {
	sort.Sort(sort.Reverse(sort.StringSlice(a)))
}

// *   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}


Measured memory_bytes: 1776
//author:satwik_bhv1
#include<bits/stdc++.h>
//datatypes
#define ll long long 
#define ld long double
//loops
#define fr(i,z,n) for(ll i=z;i<n;i++)
#define br(i,z,n) for(ll i=z;i>n;i--)
//operations
#define mp  make_pair
#define ff  first
#define ss  second
#define pub push_back
#define all(v) v.begin(),v.end()
//map
#define mi map<ll,ll>
//vectors
#define vi vector<ll>
#define vpi vector<pair<ll,ll> >
//constants
#define pi 3.1415926535897932384626
#define mod 1000000007 
#define MAXN 100001
/*notes
    Don't use inbuilt fun for power
    Range of longlong=(-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 )
    INT_MAX = 2147483647(aprox 2*10^10)
    INT_MIN = -2147483648
    LLONG_MAX = 9223372036854775807 
    LLONG_MIN = -9223372036854775808
    __gcd is the function in built for hcf
    priority queue is max heap by default
    topological sort -> khan's algo use bfs and indegree of node  
    sssp(positive weighted edges) -> Dijkstras
    apsp -> Floydwarshall
    MST -> kruskal(DSU)
*/
using namespace std;
//functions
ll power(ll x,ll y){ll res=1;while(y){if(y%2){res*=x;}y/=2;x*=x;} return res;}
ll power(ll x,ll y,ll z){ll res=1;while(y){if(y%2){res=(res*x)%z;}y/=2;x=(x*x)%z;} return res;}
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); }
bool sortbysec(const pair<ll, ll>& a, const pair<ll, ll>& b) { return (a.second > b.second); }
ll ceil(ll x,ll y){return (x/y)+(x%y!=0);}
ll n;
ld arr[3000];
ld dp[3005][10005];
ld fun(ll pos,ll h)
{
    if(n-pos<h-1)
    {
        return dp[pos][h+n]=0;
    }
    if(pos==n+1&&h<=0)
    {
        return dp[pos][h+n]=1;
    }
    else if(pos==n+1)
    {
        return dp[pos][h+n]=0;
    }
    ld a,b;
    if(dp[pos+1][h+n-1]==-1)
    {
        a=fun(pos+1,h-1);
    }
    else
    {
        a=dp[pos+1][h+n-1];
    }
    if(dp[pos+1][h+n]==-1)
    {
        b=fun(pos+1,h);
    }
    else
    {
        b=dp[pos+1][h+n];
    }
    return dp[pos][h+n]=(arr[pos]*a)+((1-arr[pos])*b);
}
void solve()
{
    cin>>n;
    fr(i,1,n+1)
    {
        cin>>arr[i];
    }
    fr(i,0,n+5)
    {
        fr(j,0,2*n+10)
        {
            dp[i][j]=-1;
        }
    }
    cout<<fixed<<setprecision(10)<<fun(1,(n/2)+1);
}
int main()
{
    fast();
    ll t;
    t=1;
    //cin>>t;
    fr(i,0,t)
    {
        solve();
    }
}
/*





























*/

Measured memory_bytes: 297932
H, W, K = map(int, input().split(' '))
ls, rst = [], 0
for i in range(H):
    ls.append(input())

for i in range(1 << H):
    for j in range(1 << W):
        cnt = 0
        for s in range(H):
            if i >> s & 1:
                continue
            for t in range(W):
                if j >> t & 1:
                    continue
                if ls[s][t] == '#':
                    cnt += 1
        if cnt == K:
            rst += 1
print(rst)

Measured memory_bytes: 9016
#include "bits/stdc++.h"
using namespace std;
 
const int N = 123456;
int A[N];

int main(){
	int n, k;
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i)
		scanf("%d", A + i);
	long long com = 2, beshi = 2;
	for(int i = n; i ; --i){
		int z = A[i];
		com = ((com+z-1)/z)*z;
		beshi = (beshi/z)*z + z - 1;
		if(com > beshi) return puts("-1"), 0;	
	} 
	printf("%lld %lld\n", com, beshi);
}

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

#define rep(i,n) for(int i=0; i<n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)

int main(){
  int n;
  cin >> n;
  ll dp[110][4][4][4]={};
  
  //初期条件
  rep(i,4){
    rep(j,4){
      rep(k,4){
        if(i==0 && j==2 && k==1)continue;
        if(i==0 && j==1 && k==2)continue;
        if(i==2 && j==0 && k==1)continue;
        dp[3][i][j][k] = 1;
      }
    }
  }

  for(int i=3; i<n; i++){
    rep(j,4){
      rep(k,4){
        rep(l,4){
          rep(m,4){
            //j,k,l,mが特定の組の時含まない
            if(k==0 && l==2 && m==1)continue;
            if(k==0 && l==1 && m==2)continue;
            if(k==2 && l==0 && m==1)continue;
            if(j==0 && k==2 && m==1)continue;
            if(j==0 && l==2 && m==1)continue;
            dp[i+1][k][l][m] += dp[i][j][k][l];
            dp[i+1][k][l][m] %= MOD;
          }
        }
      }
    }
  }
  ll ans = 0;
  rep(i,4){
    rep(j,4){
      rep(k,4){
        ans += dp[n][i][j][k];
        ans %= MOD;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<string.h>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
	string s;
	cin >> s;
	cout << s[0] << s.size()-2 << s[s.size()-1];
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) T __VA_ARGS__; IN_(__VA_ARGS__);
void IN_() { };
template<typename T, typename ... U> void IN_(T &  a, U &  ... b) { cin >> a; IN_(b ...); };
template<typename T                > void OUT(T && a            ) { cout << a << endl; }
template<typename T, typename ... U> void OUT(T && a, U && ... b) { cout << a << " "; OUT(b ...); }

// ---- ----

template<typename T> istream & operator>>(istream & s, vector<T> & v) { RF(e, v) { s >> e; } return s; }
template<typename T> ostream & operator<<(ostream & s, vector<T> const & v) {
	inc(i, SI(v)) { s << (i == 0 ? "" : " ") << v[i]; }
	return s;
}

int main() {
	IN(int, n);
	vector<int> a(n);
	cin >> a;
	int ans = 0;
	inc(i, n) { if(i % 2 == 0 && a[i] % 2 == 1) { ans++; } }
	OUT(ans);
}


Measured memory_bytes: 3604
import math
import itertools

A=[]
N = int(input())
E=math.factorial(N)
lis = [x for x in range(0,N)] # 0からN-1までのリスト
P = list(itertools.permutations(lis))# 全ての場合のリストを生成

for i in range(N):
 x=list(map(int,input().split()))
 A.append(x)
B=0
for j in range(E):
 for k in range(N-1):
  a=P[j][k]
  b=P[j][k+1]
  B+=((A[a][0]-A[b][0])**2+(A[a][1]-A[b][1])**2)**(1/2)
C=B/E
print(C)


Measured memory_bytes: 45808
import java.io.*;
import java.util.Scanner;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();
		int k = sc.nextInt();

		if ((n + 1) / 2 >= k) {
			pr.println("YES");
		} else {
			pr.println("NO");
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 21972
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  if (a[0] != 0) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i < n; ++i) {
    if (a[i] - a[i - 1] > 1) {
      puts("-1");
      return 0;
    }
  }
  int64 ret = 0;
  for (int i = 0, j; i < n; i = j) {
    for (j = i + 1; j < n && a[j] == a[j - 1] + 1; ++j);
    // trace(i, j, a[j - 1], a[i]);
    ret += a[j - 1];
  }
  printf("%lld\n", ret);
  return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef long long ll;
typedef unsigned long long llu;

using namespace std;

int main() {
    FIO
    int n;
    cin>>n;
    vector<int> sk(2*n);
    for(int i=0; i<2*n; i++)
        cin>>sk[i];
    sort(sk.begin(), sk.end());
    ll ans = 0;
    for(int i=0; i<2*n; i+=2)
        ans += sk[i];
    cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main() {
  long long x;
  cin >> x;
  long long c = 2*(x / 11);
  x -= (c/2)*11;
  if      (x>6) c += 2;
  else if (x > 0) c++;
  cout<<c<<"\n";
  return 0;
}


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

int main() {
  int N, j = 0, k = 40;
  cin >> N;

  for(int i = 0; i < N; i++){
    int x;
    cin >> x;
    
    while(x % 2 == 0){
      x /= 2;
      j++;
    }
    if(j < k){
      k = j;
    }
    j = 0;
  }
  cout << k  << endl;
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
#define Size(n) (n).size()

typedef long long ll;

using namespace std;

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

//long long int kaizyo(long long int hh){
  //  cmp=1;
    //while(hh>1){
      //  cmp=(cmp*hh)%MOD;
        //hh--;
    //}
    //return cmp;
//}
//long long int ruizyo(long long int aa, long long int bb){
  //  if(aa==0){
    //    return 1;
    //}
    //else if(aa%2==0){
      //  long long int tt=ruizyo(aa/2,bb);
        //return (tt*tt)%MOD;
    //}
    //else{
      //  return (ruizyo(aa-1,bb)*bb)%MOD;
    //}
//}フェルマ－のア


//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

//bool f[100001];//1000000以下の素数を調べよう！
//rrep(i,2,100001){
  //      f[i]=false;
    //}
//rrep(i,2,100001){
  //      if(!f[i]){
    //        for(int j=i+i;j<=100000;j+=i){
      //          f[j]=true;
        //    }
        //}
    //}
    //for(int i=3;i<=100000;i+=2){
      //  if(!f[i]){
        //    c[i]++;
      //  }
   // }

//visited=vector<vector<bool>>(10,vector<bool>(10,false));アを全部falseに


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s[500],ww[500];
bool fl=true;

//-------------------------↓↓↓↓↓↓----------------------------

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

       cin >> n;
       map<string,int> mp;
       rep(i,n){
           cin>>s[i];
          // Cout(s[i]);
          mp[s[i]]++;
       }
       cin>>m;
       rep(i,m){
           cin>>ww[i];
           mp[ww[i]]--;
       }
       rep(i,n){
           if(mp[s[i]]>ans){
               ans=mp[s[i]];
           }
       }
       if(ans<0){
           Cout(0);
       }
       else{
           Cout(ans);
       }
       
       
       
return 0;
}


Measured memory_bytes: 256
/*
ID: Aman Raj
LANG: C++
TASK: preface
*/
#include<iostream>
#include <stdio.h>
//#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#include<math.h>
typedef  long long int ll;
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;

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

   ll g=1e9+7;
  int main()
 {
      ifstream fin("tcase.txt");

       ll n,m;cin>>n>>m;
        vector<vector<ll> > v(n);
        for(ll i=0;i<n;i++)
        {
            for(ll j=0;j<m;j++)
            {char ch;cin>>ch;ch=='#'? v[i].push_back(0):v[i].push_back(1);}
        }
        vector<vector<ll> > dp(n+1);
       dp[n].resize(m);dp[n][m-1]=1;
        for(ll i=n-1;i>=0;i--)
        {   dp[i].resize(m+1);
            for(ll j=m-1;j>=0;j--)
            {
               if(v[i][j]==1) dp[i][j]=(dp[i+1][j]+dp[i][j+1]);dp[i][j]%=g;
            }
        }
        cout<<dp[0][0];
	return 0;
 }




Measured memory_bytes: 16128