akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}

int main() {
  int n; cin >> n;
  vector<pair<int,int>> r(n), b(n);
  rep(i,n) cin >> r[i].first >> r[i].second;
  rep(i,n) cin >> b[i].first >> b[i].second;
  sort(ALL(r), greater<pair<int,int>>());
  sort(ALL(b), greater<pair<int,int>>());

  int ans = 0;

  rep(i, n) {
    int k = -1;
    int y = 201;
    rep(j, n) {
      if(r[i].first >= b[j].first) continue;
      if(r[i].second >= b[j].second) continue;
      if(y > b[j].second) {
        y = b[j].second;
        k = j;
      }
    }
    if(k==-1) continue;
    //printf("(%d %d) (%d %d)\n", r[i].first, r[i].second, b[k].first, b[k].second);
    ++ans;
    b[k].first = -1;
    b[k].second = -1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3596
"use strict"
function Main(input) {
  const splited = input.split('\n');
  const n = splited[0];
  const a = splited[1].split(' ');
  let oddFlag = false;
  let count = 0;

  outer:
  while (true) {
    for(let i = 0; i < n; i++) {
      if (a[i] % 2 !== 0 ) {
        oddFlag = true;
        break outer;
      }
      a[i] = a[i] / 2;
    }

    count++;
  }

  console.log(count);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21192
#include <stdio.h>

int main(){
   int n;
   scanf("%d",&n);
   int card[4][13]={{}};

   char str[2];
   int num;

   int i;
   for(i = 0; i < n ; i++){
       scanf("%s%d",str,&num);
       char ch = str[0];
       if(ch == 'S'){
           card[0][num-1] = 1;
       }
       if(ch == 'H'){
           card[1][num-1] = 1;
       }
       if(ch == 'C'){
           card[2][num-1] = 1;
       }
       if(ch == 'D'){
           card[3][num-1] = 1;
       }
   }


   for(i = 0; i < 13; i++){
       if(card[0][i] == 0){
           printf("S %d\n",i+1);
       }
   }

   for(i = 0; i < 13; i++){
       if(card[1][i] == 0){
           printf("H %d\n",i+1);
       }
   }

   for(i = 0; i < 13; i++){
       if(card[2][i] == 0){
           printf("C %d\n",i+1);
       }
   }

   for(i = 0; i < 13; i++){
       if(card[3][i] == 0){
           printf("D %d\n",i+1);
       }
   }

}


Measured memory_bytes: 2104
x1, y1, x2, y2 = map(int, input().split())
muki = x2 - x1
muki2 = y2 - y1
x3, y3, x4, y4 = 0, 0, 0, 0
ax = abs(muki)
ay = abs(muki2)
if muki > 0 and muki2 > 0:
    x3 = x2 - ay
    y3 = y2 + ax
    x4 = x3 - ax
    y4 = y3 - ay
elif muki > 0:
    x3 = x2 + ay
    y3 = y2 + ax
    x4 = x3 - ay
    y4 = y3 + ax
elif muki2 > 0:
    x3 = x2 - ay
    y3 = y2 - ax
    x4 = x3 + ax
    y4 = y3 - ay
else:
    x3 = x2 + ay
    y3 = y2 - ax
    x4 = x3 + ax
    y4 = y3 + ay

print(x3, y3, x4, y4)


Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

void jump(vector<int>& pos, vector<int> m){
    vector<int> prev = pos;
    for(int i=0;i<pos.size();i++){
        pos[i] = prev[m[i]];
    }
}

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

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

    vector<int> d(N-1), pos(N-1), m(N-1);
    for(int i=0;i<N-1;i++){
        d[i] = x[i+1] - x[i];
        pos[i] = i;
        m[i] = i;
    }

    int M;
    ll K;
    cin >> M >> K;

    for(int i=0;i<M;i++){
        int a;
        cin >> a;
        swap(m[a-2], m[a-1]);
    }

    while(K > 0){
        if(K % 2 == 1){
            jump(pos, m);
        }
        jump(m, m);
        K /= 2;
    }

    ll s = x[0];
    cout << s << endl;
    for(int i=0;i<N-1;i++){
        s += d[pos[i]];
        cout << s << endl;
    }
    assert(s == x[N-1]);

    return 0;
}

Measured memory_bytes: 3008
#include<bits/stdc++.h>
#define pii pair<int,int>
#define F first
#define S second
using namespace std;
const int maxn = 200005;
struct dsu{
	vector<int> fa , sz;
	dsu(int _n){
		fa.resize(_n+1) , sz.resize(_n+1);
		for(int i=0 ; i<=_n ; ++i){
			fa[i] = i;
			sz[i] = 1;
		}
	}
	void resize(int _n){
		fa.resize(_n+1) , sz.resize(_n+1);
		for(int i=0 ; i<=_n ; ++i){
			fa[i] = i;
			sz[i] = 1;
		}
	}
	int Find(int _x){
		if(_x == fa[_x]) return _x;
		return fa[_x] = Find(fa[_x]);
	}
	void Union(int _a, int _b){
		_a = Find(_a) , _b = Find(_b);
		if(_a == _b) return;
		if(sz[_a] < sz[_b]) swap(_a , _b);
		fa[_b] = _a;
		sz[_a] += sz[_b];
	}
	
};
dsu d(maxn);
int ans[maxn] , pos[maxn] , x[maxn] , y[maxn];
int main(){
	int n;  cin >> n ;
	for(int i=0 ; i<n ; ++i){
		cin >> x[i] , cin >> y[x[i]];
		pos[x[i]] = i;
	}
	stack<pii , vector<pii> > stk;
	for(int i=1 ; i<=n ; ++i){
		if(stk.empty() || stk.top().S>y[i]){
			stk.push({i,y[i]});
			continue;
		}
		pii TOP = stk.top();
		while(stk.size() && stk.top().S < y[i]) d.Union(stk.top().F , i) , stk.pop();
		stk.push(TOP);
	}
	for(int i=1 ; i<=n ; ++i){
		int fa = d.Find(i); // father of i
		int sz = d.sz[fa]; // size of x
		ans[pos[i]] = sz;
	}
	for(int i=0 ; i<n ; ++i) cout << ans[i] << '\n';
}

Measured memory_bytes: 8104
#from statistics import median
import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
#from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
alpha = [0] * (ord('z') - ord('a') + 1)
for i in range(n):
    s = input()
    dic = collections.Counter(s)
    if i == 0:
        for k,v in dic.items():
            alpha[ord(k)-ord('a')] += v
    else:
        for alnum in range(ord('z') - ord('a')+1):
            alstr = chr(ord('a') + alnum)
            if alstr in dic.keys():
                alpha[ord(alstr)-ord('a')] = min(dic[alstr],alpha[ord(alstr)-ord('a')])
            else:
                alpha[ord(alstr)-ord('a')] = 0
ans = ""
for i in range(ord('z') - ord('a')+1):
    if alpha[i] != 0:
        ans += chr(ord('a') + i) * alpha[i]
print(ans)


Measured memory_bytes: 3316
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


from bisect import bisect_left

n, q = li()

stx = [list(li()) for _ in range(n)]
d = [ni() for _ in range(q)]

stx.sort(key=lambda x: x[2])

ans = [-1]*q
skip = [-1]*q

for si, ti, xi in stx:
    left = bisect_left(d, si-xi)
    right = bisect_left(d, ti-xi)

    while left < right:
        if skip[left] == -1:
            ans[left] = xi
            skip[left] = right
            left += 1

        else:
            left = skip[left]

print(*ans, sep="\n")

Measured memory_bytes: 77336
#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#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>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
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;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  int x, n;
  cin >> x >> n;
  vector<bool> visit(200);
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    visit[x] = true;
  }
  int best = INF, best_i = -1;
  for (int i = 0; i < 200; ++i) {
    if (visit[i]) continue;
    if (best > abs(i - x)) {
      best = abs(i - x);
      best_i = i;
    }
  }
  cout << best_i << endl;

  return 0;
}


Measured memory_bytes: 3204
#include <stdio.h>
#include <stdbool.h>

int l;
int sr[10]={0};
int min[10];
int mi=0,ma=0,ci=0;
int memo[20];
bool ch=0;

int main(void){
  int i,j,n,k=0;

  while(1){
    scanf("%d %d",&memo[0],&l);
    if(memo[0]+l==0)break;
    k=1;
    while(1){
      for(i=0;i<10;i++)sr[i]=0;
      mi=0;
      ma=0;
      ci=0;
      n=memo[k-1];
      for(i=0;i<l;i++){
	sr[n%10]++;
	n/=10;
      }
      for(i=0;i<10;i++){
	for(j=ci;j<ci+sr[i];j++)min[j]=i;
	ci+=sr[i];
      }
      j=1;
      for(i=0;i<l;i++){
	mi+=min[l-1-i]*j;
	ma+=min[i]*j;
	j*=10;
      }
      for(i=0;i<k;i++){
	if(memo[i]==ma-mi){
	  printf("%d %d %d\n",i,ma-mi,k-i);
	  ch++;
	  break;
	}
	if(i==k-1){
	  memo[k]=ma-mi;
	  k++;
	  break;
	}
      }
      if(ch==1){
	ch=0;
	break;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 2064
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int x,d,ans=0,e;
    cin >> x;
    e=x/500;
    ans=ans+e*1000;
    //cout <<ans;
    d=(x%500)/5;
    //cout << d;
    ans=ans+d*5;
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n=ni()
c = [1 if _ == 'R' else 0 for _ in input()]
b = sum(c)

w=0
r=0

for i in range(n):
  if c[i] == 0 and i < b:
    r+=1
  if c[i] == 1 and i >= b:
    w+=1
 

print(max(w,r))




Measured memory_bytes: 10940
#include "bits/stdc++.h"

// Begin Header {{{
using namespace std;

#ifndef DEBUG
#define dump(...)
#endif

#define all(x) x.begin(), x.end()
#define rep(i, n) for (intmax_t i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (intmax_t i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (intmax_t i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

constexpr size_t    operator""_zu(unsigned long long value) { return value; };
constexpr intmax_t  operator""_jd(unsigned long long value) { return value; };
constexpr uintmax_t operator""_ju(unsigned long long value) { return value; };

constexpr int INF = 0x3f3f3f3f;
constexpr intmax_t LINF = 0x3f3f3f3f3f3f3f3f_jd;

template <class T>
using MaxHeap = priority_queue<T, vector<T>, less<T>>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

template <class T>
inline void input(vector<T> &vec) {
    for (auto &e: vec) {
        cin >> e;
    }
}

template <class T>
inline void input(vector<vector<T>> &mat) {
    for (auto &vec: mat) {
        input(vec);
    }
}

inline void print() { cout << "\n"; }
template <class Head, class... Tail>
inline void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) {
        cout << ' ';
    }
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<<(ostream &strm, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e: vec) {
        strm << e << delim[&e == &vec.back()];
    }
    return strm;
}

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

template <class Func>
class FixPoint : Func {
public:
    explicit constexpr FixPoint(Func&& f) noexcept : Func(forward<Func>(f)) {}

    template <class... Args>
    constexpr decltype(auto) operator()(Args&&... args) const {
        return Func::operator()(*this, std::forward<Args>(args)...);
    }
};

template <class Func>
static inline constexpr decltype(auto) makeFixPoint(Func&& f) noexcept {
    return FixPoint<Func>{forward<Func>(f)};
}

template <class T>
inline bool chmax(T &a, const T &b) noexcept {
    return b > a && (a = b, true);
}

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

template <class T>
inline T diff(const T &a, const T &b) noexcept {
    return a < b ? b - a : a - b;
}
// }}}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    var(size_t, N);
    vector<intmax_t> a(N); input(a);
    print(accumulate(all(a), 0_jd) - N);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
typedef long long ll;
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[n];
    rep(i,0,n-1) cin>>a[i];
    sort(a,a+n);
    int ans=0;
    ans = a[n-1] - a[0];
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#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

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

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


	int N = getint(), T = getint();

	int kotae = T;
	int mae = 0;
	rep(i, N) {
		int t = getint();
		kotae += min(t - mae, T);
		mae = t;
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

void swap(int *a, int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}


int bubbleSort(int A[],int N) {
    int i,j;
    int sw = 0;
    unsigned short flag = 1;
    for(i=0;flag;i++) {
        flag = 0;
        for(j=N-1;j>=i+1;j--) {
            if(A[j]<A[j-1]) {
                swap(&A[j],&A[j-1]);
                flag = 1;
                sw++;
            }
        }
    }
    return sw;
}

int main(void) {
    int i, A[100], N, sw;
    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&A[i]);

    sw = bubbleSort(A,N);

    for(i=0;i<N;i++) {
        if (i) printf(" ");
        printf("%d",A[i]);
    }
    printf("\n%d\n",sw);

    return 0;
}


Measured memory_bytes: 2096
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;
ll mod = 1e9 + 7;

using namespace std;



int main()

{
	string A,B;

	cin >> A >> B;
	
	if (A.size() > B.size())
	{
		cout << "GREATER" << endl;
	}
	else if (A.size() < B.size())
	{
		cout << "LESS" << endl;
	}
	else
	{
		if (A > B)
		{
			cout << "GREATER" << endl;
		}
		else if (A < B)
		{
			cout << "LESS" << endl;
		}
		else cout << "EQUAL" << endl;
	}


	return 0;
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define RFOR(i, b, a) for (ll i = b; i >= a; --i)
#define ALL(x) x.begin(), x.end()
#define DEBUG(args...) { string _s = #args; replace(ALL(_s), ' ', '\0');\
replace(ALL(_s), ',', ' ');\
stringstream _ss(_s); istream_iterator<string> _it(_ss); _debug(_it, args);}
#define endl "\n"
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)

using namespace std;
using namespace __gnu_pbds;

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

void _debug(istream_iterator<string>) {}
template<typename T, typename... Args>
void _debug(istream_iterator<string> it, T first, Args... args) {
    cerr << ">> " << *it << " : " << first << endl; _debug(++it, args...);
}
template <typename T1, typename T2>
inline ostream& operator << (ostream& out, const pair<T1, T2>& p) {
    return out << "(" << p.F << ", " << p.S << ")";
}
template<typename T>
inline ostream& operator << (ostream& out, const vector<T>& v) {
    if (v.empty()) return out << "[]";
    else { out << '['; for (auto& e : v) { out << e << ", "; } return out << "\b\b]"; }
}
template<typename T>
inline ostream& operator << (ostream& out, const set<T>& s) {
    if (s.empty()) return out << "{}";
    else { out << '{'; for (auto& e : s) { out << e << ", "; } return out << "\b\b}"; }
}
template<typename T>
inline ostream& operator << (ostream& out, const unordered_set<T>& s) {
    return out << set<T>(ALL(s));
}
template<typename T1, typename T2>
inline ostream& operator << (ostream& out, const map<T1, T2>& m) {
    if (m.empty()) return out << "{}";
    out << '{'; for (auto& p : m) { out << p << ", "; } return out << "\b\b}";
}
template<typename T1, typename T2>
inline ostream& operator << (ostream& out, const unordered_map<T1, T2>& m) {
    return out << map<T1, T2>(ALL(m));
}
template<typename T>
inline ostream& operator << (ostream& out, const ordered_set<T>& s) {
    return out << set<T>(ALL(s));
}

typedef long long ll;
typedef long double ld;
typedef vector<long long> vll;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef unordered_map<ll, ll> STll;
/************************************** MAIN PROGRAM ********************************************/

int main()
{
    //freopen("input.txt", "r", stdin);
    SPEED
    ll n, k;
    cin >> n >> k;
    ll cnt = (n + 1) / 2;
    if (cnt >= k) cout << "YES" << endl;
    else cout << "NO" << endl;
}
/************************************** END OF PROGRAM ******************************************/


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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;


int main() {
    int n, k;
    cin >> n >> k;
    vector<int>a(n);
    rep(i, 0, n)cin >> a[i];
    rep(i, 0, k){
        vector<int>b(n+10, 0);
        rep(j, 0, n){
            int l = max(0, j-a[j]);
            int r = min(n-1, j+a[j]);
            b[l]++;
            b[r+1]--;
        }
        rep(j, 1, n){
            b[j] += b[j-1];
        }
        bool p = true;
        rep(j, 0, n){
            if(b[j]!=a[j])p = false;
            a[j] = b[j];
        }
        if(p)break;
    }
    rep(i, 0, n)cout << a[i] << " ";
    cout << endl;
}

Measured memory_bytes: 4848
#include <iostream>

int A, B, K, L, R;

void out(char c1, int c2, int l, int r, int order) {
	static char buf[1 << 20 | 1], bt;
	bt = 0;
	for (int i = l; i <= r; ++i)
		buf[++bt] = i % (K + 1) ? c1 : c2;
	if (order == 1)
		for (int i = 1; i <= bt; ++i) putchar(buf[i]);
	else
		for (int i = bt; i >= 1; --i) putchar(buf[i]);
}

int main() {
//	freopen("code.in", "r", stdin);
//	freopen("code.out", "w", stdout);

	int cases;
	scanf("%d", &cases);
	while (cases--) {
		scanf("%d%d%d%d", &A, &B, &L, &R);
		K = std::max((A - 1) / (B + 1), (B - 1) / (A + 1)) + 1;
		int l = 0, r = A + B, m, u, v, w;
		while (l < r) {
			m = l + r + 1 >> 1,
			u = m / (K + 1), v = (A + B - m) / (K + 1),
			w = u * K + m % (K + 1) + v;
			if (w != A)
				w > A ? (r = m - 1) : (l = m);
			else
				m % (K + 1) == 0 && (A + B - m) % (K + 1) == K ? (r = m - 1) : (l = m);
		}
		m = l;
		if (L <= m)
			out('A', 'B', L, std::min(m, R), 1);
		if (R > m)
			out('B', 'A', A + B - R + 1, A + B - std::max(L, m + 1) + 1, -1);
		putchar('\n');
	}
	return 0;
}


Measured memory_bytes: 384
#include <cstdio>

int main(){
    int n;
    scanf("%d",&n);
    bool array[4][13];
    for(int i = 0;i < 4;i++){
        for(int j = 0;j < 13;j++){
        array[i][j] = false;
        }
    }
    for(int i = 0;i < n;i++){
        char a;
        scanf("\n%c",&a);
        int x;
        scanf("%d",&x);
        if(a == 'S'){
            array[0][x - 1] = true;}
        else if(a == 'H'){
            array[1][x - 1] = true;}
        else if(a == 'C'){
            array[2][x - 1] = true;}
        else if(a == 'D'){
            array[3][x - 1] = true;}
    }
        char (Llor[4]) = {'S','H','C','D'};
        for(int i = 0;i < 4;i++){
            for(int j = 0;j < 13;j++)
            if(!array[i][j]){
                printf("%c %d\n",Llor[i],j + 1);
            }
        }
    return 0;
    }


Measured memory_bytes: 2672
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<math.h>
#include<map>
typedef long long int ll;
using namespace std;
#define maxn 0x3f3f3f3f
const int mm=1e6;
ll d[mm];
ll vis[mm];
ll dd[2000+50][2000+50]; 
int main()
{
	ll i,j,n,m,k,kk,kkk; k=0;kk=maxn;
	 scanf("%lld%lld%lld",&n,&m,&kkk);
	for(i=1;i<=n;i++)
	{
	d[i]=i;dd[i][i]=1;}
	dd[m][kkk]=dd[kkk][m]=1;
	for(i=1;i<=n;i++)
	for(j=i+1;j<=n;j++)
	{
	if(dd[i][j]==0)
	{
	 k=(abs(m-i)+1+abs(kkk-j));
	 kk=(abs(kkk-i)+1+abs(m-j));k=min(k,kk);
	dd[i][j]=min(abs(d[i]-d[j]),k);}
	if(dd[j][i]==0)
	{
	 k=(abs(m-j)+1+abs(kkk-i));
	 kk=(abs(kkk-j)+1+abs(m-i));k=min(k,kk);
	dd[j][i]=min(abs(d[j]-d[i]),k);}
    }
	for(i=1;i<=n;i++)
	for(j=i+1;j<=n;j++)
	{
		vis[dd[i][j]]++;
	}
	for(i=1;i<=n-1;i++)
	printf("%lld\n",vis[i]);

}

Measured memory_bytes: 37120
// 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(size_t i = 0; i < (n); ++i)

int main()
{
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll ac = a * c;
    ll bc = b * c;
    ll ad = a * d;
    ll bd = b * d;

    ll m1 = max(ac, bc);
    ll m2 = max(ad, bd);
    ll ans = max(m1, m2);
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3596
D = int(input())
C = list(map(int, input().split()))
S = []
for _ in range(D):
    ver = list(map(int,input().split()))
    S.append(ver)
d = 0
last = [0 for _ in range(26)]

t = []
for d in range(1, D+1):
    dc = [C[i]*(d-last[i]) for i in range(26)]
    best = []
    for i in range(26):
        if_i = dc[i]
        best.append(if_i)
    t.append(best.index(max(best))+1)
    #indexの要素の重複を考えない
    last_i = best.index(max(best))
    last[last_i] += d
for t_i in t:
    print(t_i)

Measured memory_bytes: 9380
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            while (sc.hasNextDouble()) {
                double a = sc.nextDouble();
                double b = sc.nextDouble();
                double c = sc.nextDouble();
                double d = sc.nextDouble();
                double e = sc.nextDouble();
                double f = sc.nextDouble();
                double x;
                double y;
                y = (a*f-c*d)/(a*e-b*d);
                x = (c-b*y)/a;
                System.out.printf("%.3f %.3f\n",x,y);
            }
        }
    }
}


Measured memory_bytes: 28460
#include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ユニークなvectorにする。連続した値を除去して切り出す。
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  vector<ll> X;

  rep(i, N) {
    ll xi;
    cin >> xi;
    X.pb(xi);
  }

  ll cost = 0;
  rep(i, N - 1) {

    ll length = X[i + 1] - X[i];
    ll walkCost = length * A;
    ll tpCost = B;

    if (walkCost > tpCost) {
      cost += tpCost;
    } else {
      cost += walkCost;
    }
  }

  cout << cost << endl;
}


Measured memory_bytes: 1400
from sys import exit
# N = int(input())
# a = [int(input()) for _ in range(N)]
S = str(input())
L = len(S)
cnt = 0
num0 = 0
num1 = 0
ans = L
for i in range(0,L-1):
    if S[i] != S[i+1]:
        ans = min(ans,max(i+1,L-(i+1)))
print(ans)


Measured memory_bytes: 3188
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(ALL(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

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

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    int i = 0, j = 0;
    for(i = 0; i < SZ(s); i++){
        if(j < SZ(t) && s[i] == t[j]){
            j++;
        }
    }
    string p1, p2;
    p1 = s;
    p2 = t.substr(j);
    if(SZ(p1 + p2) >= n){
        cout << SZ(p1 + p2);
    }else{
        int mor = n - SZ(p1 + p2);
        cout << SZ(p1 + p2) + mor;
    }
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

Measured memory_bytes: 256
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)

Measured memory_bytes: 6724
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<cstring>
#include<functional>
#include<bits/stdc++.h>
#include<map>
#include<utility>
#include<queue>

typedef long long ll;
#define vec2c vector<vector<char>>
#define vec2i vector<vector<int>>
#define vecc vector<char>
#define vecs vector<string>
#define veci vector<int>
#define vecd vector<double>
#define vecl vector<long>
#define vecll vector<long long>
#define rep(i, n) for(int i=0; i < (int)(n); i++)
#define rrep(i, n) for(int i=(int)(n); i>=0;i--)
#define rep1e(i, n) for(int i=1; i <= (int)(n); i++)
#define rep1ne(i, n) for(int i=1; i < (int)(n); i++)
#define pqi priority_queue<int>
#define pqll priority_queue<ll>
#define pqi_ priority_queue<int, vector<int>, greater<int>>
#define pqll_ priority_queue<ll, vector<ll>, greater<ll>>

#define MAX 100010

using namespace std;

unsigned digit(unsigned num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  rep(i, N) {
    int a;
    cin >> a;
    mp[a] = i + 1;
  }
  for(auto const& it : mp) {
    cout << it.second << " ";
  }
  return 0;
}

Measured memory_bytes: 5504
def check():
    N = int(input())
    S = input()
    S = S[1:]+S[0]
    animal = ['W', 'S']
    
    for a in animal:
        for b in animal:
            #print(a,b)
            pre, nex = a, b
            answer = [a,b]
            for i in range(N):
                if (nex == 'S' and S[i] == 'o') or (nex=='W'and S[i] == 'x'):
                    tmp = nex
                    nex = pre
                    pre = tmp
                    answer.append(nex)
                else:
                    tmp = nex
                    nex = 'W'if pre == 'S' else 'S'
                    pre = tmp
                    answer.append(nex)
            if nex == b and pre == a:
                return answer[:-2]
    else:
        return -1

ans = check()               
if type(ans) == int:
    print(ans)
else:
    print(''.join(ans))

Measured memory_bytes: 4880
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[333][333];
char s[333][333];
int main(){
    int n, m, k;
    while(cin>>n>>m>>k){
        ll ans=0;
        for(int i=0; i<n; ++i){
            scanf("%s",s[i]);
        }
        memset(a, -1, sizeof a);
        int kk=0;
        for(int i=0; i<n; ++i){
            for(int j=0; j<m; ++j){
                if(s[i][j]=='#'){
                    a[i][j]=++kk;
                }
                else{
                    if(j-1>=0){
                        a[i][j]=a[i][j-1];
                    }
                }
            }
            for(int j=m-1; j>=0; --j){
                if(j+1<m && a[i][j]==-1){
                    a[i][j]=a[i][j+1];
                }
            }
        }
        assert(kk==k);
        for(int i=0; i<n; ++i){
            for(int j=0; j<m; ++j){
                if(i-1>=0 && a[i][j]==-1){
                    a[i][j]=a[i-1][j];
                }
            }
        }
        for(int i=n-1; i>=0; --i){
            for(int j=0; j<m; ++j){
                if(i+1<n && a[i][j]==-1){
                    a[i][j]=a[i+1][j];
                }
            }
        }
        for(int i=0; i<n; ++i){
            for(int j=0; j<m; ++j){
                printf("%d ",a[i][j]);
            }
            cout<<endl;
        }
    }
  return 0;
}




Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var < (end); var++)
#define RFOR(var, begin, end) for (int var = (begin) - 1; var >= (end); var--)
#define REP(var, length) FOR(var, 0, length)
#define RREP(var, length) RFOR(var, length, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)

const ll MOD = 1e9 + 7;

void solve(istream& cin, ostream& cout) {
  int h, w;
  int a, b;
  cin >> h >> w >> a >> b;

  int s = 0;
  REP(i, h) {
    if (i == b) {
      s ^= 1;
    }
    REP(j, w) {
      if (j < a) {
        cout << s;
      } else {
        cout << (s ^ 1);
      }
    }
    cout << endl;
  }
}

#ifndef TEST
int main() {
  solve(cin, cout);
}
#endif


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

using namespace std;
const int INF = 1001001001;
vector<int> to[100005]; //行き先

int main(void) {
	int N, M;
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		--A;
		--B; //部屋番号を1ずらす
		to[A].push_back(B);
		to[B].push_back(A);
	}
	//スタートからの深さ探索
	queue<int> q; //調べる予約リスト
	vector<int> dist(N, INF);
	vector<int> pre(N, -1);
	dist[0] = 0; 
	q.push(0);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int u : to[v]) { //部屋vにつながる部屋をすべて調べる
			if (dist[u] != INF) continue;
			dist[u] = dist[v] + 1;
			pre[u] = v;
			q.push(u);
		}
	}

	//道しるべ記入
	cout << "Yes" << endl;
	for (int i = 0; i < N; i++) {
		if (i == 0) continue;
		int ans = pre[i];
		++ans;
		cout << ans << endl;
	}
}

Measured memory_bytes: 10096
#include<cstdio>
#include<iostream>
#include<queue>
using namespace std;

const int INF=100000000;
typedef pair<int, int> P;

int n,h,w;
char maze[1111][1111];
int d[1111][1111];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int sy,sx;
int gy,gx;

int bfs();
int main(){

  int cnt=0;
  int num='0';
  char g,s;
  
  
  scanf("%d %d %d",&h,&w,&n);
  for(int i=0;i<h;i++){
    scanf("%s",maze[i]);
    for(int j=0;j<w;j++){
      if(maze[i][j]=='S'){
	sx=i;
	sy=j;
      }
      else if(maze[i][j]=='1'){
	g='1';
	gx=i;
	gy=j;
      }
    }
  }

  cnt+=bfs();
  // printf("%c=%d\n",g,cnt);

  for(int k=1;k<n;k++){
    s=g;
    sx=gx;
    sy=gy;
    g++;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	
	if(maze[i][j]==g){
	  gy=j;
	  gx=i;
	  break;
	}
      }
      if(maze[gy][gx]==g) break;
    }
    cnt+=bfs();
    // printf("%c=%d\n",g,cnt);
  }

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

int bfs(){
  queue<P> que;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      d[i][j]=INF;
    }
  }

  que.push(P(sx,sy));
  d[sx][sy]=0;

  while(que.size()){
    P p=que.front();
    que.pop();
    if(p.first==gx && p.second==gy){
      // printf("gx=%d gy=%d\n",gx,gy);
      break;
    }

    for(int i=0;i<4;i++){
      int nx=p.first+dx[i],ny=p.second+dy[i];
      if(0<=nx && nx<h && 0<=ny && ny<w && maze[nx][ny]!='X' && d[nx][ny]==INF){
	que.push(P(nx,ny));
	d[nx][ny]=d[p.first][p.second]+1;
      }
    }

  }
  /*
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(d[i][j]==INF){
	printf("  0");
      }else{
	printf("%3d",d[i][j]);
      }
    }
    printf("\n");
    }*/

  return d[gx][gy];
}

Measured memory_bytes: 6644
#include<bits/stdc++.h>
#define ll long long
#define F(i,a,b) for(ll i=a;i<b;i++)
#define RF(i,a,b) for(ll i=a;i>b;i--)
#define pii pair<ll,ll>
#define ff first
#define ss second
#define pb(x) push_back(x)
#define pob pop_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007
#define w(t) int t; cin>>t;while(t--)
using namespace std;
const int inf=(int)1e9;
char flip_bits(char c){return (c == '0')? '1': '0';}

int smallestDivisor(int n) 
{ 
    // if divisible by 2 
    if (n % 2 == 0) 
        return 2; 
  
    // iterate from 3 to sqrt(n) 
    for (int i = 3; i * i <= n; i += 2) { 
        if (n % i == 0) 
            return i; 
    } 
  
    return n; 
} 
int main()
{
    
    ios::sync_with_stdio(0);   
    cin.tie(0);   
  	ll n;
  cin>>n;
 
  ll ans=n%10;
  if(ans==2||ans==4||ans==5||ans==7||ans==9)
  {
    cout<<"hon";
  }
  else if(ans==0||ans==1||ans==6||ans==8)
  {
    cout<<"pon";
  }
  else
  {
    cout<<"bon";
  }
return 0;
}

Measured memory_bytes: 3536
# coding: utf-8
ranknum,goal = list(map(int,input().split()))
probnum = [0]*ranknum
bonus = [0]*ranknum
compscore = [0]*ranknum

for i in range(ranknum):
    probnum[i], bonus[i] = list(map(int,input().split()))
    #各ランクをコンプした場合に得られる得点をcompscoreに格納しておく。
    compscore[i] = 100*(i+1)*probnum[i] + bonus[i]

from itertools import product
from math import ceil

#得点Gを達成する最小の問題正解数minprobを初期化。前提により必ず1000以下になるので、1001で初期化しておく。
minprob = 1001

#各ランクの問題をコンプするか否かの2^ranknum通りをループ処理する。
for c in product(range(2),repeat=ranknum):
    score = 0
    solvedprob = 0
    notcompedindex = -1

    #コンプした問題について、得点をcompscoreに、正解数をsolvedprobnumに格納する。
    for i in range(ranknum):
        if c[i] == 1:
            score +=  compscore[i]
            solvedprob +=  probnum[i]
        #コンプされていないランクのインデックスのうち最大のものをnotcompedindexに格納しておく。
        else:
            notcompedindex = i

    #コンプした問題だけでgoalに達さず、かつ、コンプしていない最高ランクの問題をコンプ寸前まで解けばゴールに達する場合、
    #ゴールをぎりぎり達成するところまで正解した状態へと、scoreとsolvedprobを更新する。
    if score < goal and score+100*(notcompedindex+1)*(probnum[notcompedindex]-1) >= goal:
        solvedprob += ceil((goal - score)/(100*(notcompedindex+1)))
        score += ceil((goal - score)/(100*(notcompedindex+1)))*100*(notcompedindex+1)
    
    #最終的にゴールを達成している場合、正解数が暫定最小ならば、それをminprobに格納しておく。
    if score >= goal:
        minprob = min(minprob, solvedprob)  

print(minprob)

# print(ranknum)
# print(goal)
# print(problemnum)
# print(bonus)
# print(completescore)




Measured memory_bytes: 41200
H = gets.chomp.to_i
W = gets.chomp.to_i
N = gets.chomp.to_i

if H < W then
  h, w = [W, H]
else
  h, w = [H, W]
end
_h = h
_w = w
n = N

while _w != 0 && n > 0 do
  n -= h
  _w -= 1
end

while _h != 0 && n > 0 do
  n -= w
  _h -= 1
end

puts (h - _h) + (w - _w)

Measured memory_bytes: 1788
N = int(input())
L = list(map(int, input().split()))
ans = 0

for i in range(N):
  for j in range(N):
    for k in range(N):
      if L[i] < L[j] < L[k]:
        if L[i] + L[j] > L[k]:
          ans += 1

print(ans)

Measured memory_bytes: 73520
N = int(input())
A = [int(x) for x in input().split()]
flag = True
swap = 0
while flag:
    flag = False
    for i in range(N-1,0,-1):
        if A[i-1] > A[i]:
            A[i-1], A[i] = A[i], A[i-1]
            swap += 1
            flag = True
            # break
print(" ".join(map(str,A)))
print(swap)


Measured memory_bytes: 5604
#include <iostream>
#include <vector>
#include <map>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;


int main(){
  int n;
  cin >> n;
  ll ans = 0;
  rep(i, n){
    ll a;
    cin >> a;
    while(a%2 == 0 && a != 0){
      ans++;
      a/=2;
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 888
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($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, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

    ($next:expr, parser) => {
        $next
    };

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

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
    }

    if a == b && b != c || a == c && b != c || b == c && a != b {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

char field[1010][1010];
int sum[1010][1010];

int main() {
  int n;
  while (scanf("%d", &n), n) {
    REP(i, n) {
      scanf("%s", field[i]);
    }
    MEMSET(sum, 0);
    REP(y, n) {
      REP(x, n) {
        sum[y + 1][x + 1] = sum[y + 1][x] + sum[y][x + 1] - sum[y][x];
        if (field[y][x] == '*') {
          sum[y + 1][x + 1]++;
        }
      }
    }
    int ans = 0;
    REP(y, n) {
      REP(x, n) {
        int l = ans;
        int r = min(n - y, n - x);
        while (l < r) {
          int m = (l + r) / 2;
          int nx = x + m;
          int ny = y + m;
          int total = sum[ny][nx] - sum[ny][x] - sum[y][nx] + sum[y][x];
          if (total == 0) {
            ans = m;
            l = m + 1;
          } else {
            r = m;
          }
        }
        int m = l;
        int nx = x + m;
        int ny = y + m;
        int total = sum[ny][nx] - sum[ny][x] - sum[y][nx] + sum[y][x];
        if (total == 0) { ans = max(ans, m); }
      }
    }
    printf("%d\n", ans);
  }
}

Measured memory_bytes: 5644
# Your code here!
my @coms = ('AC', 'WA', 'TLE', 'RE');
my @vals = (0, 0, 0, 0);
my $n = <>;
for( $i = 0; $i < $n; $i ++ )
{
    my $tm = <>;
    chomp($tm);
    for( $j = 0; $j < 4; $j ++ )
    {
        if( $coms[$j] eq $tm )
        {
            $vals[$j] ++;
            last;
            
        }
    }
    
}

for( $j = 0; $j < 4; $j ++ )
{
    print("$coms[$j] x $vals[$j]\n");
}

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

int main(){
    int H , W;
    while(cin>>H>>W,!(H==0&&W==0)) {
        for(int h = 0; h < H; h++){
            for(int w = 0; w < W; w++){
                int a = h + w;
                if(a % 2 == 0){
                    cout << "#";
                }else{
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3104
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int H = scan.nextInt();
			int W = scan.nextInt();

			if(H == 0 && W == 0){
				break;
			}
			for(int i = 0; i < H; i++){
				String str = "";
				for(int j = 0; j < W; j++){
					str += "#";
				}
				System.out.println(str);
			}
			System.out.println();
		}
	}
}

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

#define Fast            ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define fWrite          freopen ("out.txt","w",stdout);
#define TC              int t;cin >> t;FOR(tc,1,t)
#define LL              long long
#define ULL             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define all(a)          a.begin(),a.end()
#define MEM(a,x)        memset(a,x,sizeof(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)

#define Make(x,p)       (x  (1<<p))
#define DeMake(x,p)     (x & ~(1<<p))
#define Check(x,p)      (x & (1<<p))
#define popcount(x)     __builtin_popcount(x)

const int N=2e5+5;
int h[N],a[N];
LL tree[N],dp[N];

LL query(int idx){
    LL sum=0;
    for(; idx>0; idx &= idx + 1,idx--)
        sum=max(tree[idx],sum);
    return sum;
}
void update(int idx,LL val,int n){
    for(; idx<=n; idx |= idx + 1)
        tree[idx]=max(val,tree[idx]);
}

int main()
{
    int n;
    cin >> n;
    FOR(i,1,n) cin >> h[i];
    FOR(i,1,n) cin >> a[i];
    LL ans=0;
    for(int i=1;i<=n;i++){
        dp[i]=query(h[i]-1)+a[i];
        update(h[i],dp[i],n);
        ans=max(ans,dp[i]);
    }
    cout << ans;
}


Measured memory_bytes: 4992
import Control.Monad
import Data.Maybe
import Data.List
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map.Strict as M

main = abc164c

abc164c = do
    [n] <- getIntList
    s <- getBSNList n
    let dict = genDict s M.empty
    print $ M.size dict

genDict [] m = m
genDict (s:ss) m
    | M.member s m = genDict ss m
    | otherwise = genDict ss (M.insert s 1 m)

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine
getBSNList n = map BS.words <$> replicateM (fromIntegral n) BS.getLine

Measured memory_bytes: 90640