akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<string> S(N);
  vector<ll> rec(5);  
  for(int i = 0; i < N; ++i){
    cin >> S[i];
    switch(S[i][0]){
    case 'M':
      rec[0]++;
      break;
    case 'A':
      rec[1]++;
      break;
    case 'R':
      rec[2]++;
      break;
    case 'C':
      rec[3]++;
      break;
    case 'H':
      rec[4]++;
      break;
    }
  }
  ll ans = 0;
  for(int i = 0; i <= 2; i++){
    for(int j = i + 1; j <= 3; j++){
      for(int k = j + 1; k <= 4; k++ ){
	ans += rec[i] * rec[j] * rec[k];
      }
    }
  }

  cout << ans << endl;

}


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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;
const ll 	N 		= 	2*1e6;

/*vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};
*/
// <------------- Declare Variables Here ------------> //

ll T=1;
ll n,x,y,m;
string s,t;
vll a;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin >> s;
	x = count(all(s),'o');
	cout<<(700 + x*100);
}

int main() {
	fastio;randomINT;
	//cin>>T;
	while(T--) {
		MAIN();
	}
	return 0;
}



Measured memory_bytes: 3560
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <cmath>
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1e9
typedef long long int ll;
using namespace std;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
    for (T &x : vec)
        is >> x;
    return is;
}

ll gcd(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    while (m != n)
    {
        if (m > n)
            m = m - n;
        else
            n = n - m;
    }
    return m;
}

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

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

    int ans = to_string(N).size();

    for(ll A=1; A*A<=N; A++){
        if(N%A!=0)  continue;
        const ll B = N/A;
        const int res = max(to_string(A).size(), to_string(B).size());
        if(ans>res){
            ans = res;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
n=int(input())
arr=list(map(int,input().split()))
sum1=1
for val in arr:
  sum1*=val
sum2=0
for i in range(n):
  tmp=1
  for j in range(n):
    if i==j:
      continue
    tmp*=arr[j]
  sum2+=tmp
print(sum1/sum2)

Measured memory_bytes: 39024
#include<iostream>
#include<vector>
#include<map>
using namespace std;
#define int long long

signed main() {
        int N;
        cin >> N;
        map<int, int> a;
        for(int i = 0; i < N; ++i) {
                int x;
                cin >> x;
                a[x]++;
        }
        int res = 0;
        for(auto i=a.begin(); i != a.end(); ++i) {
                if(i->second < i->first) {
                        res += i->second;
                }
                else {
                        res += i->second - i->first;
                }
        }
        cout << res << endl;
        return 0;
}


Measured memory_bytes: 6272
#include <iostream>

using namespace std;

int main(){
    int K;
    int N;
    int *A;
    int *distance;
    cin >> K >> N;
    A=new int[N];
    distance=new int[N];
    
    for(int i=0;i<N;i++) cin>>A[i];
    
    for(int i=0;i<N-1;i++){
        distance[i]=A[i+1]-A[i];
    }
    distance[N-1]=K-A[N-1]+A[0];
    
    int sum=0;
    int max=0;
    for(int i=0;i<N;i++){
        sum+=distance[i];
        if(distance[i]>max) max=distance[i];
    }
    
    cout << sum-max<<endl;
    
    delete[] A;
    
    return 0;
}



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

int main() {
    int k, s, count=0;
    cin >> k >> s;
    for (int i = 0; i <= k; i++) {
        for (int j = 0; j <= k; j++) {
            if (0 <= s-(i+j) && s-(i+j) <= k) count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

const ll nmax = 1e9 + 7;
const ll Mod = 998244353;
const double PI = 2 * asin(1);

int main(){
  int N; cin >> N;
  int C[N];
  for (int i = 0; i < N; i++) cin >> C[i];

  vector <int> Before_Index(2e5 + 1);
  fill(Before_Index.begin(), Before_Index.end(), -1);

  vector <ll> DP(N);
  DP[0] = 1; 
  Before_Index[C[0]] = 0;

  for (int i = 1; i < N; i++){
    DP[i] = DP[i - 1];
    DP[i] %= nmax;
    if (Before_Index[C[i]] == -1){
      Before_Index[C[i]] = i;
      continue;
    }
    if (C[i] == C[i - 1]){
      continue;
    }

    DP[i] += DP[Before_Index[C[i]]];
    Before_Index[C[i]] = i;
    DP[i] %= nmax;
  }
  cout << DP[N - 1] << endl;

  return 0;
}


Measured memory_bytes: 3456
#!/usr/bin/env python3
import collections


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    A = list(map(int, input().split()))

    tasitayatu = [0] * N
    hiitayatu = [0] * N

    for i in range(N):
        tasitayatu[i] = A[i] + i
        hiitayatu[i] = A[i] - i

    tasitacount = collections.Counter(tasitayatu)
    hiitacount = collections.Counter(hiitayatu)

    res = 0
    for i in range(N):
        res += tasitacount[-hiitayatu[i]]
        res += hiitacount[-tasitayatu[i]]

    print(res // 2)


if __name__ == '__main__':
    main()


Measured memory_bytes: 128132
#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 Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;
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;
bool fl;
struct edge{int to,cost;};

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

int main(void){
  
       cin.tie(0);
    ios::sync_with_stdio(false);
      
      cin>>n>>a>>b>>s;
      ans=0;
      rep(i,n){
        if(s[i]=='a'){
          if(ans<a+b)Cout("Yes"),ans++;
          else Cout("No");
        }
        else{
          if(s[i]=='c')Cout("No");
          else{
          if(ans<a+b){
            if(cnt<b)Cout("Yes"),cnt++,ans++;
            else Cout("No");
          }
          else Cout("No");
        }
        }
        //Cout(ans);
      }
    
       
return 0;
}


Measured memory_bytes: 848
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>

using namespace std;

long long n,a,b;

int main(){
	scanf("%lld%lld%lld",&n,&a,&b);
	if (n==1){
		if (a!=b) puts("0");
		else puts("1");
		return 0;
	}
	if (n==2){
		puts("1");
		return 0;
	}
	if (a>b){
		puts("0");
		return 0;
	}
	long long ans=b*(n-2)-a*(n-2)+1;
	printf("%lld\n",ans);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#define SORT(c) sort(ALL((c)))
#define debug(x)                 \
    do {                         \
        std::cout << #x << ": "; \
        view(x);                 \
    } while (0)

template <typename T>
void view(T e) {
    std::cout << e << std::endl;
}
template <typename T>
void view(const std::vector<T>& v) {
    for (const auto& e : v) {
        std::cout << e << ", ";
    }
    std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
    for (const auto& v : vv) {
        view(v);
    }
}

int main() {
    ll N, C, K;
    cin >> N >> C >> K;
    vector<ll> T(N);
    rep(i, N) { cin >> T[i]; }
    sort(T.begin(), T.end(), greater<ll>());

    ll ans = 0;
    while (!T.empty()) {
        ll t = T.back();
        T.pop_back();
        rep(i, C - 1) {
            if (!T.empty()) {
                ll t_tmp = T.back();
                if (t_tmp <= t + K) {
                    T.pop_back();
                } else {
                    break;
                }
            }
        }
        ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3956
// 入力マクロ
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}


fn main() {
    input! {
        s: chars,
    }

    let n = s.len();

    // println!("{:?}", &s[..(n-1)/2]);
    // println!("{:?}", &s[(n+1)/2..]);

    if kaibun(&s) && kaibun(&s[..(n-1)/2]) && kaibun(&s[(n+1)/2..]) {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn kaibun(s: &[char]) -> bool {
    let n = s.len();
    for i in 0..n/2 {
        if s[i] != s[n-i-1] {
            return false;
        }
    }
    true
}


Measured memory_bytes: 4352
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<u64>();
    let (mut q, mut h, mut s, mut d) = (line[0], line[1], line[2], line[3]);
    let n = read_as_vec::<u64>()[0];

    s = cmp::min(cmp::min(s, 4*q), 2*h);
    d = cmp::min(cmp::min(d, 8*q), cmp::min(4*h, 2*s));

    println!("{}", n/2*d+(n%2)*s);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007ll
#define mod1 998244353ll
#define inf (ll)1e18+1
#define endl "\n"
using namespace std::chrono;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll n,k;
    cin>>n>>k;
    ll ar[n];
    for(ll x=0;x<n;x++){
        cin>>ar[x];
    }
    bool dp[k+1];
    dp[0]=false;
    for(ll x=0;x<n;x++){
        dp[ar[x]]=true;
    }
    for(ll x=1;x<=k;x++){
        dp[x]=false;
        for(ll y=0;y<n;y++){
            if(ar[y]<=x){
                if(dp[x-ar[y]]==false){
                    dp[x]=true;
                }
            }
        }
    }
    if(!dp[k]){
        cout<<"Second"<<endl;
    }else{
        cout<<"First"<<endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define pdi pair<db,int>
#define mp make_pair
#define pb push_back
#define enter putchar('\n')
#define space putchar(' ')
#define eps 1e-8
#define mo 974711
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;char c = getchar();T f = 1;
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 + c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int N,M;
void Solve() {
    read(N);read(M);
    int ans = M * 1900 + (N - M) * 100;
    for(int i = 1 ; i <= M ; ++i) ans *= 2;
    out(ans);enter;
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
    return 0;
}


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

//const long double PIL = 3.141592653589793238462643383279502884L;
//const double PI = 3.14159265358979323846;

#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define what_is(x) cerr << #x << " is " << x << endl;

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int,int>>;

const int MOD = 1e9 + 7;

ll powmod(ll a, int p) {
	if (p == 1) return a;
	ll r = powmod(a, p/2);
	r = (r * r) % MOD;
	if (p&1) r = (r * a) % MOD;
	return r;
}

int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);
	int x, y;
	scanf("%d%d", &x, &y);

	if ((2*y - x) % 3 != 0 || (2*x - y) % 3 != 0) {
		puts("0");
		return 0;
	}
	int a = (2*y - x) / 3;
	int b = (2*x - y) / 3;
	if (a < 0 || b < 0) {
		puts("0");
		return 0;
	}

	ll n = 1, m = 1;
	for (int i = 0; i < a; i++) {
		n = (n * (a + b - i)) % MOD;
		m = (m * (i+1)) % MOD;
	}

	m = powmod(m, MOD - 2);
	ll answer = (n * m) % MOD;
	printf("%lld\n", answer);
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

// y > 0
ll divl(ll x, ll y){
    if (x >= 0) return x / y;
    return x / y - ((-x) % y > 0);
}

// y > 0
ll res(ll x, ll y){
    return x - divl(x, y) * y;
}

int main() {
    ll n, x, d;
    cin >> n >> x >> d;
    if (d == 0){
        cout << (x == 0 ? 1 : n + 1) << endl;
        return 0;
    }
    if (d < 0){
        x *= -1;
        d *= -1;
    }

    map<ll, set<PL>> mp;
    for (ll c = 0; c <= n; c++){
        ll p = x * c;
        ll ofs = divl(p, d);
        ll r = res(p, d);
        ll mi = c * (c - 1) / 2;
        ll ma = (n - 1) * c - mi;
        mp[r].insert(PL(mi + ofs, ma + ofs));
    }

    ll ans = 0;
    for (auto tmp : mp){
        ll r = -1e18;
        for (PL p : tmp.second){
            // cout << tmp.first << "   " << p.first << " " << p.second << endl;
            if (r < p.first) r = p.first - 1;
            ans += max(0LL, p.second - r);
            chmax(r, p.second);
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 31488
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N, K;
  cin >> N >> K;

  // 最短距離2である頂点対の数
  // 数珠つなぎ *-*-*-*
  // N-2
  // スターグラフ これが上限？
  // (N-1)(N-2)/2

  if (K > (N - 1) * (N - 2) / 2) {
    cout << -1;
    return 0;
  }

  int m = N * (N - 1) / 2 - K;
  cout << m << newl;

  // まず0から放射状にスターグラフ
  FOR(i, 1, N) {
    cout << "1 " << (i + 1) << newl;
  }

  // それ以降は、Kの数だけ繋がず、他は全部つなぐ
  FOR(i, 1, N) {
    FOR(j, i + 1, N) {
      if (K) {
        K--;
        continue;
      }

      cout << (i + 1) << " " << (j + 1) << newl;
    }
  }
}
#endif


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

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    for (int i = 0; i < h; ++i) {
        cin >> a.at(i);
    }
    string b(w + 2, '#');
    cout << b << '\n';
    for (int i = 0; i < h; ++i) {
        cout << '#' << a.at(i) << "#\n";
    }
    cout << b << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;




int main()
{
    int N;
    cin >> N;
    int b = 0;
    rep(i,N){
        int a;cin >> a;
        if(a%2==1) b++;
    }

    cout << (b%2==0?"YES":"NO") << endl;
    
    
    
    

    return 0;
}


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

const int MAXN = 100010;
int n, m;
int X[MAXN];
int main() {
	cin>>n>>m;
	for (int i=0; i<m; i++)
		cin>>X[i];
	sort(X, X+m);

	vector<int> space;
	for (int i=1; i<m; i++)
		space.push_back(X[i]-X[i-1]);
	sort(space.begin(), space.end());

	int ans = X[m-1] - X[0];
	while(--n && space.size()) {
		ans -= space.back();
		space.pop_back();
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1276
def ct(arr,rows,cols):
	ret = 0
	for i in range(len(arr)):
		for j in range(len(arr[0])):
			if(rows[i]=='0' and cols[j]=='0' and arr[i][j]=='#'):
				ret+=1
	return ret
h,w,k = list(map(int,input().split()))
arr = []
for i in range(h):
	l = input()
	arr.append(l)
	# for j in range(w):
		# arr[i][j] = l[j]
ans = 0
for i in range(2**h-1,-1,-1):
	for j in range(2**w-1,-1,-1):
		if ct(arr,(bin(i)[2:]).zfill(h),(bin(j)[2:]).zfill(w))==k:
			ans+=1
print(ans)

Measured memory_bytes: 9228
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
#define LL long long

using namespace std;

LL solve(LL x){
  if(x == 0){
    return 0;
  }else if( x  == 1){
    return 1;
  }else{
    return solve(x / 2) * 2 + 1;
  }
}
int main()
{
  LL H;
  cin >> H;

  LL answer = solve(H);

  cout << answer << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
	int i=0;
	string s;
	cin >> s;
	int n = s.length();
	while(i<n)
	{
		if(s[i] == 'd' && s[i+1] == 'r' && s[i+2] == 'e' && s[i+3] == 'a' && s[i+4] == 'm')
		{
			if(s[i+5] == 'e' && s[i+6] == 'r')
			{
				if(s[i+7] == 'a')
				{
					i+=5;
				}
				else
				{
					i+=7;
				}
			}
			else
			{
				i+=5;
			}
		}
		else if(s[i] == 'e' && s[i+1] == 'r' && s[i+2] == 'a' && s[i+3] == 's' && s[i+4] == 'e')
		{
			if(s[i+5] == 'r')
			{
				i+=6;
			}
			else
			{
				i+=5;
			}
		}
		else
		{
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 512
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

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

fn main() {
    let n = read::<usize>();
    let a = read_vec::<usize>();
    let mut b = VecDeque::new();
    for i in 0..n {
        if i % 2 == 0 {
            b.push_back(a[i]);
        } else {
            b.push_front(a[i]);
        }
    }
    if n % 2 == 1 {
        for &num in b.iter().rev() {
            print!("{} ", num);
        }
    } else {
        for num in b {
            print!("{} ", num);
        }
    }
    println!("");
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 10228
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); \
					  cerr << "\n\n" << "Time elapsed: " << \
					  (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
					  return 0
#define ll long long int
#define ull unsigned long long int
#define db long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound 
#define pii pair<int , int>
#define pdd pair<db , db>
#define pll pair<ll , ll>
#define vpl vector<pll >
#define vll vector<ll >
#define mod 1000000007
#define inf 100000000000000007
#define eps 0.000001
#define stp fixed<<setprecision(20)
#define endl '\n'

ll taken[3005][3005];
pll bck[3005][3005];
ll dp[3005][3005];
string ans="";
string s,t;

inline void backtrack(ll i,ll j)
{
	if(i==0 || j==0)
		return;

	if(taken[i][j])
		ans+=s[i];

	backtrack(bck[i][j].ff,bck[i][j].ss);
}

int main()
{
	start_routine();
	fastio;
	

    cin>>s>>t;
    s="*"+s;
    t="*"+t;

    for(ll i=1;i<s.size();i++)
    {
    	for(ll j=1;j<t.size();j++)
    	{	
    		if(s[i]==t[j])
    		{
    			dp[i][j]=1+dp[i-1][j-1];
    			bck[i][j]={i-1,j-1};
    			taken[i][j]=i;
    		}
    		else
    		{
    			dp[i][j]=dp[i-1][j];
    			bck[i][j]={i-1,j};
    			if(dp[i][j-1]>dp[i][j])
    			{
    				dp[i][j]=dp[i][j-1];
    				bck[i][j]={i,j-1};
    			}
    		}
    	}
    }
    
    backtrack(s.size()-1,t.size()-1);
    reverse(ans.begin(), ans.end());
    cout<<ans;
    
	end_routine();
}

Measured memory_bytes: 282368
S = input()
str_list = list(S)
p = len(S) - 1

ans = 0
for i in range(2 ** p):
    num = str_list[0]
    for j in range(p):
        if (i >> j) & 1:
            ans += int(num)
            num = ''
        num += str_list[j+1]
    ans += int(num)

print(ans)


Measured memory_bytes: 39280
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>

#define rep(i, n) for (int i = 0; i < (int)(n)); i++)

using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    int p1 = a*n, p2 = b;
    if (p1 <= p2) {
        cout << p1 << endl;
    } else {
        cout << p2 << endl;
    }
}


Measured memory_bytes: 764
<?php
$n = intval(fgets(STDIN));
$s = intval(fgets(STDIN));

if($n == $s){
    echo $n+1,"\n";exit;
}
//$bがsqrt($n)より小さい場合
for($i = 2, $I = sqrt($n); $i <= $I; $i++){
    $m = $n;
    $sum = 0;
    while($m){
        $sum += $m % $i;
        $m = intdiv($m, $i);
    }
    if($sum == $s){
        echo $i,"\n";exit;
    }
}
//$bがsqrt($n)以上の場合　上位桁を決め打つと下位の桁は決まる
$minB = 10**18;
for($p = 1, $P = sqrt($n); $p <= $P; $p++){
    $q = $s - $p;
    if(($n-$q) % $p != 0)continue;
    $b = ($n-$q)/$p;
    if($p >= $b)continue;
    if($q >= $b)continue;
    if($q < 0)continue;
    $minB = min($minB, $b);
}
if($minB == 10**18){
    echo -1,"\n";
}else{
    printf("%d\n", $minB);
}

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

using namespace std;

#define PROBLEM "A"
#define TESTC ""

#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
typedef pair<int, int> P;
#define F first
#define S second
#define INF 0x3f3f3f3f
#define MP make_pair
#define PB push_back
#define LL long long

int main()
{
	#ifdef DBG
	freopen(PROBLEM TESTC ".in", "r", stdin);
	freopen(PROBLEM ".out", "w", stdout);
	#endif

	string str;

	while(cin >> str)
	{
		if(str == "Sunny")
			cout << "Cloudy" << '\n';
		else if (str == "Cloudy")
			cout << "Rainy" << '\n';
		else if (str == "Rainy")
			cout << "Sunny" << '\n';
		}	

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 10007
#define REP(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi<b.fi;
}
//----------------------------------------------------------------------

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //------------------------------
    int a,b,C;cin>>a>>b>>C;
    double c=(double)C*PI/180;
    printf("%.10lf\n",sin((double)c)*(double)a*(double)b*0.5);
    printf("%.10lf\n",(double)a+(double)b+pow((double)a*a+(double)b*b-(double)2*a*b*cos((double)c),0.5));
    printf("%.10lf\n",sin((double)c)*(double)b);
    //cout<<sin((double)c)<<endl;
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------


































Measured memory_bytes: 3612
x = [[0]*50 for i in range(11)]
for i in range(0, 2**10):
    B = format(i,'b')[::-1]
    s,c,j = 0,0,0
    for e in B:
        if e=="1": s,c = s+j, c+1
        j += 1
    x[c][s]+=1

while 1:
    n, s=map(int, raw_input().split())
    if n==0 and s==0: break
    print 0 if s>=50 else x[n][s]

Measured memory_bytes: 4248
#include<bits/stdc++.h>
#define int long long int
using namespace std;

int32_t main()
{
    int a;
    cin>>a;
    int principle = 100, rate = 1; 
    int i,ans;
    for(i=1;i<3761;i++)
    {
        principle = principle*(1.01);
        if(principle >=a)
        {
            cout<<i;
            break;
        }
    }
    

}


Measured memory_bytes: 3632
while True:
    x, op, y = input().split()
    if op == "+":
        print(int(x) + int(y))
    elif op == "-":
        print(int(x) - int(y))
    elif op == "*":
        print(int(x) * int(y))
    elif op == "/":
        print(int(int(x) / int(y)))
    else:
        break


Measured memory_bytes: 5600
class Heap
  attr_reader :size
  def initialize
    @heap = []
    @size = 0
  end
  def sum
    @heap.inject(:+)
  end
  def push(n)
    i = @size
    while i > 0
      pid = (i - 1) / 2
      break if n >= @heap[pid]
      @heap[i] = @heap[pid]
      i = pid
    end
    @heap[i] = n
    @size += 1
  end
  def pop
    top = @heap[0]
    @size -= 1
    n = @heap[@size]
    i = 0
    while i * 2 + 1 < @size
      cid1 = i * 2 + 1
      cid2 = cid1 + 1
      if cid2 < @size && @heap[cid2] < @heap[cid1]
        cid1 = cid2
      end
      break if @heap[cid1] >= n
      @heap[i] = @heap[cid1]
      i = cid1
    end
    @heap[i] = n
    top
  end
end

def input_n
  gets.to_i               # 単一整数
end

def input_s
  gets.chomp              # 文字列。chompを付けないと改行文字がついてくる
end

def input_a
  gets.split.map(&:to_i)  # スペースで区切られた複数の整数
end

def input_o(num)
  num.times.map { gets.to_i }  # 縦に並んだ複数の整数。たまにある
end

def output_f(num)
  puts sprintf("%.12f", num)
end

n, m = input_a
a = input_a

q = Heap.new

a.each do |num|
  q.push(-num)
end

m.times do
  max = q.pop
  max = -(-max / 2)
  q.push(max)
end

sum = 0
while q.size != 0
  sum += -q.pop
end
puts sum

Measured memory_bytes: 9556
N,A=map(int,input().split())
x=list(map(int,input().split()))

p=[];z=0;n=[]
for xi in x:
    if xi>A:
        p.append(xi-A)
    elif xi==A:
        z+=1
    elif xi<A:
        n.append(A-xi)

K=min(sum(p),sum(n))

Pa=[0 for j in range(K+1)];Pa[0]=1
Na=[0 for j in range(K+1)];Na[0]=1

for pi in p:
    for j in range(K,pi-1,-1):
        Pa[j]+=Pa[j-pi]
for ni in n:
    for j in range(K,ni-1,-1):
        Na[j]+=Na[j-ni]

ans=2**z-1 # zのみ
for j in range(1,K+1):
    ans+=2**z*Pa[j]*Na[j]

print(ans)

Measured memory_bytes: 38640
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  vector<char> a{'C','O','D','E','F','E','S','T','I','V','A','L','2','0','1','6'};
  int n=0;
  for(int i=0;i<16;i++){
    if(s.at(i)!=a.at(i))n++;
  }
  cout<<n<<endl;
}


Measured memory_bytes: 256
#![allow(unused_mut, non_snake_case, unused_imports, dead_code)]

use std::iter;
use std::cmp::{max, min, Ordering};
use std::mem::swap;
use std::collections::{HashMap, BTreeMap, HashSet, BTreeSet, BinaryHeap, VecDeque};
use std::iter::FromIterator;

//　高速 EOF要
//macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();input_inner!{iter, $($r)*}};($($r:tt)*) => {let mut s = {use std::io::Read;let mut s = String::new();std::io::stdin().read_to_string(&mut s).unwrap();s};let mut iter = s.split_whitespace();input_inner!{iter, $($r)*}};}
//macro_rules! input_inner {($iter:expr) => {};($iter:expr, ) => {};($iter:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($iter, $t);input_inner!{$iter $($r)*}};}
//macro_rules! read_value {($iter:expr, ( $($t:tt),* )) => {( $(read_value!($iter, $t)),* )};($iter:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()};($iter:expr, chars) => {read_value!($iter, String).chars().collect::<Vec<char>>()};($iter:expr, usize1) => {read_value!($iter, usize) - 1};($iter:expr, $t:ty) => {$iter.next().unwrap().parse::<$t>().expect("Parse error")};}
// 低速 EOF不要
macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();let mut next = || { iter.next().unwrap() };input_inner!{next, $($r)*}};($($r:tt)*) => {let stdin = std::io::stdin();let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next = move || -> String{bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next, $($r)*}};}
macro_rules! input_inner {($next:expr) => {};($next:expr, ) => {};($next:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($next, $t);input_inner!{$next $($r)*}};}
macro_rules! read_value {($next:expr, ( $($t:tt),* )) => {( $(read_value!($next, $t)),* )};($next:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()};($next:expr, chars) => {read_value!($next, String).chars().collect::<Vec<char>>()};($next:expr, usize1) => {read_value!($next, usize) - 1};($next:expr, $t:ty) => {$next().parse::<$t>().expect("Parse error")};}

// 非常時
fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

fn main() {
    input!(AB:i32,BC:i32,CA:i32);
    println!("{}",AB*BC/2);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define	rep(i,n)	for(int i=0;i<n;i++)
int main(){
  int n;	cin >> n;
  vector<int>	d(n);
  rep(i,n)	cin >> d[i];
  sort(d.begin(),d.end());
  
  if(d[n/2]==d[n/2-1])	cout << 0;
  else	cout << d[n/2]-d[n/2-1];
}

Measured memory_bytes: 3732
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

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

	N, H := nextInt(), nextInt()

	a := make([]int, N)
	b := make([]int, N)
	for i := 0; i < N; i++ {
		a[i], b[i] = nextInt(), nextInt()
	}

	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	ma := a[0]

	sort.Sort(sort.Reverse(sort.IntSlice(b)))

	cnt := 0
	for i := 0; i < len(b); i++ {
		if b[i] > ma {
			H -= b[i]
			cnt++
		}

		if H <= 0 {
			fmt.Println(cnt)
			return
		}
	}

	cnt += H / ma

	if H%ma != 0 {
		cnt++
	}

	fmt.Println(cnt)
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
string s;
bool ans = false;
int main(){
    string s;
    cin >> s;
    for(int i = 0;i<8;i++){
        int val = s[0] - '0';
        string ans = "";
        ans.push_back(s[0]);
        for(int j = 0;j<3;j++){
            if(i&(1<<j)){
                val += s[j+1]-'0';
                ans.push_back('+');
            }
            else{
                val-=s[j+1]-'0';
                ans.push_back('-');
            }
            ans.push_back(s[j+1]);
        }
        if(val==7){
            cout << ans << "=7" << endl;
            return 0;
        }
    }
}

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

typedef long long LL;
LL n,k;
const LL mof=1e9+7;
LL p=mof;
const LL maxn=200007;
inline LL pow_mod(LL a,LL k,LL mo)
{
    LL ans=1;
    while(k)
    {
        if(k%2) ans=ans*a%mo;
        a=a*a%mo;
        k>>=1;
    }
    return ans%mo;
}
LL jc[maxn+7];
inline LL inv(LL x)
{
    return pow_mod(x,mof-2,mof);
}
LL Inv[maxn+7];
LL C(LL N,LL k)
{
    if(k>N||k<0)return 0;
    if(k==0||k==N)return 1;
    LL ans=1;
    ans=ans*jc[N]*Inv[k]%mof*Inv[N-k]%mof;
    return ans;
}
void init()
{
    jc[1]=jc[0]=1;
    for(LL i=2; i<=maxn; ++i) jc[i]=jc[i-1]*i%mof;
    for(int i=0; i<=maxn; ++i) Inv[i]=inv(jc[i]);
}
int main()
{
    init();
    LL n,m,k;
    cin>>n>>m>>k;
    LL ans = 0;
    LL cnt = 0;
    for(LL d=1;d<=m;++d)
        cnt += d * (m-d) % mof;
    ans += cnt * n % mof * n % mof * C(n*m-2,k-2) % mof;
    cnt = 0;
    for(LL d=1;d<=n;++d)
        cnt += d * (n-d) % mof;
    ans += cnt * m % mof * m % mof * C(n*m-2,k-2) % mof;
    ans %= mof;
    cout<<ans<<endl;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define TRAV(a, x) for(const auto& a : x)
#define ALL(x) x.begin(), x.end()
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

typedef long long ll;

void solve() {
  int n;
  int count = 1;
  int a,b = 0;
  cin >> n;
  vector<int> p(n),q(n),v(n);
  REP(i, n) cin >> p.at(i);
  REP(i, n) cin >> q.at(i);
  REP(i, n) v[i] = i+1;
  do{
		if (v == p) a = count;
		if (v == q) b = count;
		count++;
	} while(next_permutation(ALL(v)));
  cout << abs(a-b) << endl;
}
 
int main() {
  solve();
  return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n; cin >> n;
  set<int> st;
  for(int i = 0; i < n; ++i){
    int x; cin >> x;
    st.insert(x);
  }
  if((int)st.size() == n){
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  
  return 0;
}


Measured memory_bytes: 9600
#include <algorithm>
#include <iostream>

int sd(int x) {
  int ret{};
  while(x) {
    ret += x %10;
    x /= 10;
  }
  return ret;
}

using namespace std;
int main() {
  int N, mi;
  cin >> N;
  mi = N;
  for (auto i = 1; i <=N/2; ++i) {
    mi = min(mi,sd(i)+sd(N-i));
  }
  cout << mi << endl;
  return 0;
}


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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = 1e9+7; typedef vector<ll> VL;

void dbg(){ cerr << "\n"; } template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n,r,g,b, ans =0;
	cin >>r >>g >>b >>n;
	
	rep(i, n/r+1) rep(j, n/g +1){
		
		int sm = i*r+j*g;
		if(sm >n) continue;
		int c= n - sm;
		if(c < 0 || c%b !=0) continue;
		ans++;
	}
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
module Main where
import qualified Data.ByteString.Char8         as BS
import qualified Data.ByteString.Lazy.Char8    as BSL
import qualified Data.ByteString.Builder       as BSB
import           Data.Char                      ( isSpace )
import           Data.List                      ( unfoldr )

main :: IO ()
main = do
  x <- readLn :: IO Int
  xs <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  print $ sum $ zipWith (-) (scanl1 max xs) xs


Measured memory_bytes: 10308
<?php
//error_reporting(0);
$N = trim(fgets(STDIN));
//list($N,$K) = explode(" ",trim(fgets(STDIN)));
//$a = explode(" ",trim(fgets(STDIN)));
//$H = explode(" ",trim(fgets(STDIN)));

switch($N) {
case 25:
printf("Christmas\n");
break;
case 24:
printf("Christmas Eve\n");
break;
case 23:
printf("Christmas Eve Eve\n");
break;
case 22:
printf("Christmas Eve Eve Eve\n");
break;
}


Measured memory_bytes: 3828
#include<iostream>
#include<vector>
#include<array>
#include<string>
#include<map>
#include<utility>

using namespace std;

// N以下で先頭x,末尾yの整数の個数
int f(int N, int x, int y){
    int d, Nx, Ny, middle;
    Ny = N % 10;
    d = 0;
    int Nt = N;
    while(Nt>0){
        // cout << "N = " << N << endl;
        ++d;
        Nx = Nt;
        Nt /= 10;
    }
    // cout << "d = " << d << endl;
    int t = 1;
    for(int j=1;j<d;++j){
        t *= 10;
    }
    
    middle = (N - t * Nx - Ny) / 10; 
    
    int count = 0;
    int temp = 1;

    for(int i=1;i<=d;++i){
        if(i == 1){
            if( x == y and x <= N ){
                ++count;
            }
        }else if(i == 2){
            if( 10 * x + y <= N ){
                ++count;
            }
        }else if(2 < i and i < d){
            temp *= 10;
            count += temp;
        }else if(i==d){
            if( x == Nx ){
                if( y <= Ny ){
                    count += (middle + 1);
                }else{
                    count += middle;
                }
            }else if( x < Nx ){
                temp *= 10;
                count += temp;
            }
            
        }
        // cout << "i: " << i << " , count: " << count << endl; 
    }
   
    return count;
}


int main(){
    int N;
    cin >> N;
    int out = 0;
    
    for(int x=1;x<=9;++x){
        for(int y=1;y<=9;++y){
            // cout << x << " " << y << " " << f(N,x,y) << endl; 
            out += (f(N, x, y) * f(N, y, x));
                                                        
        }
    }
    
    cout << out << endl;
    
    return 0;
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, a, b) for(int i = a; i >= (b); --i)
#define trav(a, x) for(auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;





int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  
  ll n; cin >> n;
  if (n < 3) {
    cout << 0 ;
    return 0;
  } else if (n == 3) {
    cout << 1;
    return 0;
  }
  ll m = 1e9 + 7;
  vector<ll> dp(2005);
  dp[3] = dp[4] = dp[5] = 1;
  for (int i = 6; i <= n; i++) {
    dp[i] = 1;
    for (int j = i - 3; j >= 3; j--) {
      dp[i] = (dp[i] + dp[j]) % m;
    }
  }
  cout << dp[n];
  
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define inf 1000000007
#define fr first
#define sc second
#define eps 1e-9
#define clr(a) memset(a, 0, sizeof(a))
#define sz(x) x.size()
#define sni(x) scanf("%d",&x)
#define snl(x) scanf("%lld", &x)
#define snc(x) scanf("%c", &c);
#define rep(n) for(int i = 0 ; i < n ;i ++)
#define repc(i, n) for(int i = 0 ; i < n ; i ++)
#define FOR(i, x, y) for(int i = x ; i < y ; i ++)
#define DEC(i, x, y) for(int i = x ; i >= y ; i --)
#define all(v) v.begin(), v.end()
#define min3(a, b, c) min(a, min(b,c))
#define max3(a, b, c) max(a, max(b, c))
#define alla(a, n) a, a+n
using namespace std;
#define ll long long
 

int main() {
    ll a[32]={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};
    ll n;
    cin>>n;
    cout<<a[n-1];
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;
const int maxn = 200050;
typedef long long ll;

ll a[maxn];
int main()
{
    ll n;
    cin>>n;

    for(ll i=0; i<n; i++)
    {
        cin>>a[i];
        a[i] = a[i] - (i+1);
    }
    sort(a,a+n);


    ll total = a[n/2];
    ll t2 = a[n/2 + 1];
    ll t3 = a[n/2 - 1];
    ll ans = 0,ans2 = 0,ans3 = 0;
    for(ll i=0; i<n; i++)
    {
        ans += abs(a[i]-total);
        ans2 += abs(a[i]- t2);
        ans3 += abs(a[i]- t3);
    }
    cout<<min(min(ans,ans2),ans3)<<endl;

    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int a, b;

int gcd(int x, int y)
{
  if (y == 0) return x;
  if (x == 1) return 1;
  if (y == 1) return 1;
  if (x > y) return gcd(y, x % y);
  if (y > x) return gcd(x, y % x);
  return x;
}

int main()
{
  cin >> a;
  cin >> b;
  int c = gcd(a, b);
  cout << c << endl;
  return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=max(a, b)
#define chmin(a, b) (a)=min(a, b)
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;

/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/


 
int main(void) {
  ll i, j, k;
  
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  
  ll r=0;
  while(1) {
    
    if(r==0) {
      c-=b;
      
      if(c<=0) {
        pt("Yes");
        return 0;
      }
      
    }else {
      a-=d;
      
      if(a<=0) {
        pt("No");
        return 0;
      }
      
    }
    
    r=1-r;
    
  }
  
  
  
  
}
 
 


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;

	if (a <= 8 && b <= 8) {
		cout << "Yay!" << endl;
	}
	else {
		cout << ":(" << endl;
	}


	return 0;
}

Measured memory_bytes: 256