akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
 
void mul(ll &x, ll y){
	x *= y;
	// if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}
bool cmp(pii a, pii b){
	return a.S < b.S;
}
void solve()
{
	int n;
	cin >> n;
	pii a[n];
	rep(i, n) cin >> a[i].F >> a[i].S;
	sort(a, a + n, cmp);
	int time = 0;
	bool ok = 1;
	rep(i, n){
		time += a[i].F;
		if(time > a[i].S) ok = 0;
	}
	cout << (ok ? "Yes" : "No");
}


 
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1e9+7
#define PI acos(-1.0)
#define ll long long

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  int N;cin>>N;
  int ans=0;
  int A[100001]={};
  REP(i,N){
    int a;cin>>a;
    if(a>100000){
      ans++;
    }else if(a<=100000){
      A[i]=a;
    }
  }
  sort(A,A+N);
  for(int j=1;j<=100000;j++){
    int t1=lower_bound(A,A+N,j)-A;
    int t2=upper_bound(A,A+N,j)-A;
    int t=t2 - t1;
    if(t>0 &&t>=j){
      ans+=t-j;
    }else{
      ans+=t;
    }
  }
  P(ans);
  return 0;
}


Measured memory_bytes: 640
#include<stdio.h>

int main(){
  long int N;
  long int q;
  long int r;
  scanf("%li",&N);
  int ans[1000],tail=0;
  if(N==0) printf("0");
  else{
  while(1){
    if(N<0 && (-N)%2!=0 ){
      q=((-N+1)/2);
      r=1;
    }
    else {
      q=N/(-2);
      r=N%(-2);
    }
    ans[tail]=r;
    tail++;
    N=q;
    if(N==1) break;
  }
  printf("1");
  tail--;
  for (; tail >= 0; tail--) {
    printf("%d",ans[tail] );
  }
}
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
    int n;
    cin >> n;
    ll a[n];
    ll dp1[n];
    ll dp2[n];
    for(int i = 0; i < n; i++){
        ll x;
        cin >> x;
        a[i] = x;
        dp1[i] = 0;
        dp2[i] = 0;
    }
    dp1[0] = a[0];
    for(int i = 1; i < n; i++){
        dp1[i] = dp1[i-1] + a[i];
    }
    dp2[n-1] = a[n-1];
    for(int i = n-2; i >= 0; i--){
        dp2[i] = dp2[i+1] + a[i];
    }
    ll ans = 2000000001LL;
    for(int i = 0; i < n-1; i++){
        ans = min(ans, abs(dp1[i] - dp2[i+1]));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
 
 
 
 
int main(){
    int N;
    int L[110];
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> L[i];

    sort(L, L + N, greater<int>());
    int a = L[0];
    int p = 0;

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

    if (a < p) {cout << "Yes" << endl;}
    else {cout << "No" << endl;}

  
  }
 

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

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

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

void solve(const int small, const int big) {
    if ((big - small) % 2 == 0){
        cout <<  ((big - small) / 2 + small) << endl;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }
}

int main(void) {
    int A, B;
    cin >> A >> B;

    if (A < B) {
        solve(A, B);
    } else {
        solve(B, A);
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
// #include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <bitset>
using namespace std;
typedef long long LL;
typedef double db;
const int oo=2139063143;
const int N=55;
const db eps=1e-7;
#define pritnf printf
//char buf[1<<22],*p1=buf,*p2=buf,obuf[1<<22],*O=obuf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <typename T>
inline void sc (T &x)
{
    x=0; static int p; p=1; static char c; c=getchar();
    while (!isdigit(c)) { if (c=='-') p=-1; c=getchar(); }
    while ( isdigit(c)) { x=(x<<1)+(x<<3)+(c-48); c=getchar(); }
    x*=p;
}
template <typename T>
inline void print (T x)
{
    if (x< 0) putchar('-'),x=-x;
    if (x>=10) print(x/10);
    putchar(x%10+'0');
}
template <typename T>
inline void pr (T x) { print(x),putchar('\n'); }
template <typename T1,typename T2>
void chkmax (T1 &A,T2 B) { A=A>=B?A:B; }
template <typename T1,typename T2>
void chkmin (T1 &A,T2 B) { A=A<=B?A:B; }
struct LY { LL c; int w,las; }a[N];
int n,X,D,fa[N],m;
LL f[N*N*N];
void update (LL c,int w)
{
	for (int i=m; i>=w; i--)
		chkmin (f[i],f[i-w]+c);
}
int main ()
{
    // freopen (".in","r",stdin);
    // freopen (".out","w",stdout);
	sc(n),sc(X),sc(D);
	for (int i=1; i<=n; i++)
	{
		sc(a[i].c); a[i].w=1,a[i].las=i==1?1e9:D;
		if (i> 1) sc(fa[i]);
	}
	for (int i=n; i> 1; i--)
		a[fa[i]].c+=a[i].c,a[fa[i]].w+=a[i].w;
	m=n*n*n;
	memset (f,31,sizeof (LL)*(m+1));
	f[0]=0;
	int nd=min (n,D);
	for (int i=1; i<=n; i++)
	{
		int las=nd;
		for (int j=1; j<=las; j<<=1)
			update (a[i].c*j,a[i].w*j),las-=j;
		if (las) update (a[i].c*las,a[i].w*las);
	}
	sort (a+1,a+n+1,[](LY A,LY B) { return A.w*B.c> B.w*A.c; });
	int ans=0;
	for (int i=0; i<=m; i++) if (f[i]<=X)
	{
		int las=X-f[i],g=0;
		for (int j=1; j<=n; j++)
		{
			int h=min ((LL)a[j].las-nd,las/a[j].c);
			g+=h*a[j].w,las-=h*a[j].c;
		}
		chkmax (ans,i+g);
	}
	pr(ans);

    return 0;
}


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

const int inf = 1000005;
const int maxn = 302;

int n, m, ans, mx_cnt, mx_sport;
int a[maxn][maxn], pos[maxn], cnt[maxn];
bool rem[maxn];

signed main () {
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; ++i) {
		pos[i] = 1;
		for (int j = 1; j <= m; ++j)
			scanf("%d", &a[i][j]);
	}
	ans = inf;
	for (int w = 1; w <= m; ++w) {
		memset(cnt, 0, sizeof(cnt));
		mx_cnt = mx_sport = 0;
		for (int i = 1; i <= n; ++i) {
			++cnt[a[i][pos[i]]];
			if (mx_cnt < cnt[a[i][pos[i]]]) 
				mx_cnt = cnt[a[i][pos[i]]], mx_sport = a[i][pos[i]];
		}
		ans = min(ans, mx_cnt);
		if (w != m) {
			rem[mx_sport] = 1;
			for (int i = 1; i <= n; ++i) {
				while (rem[a[i][pos[i]]])
					++pos[i];
			}
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 4140
pub 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()
}

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

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let nk: Vec<usize> = read_vec();
    let n = nk[0];
    let k = nk[1] as u32;
    let xyv: Vec<Vec<i64>> = read_vec2(n);
    let mut xy: Vec<(i64, usize, i64, usize)> = vec![];
    for i in 0..n {
        xy.push((xyv[i][0], 0, xyv[i][1], 0));
    }
    xy.sort_by(|a, b| (a.0).partial_cmp(&b.0).unwrap());
    let mut xaxis: Vec<i64> = vec![0; n + 1];
    for i in 0..n {
        xy[i].1 = i + 1;
        xaxis[i + 1] = xy[i].0;
    }
    xy.sort_by(|a, b| (a.2).partial_cmp(&b.2).unwrap());
    let mut yaxis: Vec<i64> = vec![0; n + 1];
    for i in 0..n {
        xy[i].3 = i + 1;
        yaxis[i + 1] = xy[i].2;
    }

    let mut cnt: Vec<Vec<u32>> = vec![vec![0; n + 1]; n + 1];
    let mut map: Vec<Vec<bool>> = vec![vec![false; n + 1]; n + 1];

    for i in 0..n {
        map[xy[i].1][xy[i].3] = true;
    }

    for i in 1..n + 1 {
        for j in 1..n + 1 {
            cnt[i][j] = cnt[i - 1][j] + cnt[i][j - 1] - cnt[i - 1][j - 1];
            if map[i][j] {
                cnt[i][j] += 1;
            }
        }
    }

    let mut ans: u64 = 4000000000000000000;
    for ix0 in 1..n + 1 {
        for iy0 in 1..n + 1 {
            for ix1 in ix0 + 1..n + 1 {
                for iy1 in iy0 + 1..n + 1 {
                    let c = cnt[ix1][iy1] + cnt[ix0 - 1][iy0 - 1]
                        - cnt[ix0 - 1][iy1]
                        - cnt[ix1][iy0 - 1];
                    if c != k {
                        continue;
                    }
                    let x = (xaxis[ix1] - xaxis[ix0]) as u64;
                    let y = (yaxis[iy1] - yaxis[iy0]) as u64;
                    let tmp = x * y;
                    if tmp < ans {
                        ans = tmp;
                    }
                }
            }
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, r, s, p;
  string t;
  cin >> n >> k >> r >> s >> p >> t;
  int score = 0;
  for(int i = 0; i < k; ++i) {
    char prev = '\0';
    for(int j = i; j < t.size(); j+=k) {
      if(t[j] != prev) {
        // 価値
        switch(t[j]) {
          case 'r': score += p; break;
          case 's': score += r; break;
          case 'p': score += s; break;
        }
        prev = t[j];
      } else {
        // あいこ、負け
        prev = '\0';
      }
    }
  }
  cout << score << endl;
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=n;i<N;i++)
#define p(S) cout<<S<<endl
using namespace std;

int main(){
	long long int n,m;
	//	while(cin>>n>>m,n){
	cin>>n>>m;
	long long int ans=0;
	if(2*n>=m){
		ans=m/2;
	}else{
		ans=n;
		m-=2*n;
		ans+=m/4;
	}
	p(ans);
	//	}
	return 0;
}



Measured memory_bytes: 256
# -*- coding: utf-8 -*-


def insertion_sort(seq, l):
    print(' '.join([str(n) for n in seq]))
    for i, v in enumerate(seq[1:], start=1):
        left = i - 1
        while left >= 0 and seq[left] > v:
            seq[left], seq[left+1] = seq[left+1], seq[left]
            left -= 1
        print(' '.join([str(n) for n in seq]))


def to_int(v):
    return int(v)


def to_seq(v):
    return [int(c) for c in v.split()]


if __name__ == '__main__':
    l = to_int(input())
    seq = to_seq(input())

    insertion_sort(seq, l)

Measured memory_bytes: 7748
n,a,b = map(int,input().split())

if abs(b-a)%2==0:
    print(abs(b-a)//2)
elif abs(b-a)%2==1:
    lst = [a-1,n-b]
    if lst[0]>lst[1]:
        print((n-b+1)+(n-(a+(n-b+1)))//2)
    elif lst[0]<lst[1]:
        print((a-1+1)+(b-a-1)//2)
    elif lst[0]==lst[1]:
        print((a-1+1)+(b-a-1)//2)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

int main(int argc, char *argv[]) {
  i64 H;
  cin >> H;
  i64 ans = 0, ct = 1;
  while(H != 1) {
    ans += ct;
    ct *= 2;
    H /= 2;
  }
  ans += ct;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int add(int x,int y){return x+y<mod?x+y:x+y-mod;}
void ade(int& x,int y){x+=y;if(x>=mod)x-=mod;}
int qpow(int x,int k)
{
    int r=1;
    while(k)
    {
        if(k&1)r=1ll*r*x%mod;
        k>>=1;x=1ll*x*x%mod;
    }
    return r;
}
int n;
int a[200200];
int d[200200];
int D[200200];

struct Node{
    int sum,cnt;
    Node operator + (const Node &o)const{
        Node res;
        res.sum=add(sum,o.sum);
        res.cnt=cnt+o.cnt;
        return res;
    }
    Node operator - (const Node &o)const{
        Node res;
        res.sum=add(sum,mod-o.sum);
        res.cnt=cnt-o.cnt;
        return res;
    }
};
struct Bit{
    Node C[2000200];
    int lb(int x){return x&(-x);}
    void ins(int x,Node v)
    {
        while(x<=n)C[x]=C[x]+v,x+=lb(x);
    }
    void clear(int x){while(x<=n)C[x]=(Node){0,0},x+=lb(x);}
    Node ask(int x)
    {
        Node r;r.sum=r.cnt=0;
        while(x)r=r+C[x],x-=lb(x);
        return r;
    }
    Node query(int l,int r){return ask(r)-ask(l-1);}
}bit;
struct B2{
    int C[2000200];
    int lb(int x){return x&(-x);}
    void ins(int x){while(x<=n)C[x]++,x+=lb(x);}
    int ask(int x)
    {
        int r=0;
        while(x)r+=C[x],x-=lb(x);
        return r;
    }
    int query(int l,int r){return ask(r)-ask(l-1);}
}b2;

int pos[200200];
bool cmp(int x,int y){return a[x]<a[y];}
int zero[200200];
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;++i)
        scanf("%d",&a[i]),d[a[i]]++,pos[i]=i;
    for(int i=n;i;--i)d[i]+=d[i+1];
    int S=1;
    D[0]=1;
    for(int i=1;i<=n;++i)
    {
        d[i]=max(0,d[i]-n+i);
        int tmp=1ll*(d[i]-1)*qpow(d[i],mod-2)%mod;
        if(!tmp)zero[i]=zero[i-1]+1,D[i]=D[i-1];
        else zero[i]=zero[i-1],D[i]=1ll*D[i-1]*tmp%mod;
        S=1ll*S*d[i]%mod;
    }
    if(!S){puts("0");return 0;}

    sort(pos+1,pos+n+1,cmp);
    int p,ans=0;
    int mul,sum;
    int inv2=qpow(2,mod-2);
    Node cur;
    for(int i=1,la=1;i<=n;++i)
    {
        p=pos[i];//a[p]从小到大插入p
        if(zero[a[p]]-zero[a[pos[i-1]]])//i和上一个之间有0
        {
            for(int j=la;j<i;++j) bit.clear(pos[j]);
            la=i;
        }
        mul=1ll*S*D[a[p]]%mod;
        cur=bit.query(1,p-1);
        ade(ans,1ll*cur.sum*mul%mod*inv2%mod);

        cur=bit.query(p+1,n);
        ade(ans,1ll*b2.query(p+1,n)*S%mod);
        ade(ans,mod-1ll*cur.sum*mul%mod*inv2%mod);
        bit.ins(p,(Node){qpow(D[a[p]],mod-2),1});
        b2.ins(p);
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 11264
#include <stdio.h>
#include <cstdio>
#include <string>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>


int main()
{

	std::string str;
	std::string newstr;

	std::cin >> str;
	std::cin >> newstr;

	if (str[0] == newstr[2] && str[1] == newstr[1] && str[2] == newstr[0])
	{
		printf("YES\n");
	}
	else
	{
		printf("NO\n");
	}

	return 0;
}

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

int main(){
    vector<int> v;
    int ans = 0;
    int z = 10;
    for(int i=0;i<5;i++){
        int tmp;
        cin >> tmp;
        if(tmp%10 == 0){
            ans += tmp;
        }else{
            ans += tmp + 10 - (tmp%10);
            z = min(z,tmp%10);
        }
    }

    cout << ans-10+z << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <inttypes.h>

int main(void) {
	uint64_t N, P;
	int mikakosi = 0, i;
	uint64_t asumi[256];
	uint64_t iguti[256];
	uint64_t mizuhasu, mamegu;
	uint64_t mikisinn, sinntasu;
	if (scanf("%" SCNu64 "%" SCNu64, &N, &P) != 2) return 1;
	for (mizuhasu = 2, mamegu = P; mizuhasu * mizuhasu <= mamegu; mizuhasu++) {
		if (mamegu % mizuhasu == 0) {
			uint64_t tomatu = 0;
			while (mamegu % mizuhasu == 0) {
				tomatu++;
				mamegu /= mizuhasu;
			}
			asumi[mikakosi] = mizuhasu;
			iguti[mikakosi] = tomatu;
			mikakosi++;
		}
	}
	if (mamegu > 1) {
		asumi[mikakosi] = mamegu;
		iguti[mikakosi] = 1;
		mikakosi++;
	}

	sinntasu = 1;
	for (i = 0; i < mikakosi; i++) {
		uint64_t minngosu = iguti[i] / N;
		for (mikisinn = 0; mikisinn < minngosu; mikisinn++) sinntasu *= asumi[i];
	}
	printf("%" PRIu64 "\n", sinntasu);

	return 0;
}


Measured memory_bytes: 1740
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void strInit(char str[]);//str[]を0で初期化
void extIntStr(char str[],int data[]);//str[]から数値(int)を抽出しdata[]に順次格納
void incsort(int data[],int len);//data[]を昇順ソート
void decsort(int data[],int len);//data[]を降順ソート
void printIntArray(int data[],int len);//data[]をprint
int* inputArray(int n);//文字列を受け取り数値を抽出、n個の数値(int)を格納した配列のポインタをreturn
int* cpyArray(int data[],int len);//配列(int)を複製した配列のポインタをreturn

//don't forget free(data);

int main(){
    char str[4];
    char weat[4];
    scanf("%s ",str);
    scanf("%s",weat);
    int j=0;
    for(int i=0;i<3;i++){
        if(str[i]==weat[i])j++;
    }
    printf("%d",j);
}

//temp##############################################

void strInit(char str[]){
    int len=strlen(str);
    for(int i=0;i<len;i++){
        str[i]=0;
    }
}

void extIntStr(char str[],int data[]){
    int length=strlen(str);
    str[length-1]=' ';
    char buff[12];
    int j,index;
    index=j=0;
    for(int i=0;i<length;i++){
        if(str[i]!=' '){
            buff[j++]=str[i];
        }else{
            data[index++]=atoi(buff);
            strInit(buff);
            j=0;
        }
    }
}

void incsort(int data[],int len){
    for(int i=0;i<len-1;i++){
        for(int j=i+1;j<len;j++){
            if(data[i]>data[j]){
                int tmp=data[i];
                data[i]=data[j];
                data[j]=tmp;
            }
        }
    }
}

void decsort(int data[],int len){
    for(int i=0;i<len-1;i++){
        for(int j=i+1;j<len;j++){
            if(data[i]<data[j]){
                int tmp=data[i];
                data[i]=data[j];
                data[j]=tmp;
            }
        }
    }
}

void printIntArray(int data[],int len){
    for(int i=0;i<len;i++){
        printf("%d\n",data[i]);
    }
}

int* inputArray(int n){
    int *data;
    data=(int*)malloc(sizeof(int)*n);
    char *get;
    get=(char*)malloc(sizeof(char)*11*n+1);
    fgets(get,11*n+1,stdin);
    extIntStr(get,data);
    free(get);
    return data;
}

int* cpyArray(int data[],int len){
    int *cp;
    cp=(int*)malloc(sizeof(int)*len);
    for(int i=0;i<len;i++){
        cp[i]=data[i];
    }
    return cp;
}

//temp##############################################


Measured memory_bytes: 128
#include <iostream>
#include <set>

int main() {
	std::set<std::string> list_of_items;
	long number_of_items;
	std::cin >> number_of_items;
	std::string item;
	long count = 0;
	for (int i = 0; i < number_of_items; ++i) {
		std::cin >> item;
		auto it = list_of_items.insert(item);
		if(it.second) {
			count += 1;
		}
	}
	std::cout << count << std::endl;
	return 0;
}

Measured memory_bytes: 15712
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



int main(){
  string s;
  cin >> s;
  s.push_back(0);

  vector<int> l;
  vector<int> r;
  int cnt = 0;
  REP(i,s.size()-1){
    cnt++;
    if(s[i] != s[i+1]){
      if(s[i] == '<') l.push_back(cnt);
      else r.push_back(cnt);
      cnt = 0;
    }
  }
  //
  // for(auto x: l) cout << x << " ";
  // cout<< endl;
  // for(auto x: r) cout << x << " ";
  // cout << endl;

  if(l.empty()){
    ll a = r[0];
    cout << (a+1)*a/2;
    return 0;
  }

  if(r.empty()){
    ll a = l[0];
    cout << (ll)(a+1)*a/2;
    return 0;
  }

  ll sum = 0;
  if(s[0] == '>'){
    int a = r[0];
    sum += (ll)a*(a+1)/2;
    r.erase(r.begin());
  }


  if(r.size() < l.size()) {
    r.push_back(0);
  }
  //
  // for(auto x: l) cout << x << " ";
  // cout<< endl;
  // for(auto x: r) cout << x << " ";
  // cout << endl;

  REP(i,l.size()){
    int a = l[i];
    int b = r[i];
    if(b > a) swap(a,b);
    b--;
    sum += (ll)a*(a+1)/2 + b*(b+1)/2;
  }

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 4916
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x,y,z) max((x),max((y),(z)))
#define tmin(x,y,z) min((x),min((y),(z)))
typedef long long ll; ll MM = 1000000000;ll mod = MM + 7; ll MMM=9223372036854775807;//2^63 -1
ll GCD(ll x, ll y) {if (y == 0) return x;else return GCD(y, x % y);}
ll LCM(ll x, ll y) { return x / GCD(x, y) * y;}
//cout << fixed << setprecision(10);

int main(){
    ll n,ans=MMM; cin>>n;
    vector<ll> v(n);
    rep(i,n) cin>>v[i];
    sort(all(v));
    for(ll i=v[0];i<=v[n-1];i++){
        ll sum=0;
        rep(j,n){
            sum+=(v[j]-i)*(v[j]-i);
        }
        ans=min(ans,sum);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solveA();
		// new Main().solveB();
		// new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String a = "0";
		String b = "0";

		try {
			scanner = new Scanner(System.in);
			a = scanner.next();
			b = scanner.next();

			BigDecimal aB = new BigDecimal(a);
			BigDecimal bB = new BigDecimal(b);

			BigDecimal res = aB.add(bB);

			System.out.println(res.divide(new BigDecimal("2"), 0, RoundingMode.HALF_UP));

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int lineAB = 0;
		int lineBC = 0;
		int lineCA = 0;

		try {
			scanner = new Scanner(System.in);
			lineAB = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

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

int main() 
{
    int n;
    ll k;
    cin >> n >> k;
    vector<pair<int, ll>> x(n);
    for (int i = 0; i < n; i++)
        cin >> x[i].first >> x[i].second;
    sort(begin(x), end(x));

    int i = 0;
    while (i < n && k > 0ll) {
        if (k > x[i].second) {
            k -= x[i].second;
            i++;
        }
        else {
            cout << x[i].first << endl;
            break;
        }
    }
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

int main(){
    ll n, c;
    cin >> n >> c;
    vector<ll> x(n),v(n);
    vector<ll> cv(n,0),anticv(n,0);
    vector<ll> cvm(n,0),anticvm(n,0);
    for(int i = 0; i < n; i++){
        cin >> x[i] >> v[i];
    }
    cv[0] = v[0];
    anticv[0] = v[n-1];
    for(int i = 1; i < n; i++){
        cv[i] = cv[i-1] + v[i];
        anticv[i] = anticv[i-1] + v[n-1-i];
    }
    for(int i = 0; i < n; i++){
        cv[i] -= x[i];
        anticv[i] -= c-x[n-1-i];
    }
    cvm[0] = cv[0]; anticvm[0] = anticv[0];
    for(int i = 1; i < n; i++){
        cvm[i] = max(cvm[i-1],cv[i]);
        anticvm[i] = max(anticvm[i-1],anticv[i]);
    }

    ll cv_max = cvm[n-1];
    ll acv_max = anticvm[n-1];
    ll ans = max(cv_max, acv_max);

    if(ans < 0){
        cout << "0" << endl;
        return 0;
    }

    ll t;
    for(int i = 0; i < n-1; i++){
        t = anticv[i] - (c-x[n-1-i]) + cvm[n-2-i];
        ans = max(ans, t);
    }
    for(int i = 0; i < n-1; i++){
        t = cv[i] - (x[i]) + anticvm[n-2-i];
        ans = max(ans, t);
    }


    cout << ans << endl;

    return 0;

}


Measured memory_bytes: 7040
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
#include <climits>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<PII> VPI;
typedef vector<PLL> VPL;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound

int main(){
  int D;
  cin>>D;
  VL C(26);
  rep(i,26) cin>>C[i];
  VVL S(D,VL(26));
  rep(i,D) rep(j,26) cin>>S[i][j];
  VL T(D);
  rep(i,D){
    ll X=0;
    rep(j,26) if(S[i][X]<S[i][j]) X=j;
    T[i]=X+1;
  }
  ll ans=0;
  VL L(26);
  rep(i,D){
    ll tmp=0;
    L[T[i]-1]=i+1;
    rep(j,26) tmp+=C[j]*(i+1-L[j]);
    ans+=S[i][T[i]-1]-tmp;
  }
  
  vector< set<ll> > X(26);
  rep(i,D) X[T[i]-1].insert(i+1);
  rep(i,26) X[i].insert(0);
  rep(i,26) X[i].insert(D+1);
  int M=1000000;
  VI d(M),q(M);
  rep(i,M) d[i]=rand()%D+1;
  rep(i,M) q[i]=rand()%26+1;
  int cnt=0;
  int PRV,NXT;
  rep(i,M){
    ll ans2=ans;
    int prv=T[d[i]-1];
    int nxt=q[i];
    auto itr=ub(all(X[prv-1]),d[i]);
    ll tmp=*itr;
    itr--;
    itr--;
    T[d[i]-1]=q[i];
    auto itr2=ub(all(X[nxt-1]),d[i]);
    ll tmp2=*itr2;
    itr2--;
    ans=ans-S[d[i]-1][prv-1]-C[prv-1]*(d[i]-*itr)*(tmp-d[i]);
    X[prv-1].erase(d[i]);
    ans=ans+S[d[i]-1][nxt-1]+C[nxt-1]*(d[i]-*itr2)*(tmp2-d[i]);
    X[nxt-1].insert(d[i]);
    if(ans<ans2){
      T[d[i]-1]=prv;
      X[prv-1].insert(d[i]);
      X[nxt-1].erase(d[i]);
      ans=ans2;
    }
  }
  rep(i,D) cout<<T[i]<<endl;
}


Measured memory_bytes: 11152
#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cstdio>
#include<math.h>
#include<stack>
#include<vector>
#include<map> 
#define maxn 1005
#define INF 1000000007
typedef long long ll;
typedef unsigned long long ull;
using namespace std;


int main()
{
	int x;
	cin>>x;
	ll ans=0;
	ans+=1000*(x/500);
	x%=500;
	ans+=5*(x/5);
	cout<<ans<<endl;
	return 0;
}

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

int main() {
	int W,a,b;
	cin >> W >> a >> b;
	if ((a + W) < b) {
		cout << b - (a + W) << endl;
	}
	else if ((b + W) < a) {
		cout << a - b - W << endl;
	}
	else {
		cout << 0 << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
 

const ll Modulus = 1e9 + 7;

template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % Modulus;
        x = x*x % Modulus;
        n = n >> 1;
    }
    return ans;
}

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

    modint<Modulus> sub1 = 1, sub2 = 1;
    ll all = mpow(2, n) - 1;
    rep(i, a) {
        sub1 = sub1 * (n - i);
    }
    rep(i, b) {
        sub2 *= (n - i);
    }
    rep(i, a) {
        sub1 /= i+1;
    }
    rep(i, b) {
        sub2 /= i+1;
    }
    ll ans = (sub1 + sub2).a;
    cout << (all - ans + 2*Modulus)%Modulus << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <limits>

using namespace std;

int main (int argc, char* argv[]) {
	int n, m;
	cin >> n >> m;
	vector<int> imos(n + 1);
	for (int i = 0; i < m; i++) {
		int l, r;
		cin >> l >> r;
		imos[l - 1]++;
		imos[r]--;
	}
	int c = 0;
	int res = 0;
	for (int i = 0; i < n; i++) {
		c += imos[i];
		if (c == m) {
			res++;
		}
	}
	cout << res << endl;
}


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

int main()
{
    long long n,k,i,j,t;


   cin>>n;
   while(n>0)
   {
       n=n-1000;
   }
   cout<<-n<<endl;




return 0;

}



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

int main(void) {
    long int ac_count = 0, wa_count = 0, tle_count = 0, re_count = 0;
    
    int N;
    string result;
    cin >> N;
    
    while (N--) {
        cin >> result;
        if (result == "AC")
            ac_count++;
        else if (result == "WA")
            wa_count++;
        else if (result == "TLE")
            tle_count++;
        else if (result == "RE")
            re_count++;
    }
    cout << "AC x " << ac_count << endl;
    cout << "WA x " << wa_count << endl;
    cout << "TLE x " << tle_count << endl;
    cout << "RE x " << re_count << endl;
    
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <stdio.h>
using namespace std;

static const int MAX_COUNT = 100;
static int R[MAX_COUNT];



int BubleSort(int* A, int n)
{
	int cnt = 0;
	int flg = 1;
	int tmp;

	for (int i = 0; flg; i++)
	{
		flg = 0;

		for (int j = n - 1; j > i; j--)
		{
			if (*(A + j - 1) > *(A + j))
			{
				tmp = *(A + j);
				*(A + j) = *(A + j - 1);
				*(A + j - 1) = tmp;
				flg = 1;
				cnt++;
			}
		}
	}

	return cnt;
}


int main()
{
	int n;
	int i;
	int ret;


	cin >> n;

	if (n > MAX_COUNT)
		return -1;

	for (i = 0; i < n; i++)
	{
		cin >> R[i];
	}


	ret = BubleSort(R, n);


	for (i = 0; i < n-1; i++)
	{
		printf("%d ", R[i]);
	}
	printf("%d\n%d\n", R[i], ret);

	return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using ll = long long;
using p = pair<int,int>;
int main(int argc, const char * argv[]) {



    cin.tie(0);
    ios::sync_with_stdio(false);

    int a,b;
    cin>>a>>b;
    if(b%a==0)cout<<a+b<<endl;
    else cout<<b-a<<endl;

    return 0;
}


Measured memory_bytes: 3564
import java.io.PrintWriter;
import java.util.*;

public class Main {
		public static void main(String[] args) {
			Scanner stdin = new Scanner(System.in);
			PrintWriter out = new PrintWriter(System.out);
			
			int N = Integer.parseInt(stdin.next());
			int H[] = new int[N];
			int flag;
			if(N==1) {
				flag=1;
			}
			else {
				flag=0;
			}
			
			for(int i=0;i<N;i++) {
				H[i] = Integer.parseInt(stdin.next());
			}
			
			for(int i=N-1;i>0;i--) {
				if(H[i-1]-H[i] > 1) {
					flag=0;
					break;
				}
				else if(H[i] < H[i-1]){
					H[i-1] -= 1;
				}
			}

			
			for(int i=0;i<N-1;i++) {
				if(H[i] <= H[i+1]) {
					flag =1;
				}
				else {
					flag=0;
					break;
				}
			}
				
			if(flag==1) {
				out.println("Yes");
			}
			else {
				out.println("No");
			}
			
			out.flush();
	}
}




Measured memory_bytes: 48744
#include<bits/stdc++.h>
using namespace std;
int n,a,b;
int main(){
  cin>>n;
  vector<int> v(n);
  for(auto& i:v)cin>>i;
  sort(v.begin(),v.end(),greater<>());
  for(int i=0;i<n;++i)(i%2?b:a)+=v[i];
  cout<<a-b;
}

Measured memory_bytes: 256
/*
    Problem 79
    https://atcoder.jp/contests/abc106/tasks/abc106_d
*/
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
/* global variables */
/* function */
/* main */
int main(){
    int N, M, Q;
    cin >> N >> M >> Q;
    vector<vector<int> > train(N, vector<int>(N));
    int L, R;
    for (int i = 0; i < M; i++) {
        cin >> L >> R;
        L--; R--;
        train[L][R]++;
    }
    vector<vector<int> > sum(N + 1, vector<int>(N + 1));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            sum[i+1][j+1] = sum[i][j+1] + sum[i+1][j] - sum[i][j] + train[i][j];
        }
    }
    int p, q;
    for (int i = 0; i < Q; i++) {
        cin >> p >> q;
        p--;
        int ans = sum[q][q] - sum[p][q] - sum[q][p] + sum[p][p];
        cout << ans << '\n';
    }
}


Measured memory_bytes: 2944
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;

bool debug = false;
int v[2][12];

bool isFinished(int n){
  for(int i=0;i<n;i++){
	if(v[0][i] != v[1][i]) return false;
  }
  return true;
}

int main(void){
  int n;
  while(cin >> n && n){
	int prv = 0, cur = 1;
	int tmp;
	int times = 0;
	
	memset(v, -1, sizeof(v));
	for(int i=0;i<n;i++){
	  cin >> tmp;
	  v[prv][i] = tmp;
	}

	while(!isFinished(n)){
	  for(int i=0;i<n;i++){
		int app=0;
		tmp = v[prv][i];
		for(int j=0;j<n;j++){
		  if(v[prv][j] == tmp) app++;
		}
		v[cur][i] = app;
		if(debug) cout << v[cur][i] << " ";
	  }
	  if(debug) cout << endl;
	  cur = 1 - cur;
	  prv = 1 - prv;
	  times++;
	}
	cout << times - 1 << endl;
	for(int i=0;i<n-1;i++){
	  cout << v[cur][i] << " ";
	}
	cout << v[cur][n-1] << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;

int main(){
    ll n,k; cin >> n >> k ;
    vector<ll> a(n);
    rep(i,n) cin >> a.at(i);

    vector<bool> ans(1e5+1,0);

    for(int i=a.at(0);i<=1e5;i++){
        bool lose = true; //1つでもfalseがあれば勝ちなのでfalseにする、全部trueなら負けなのでtrue

        for(int j=0;j<n;j++){
            if(i-a.at(j)<0) continue;
            if(!ans.at(i-a.at(j))) lose=false;
        }

        if(!lose) ans.at(i)=1;
    }
    if(ans.at(k)){
        cout << "First" << endl;
    }else{
        cout << "Second" << endl;
    }
}

Measured memory_bytes: 256
from itertools import combinations
import numpy as np

n,m,x = map(int, input().split())
q = [np.array(list(map(int, input().split()))) for _ in range(n)]
L=[]
for i in range(1,n+1):
    for j in list(combinations(q,i)):
        S = np.sum(j, axis=0)
        if all([k >= x for k in S[1:]]):
            L.append(S[0])

if len(L) >0:
    print(min(L))
else:
    print(-1)


Measured memory_bytes: 27672
A, B = [int(ab) for ab in input().split()]
S = input()
N = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
for i in range(A+B):
  if i == A and S[i] == "-":
    continue
  elif i != A and S[i] in N:
    continue
  else:
    print("No")
    break
else:
  print("Yes")

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

void fnPrimeNumber(const vector<int> &argviNum, int &argiPrimeCnt)
{
  for (int i = 0; i < argviNum.size(); i++)
  {
    bool bPrimeNo = true;
    if (argviNum[i] > 2  &&  argviNum[i] % 2 == 0)
      bPrimeNo = false;
    else
    {
      double dSqrt = sqrt((double)argviNum[i]);
      int iMaxDivisor = (int)dSqrt;

      for (int iDivisor = 2; iDivisor <= iMaxDivisor; iDivisor++)
      {
        if (argviNum[i] % iDivisor == 0)
        {
          bPrimeNo = false;
          break;
        }
      }
      if (bPrimeNo) argiPrimeCnt++;
    }
  }
}

int main()
{
  vector<int> viNum;
  int iMaxSize;
  int iPrimeCnt = 0;
  
  cin >> iMaxSize;
  for (int i = 0; i < iMaxSize; i++)
  {
    int iNum;
    cin >> iNum;
    viNum.push_back(iNum);
  }

  fnPrimeNumber(viNum, iPrimeCnt);
  cout << iPrimeCnt << endl;

  return 0;
}

Measured memory_bytes: 1320
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
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 pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

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

Measured memory_bytes: 3080
import java.io.*;
 
public class Main {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        String[] cut = input.split(" ");
        int noOne = Integer.parseInt(cut[0]);
        int noTwo = Integer.parseInt(cut[1]);
        
        if(noOne < noTwo) {
            System.out.println("a < b");
        }else if(noOne > noTwo) {
            System.out.println("a > b");
        }else {
            System.out.println("a == b");
        }
    }
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

int main() {
  int n;
  cin >> n;
  vector<int> b(n);
  rep(i, n) cin >> b[i];

  vector<int> ans;
  rep(i, n) {
    int idx = -1;
    rep(j, sz(b)) {
      if (b[j] == j + 1) idx = j;
    }
    if (idx == -1) {
      cout << "-1" << endl;
      return 0;
    }
    vector<int> tmp;
    rep(j, sz(b)) if (j != idx) tmp.eb(b[j]);
    b = tmp;
    ans.eb(idx + 1);
  }

  reverse(all(ans));

  rep(i, n) cout << ans[i] << endl;
}


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

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}
void readC(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=rdsp;foreach(ref v;t)pick(r,v[i]);}}

void main()
{
  int n; readV(n);
  real[] x; string[] u; readC(n, x, u);

  auto s = real(0);
  foreach (xi, ui; lockstep(x, u))
    s += xi * (ui == "JPY" ? 1.0 : 380000.0);

  writefln("%.6f", s);
}


Measured memory_bytes: 256
import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i=0; i<n; i++) a[i] = sc.nextInt();
		int m = sc.nextInt();
		int[] b = new int[m];
		for (int i=0; i<m; i++) b[i] = sc.nextInt();
		
		for (int i=0; i<Math.min(n,m); i++) {
			if (a[i] < b[i]) {
				System.out.println(1); return;
			}
			else if (a[i] > b[i]) {
				System.out.println(0); return;
			}
		}
		
		System.out.println(a.length<b.length?1:0);
		
	}
}


Measured memory_bytes: 32324
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long int n, d;
  cin >> n >> d;
  vector<long int> x(n);
  vector<long int> y(n);
  for(long int i = 0; i < n; i++) cin >> x[i] >> y[i];
  long int ans = 0;
  for(long int i = 0; i < n; i++){
    long int p = x[i]*x[i]+y[i]*y[i];
    long int q = d*d;
    if(p <= q) ans++;
  }
  cout << ans << endl;
}

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

int A;
int B;
int ans;

void solve() {
  for (int i = A; i <= B; ++i) {
    string s = to_string(i);
    string s_r = s;
    reverse(s_r.begin(), s_r.end());
    if (s == s_r) ans++;
  }
  cout << ans << endl;
}

int main() {
  cin >> A >> B;
  solve();
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
 //Compiler version g++ 6.3.0

 int main()
 {
 	string a, b;
 	cin >> a >> b;
 	
 	a += b;
 	
 	const char *pf = a.c_str();
 	
 	float f = atof(pf);
 	
 	f = sqrt(f);
 	
 	int i = f;
 	
 	if(i == f){
 		cout << "Yes" << endl;
 	}else{
 		cout << "No" << endl;
 	}
 	
 	return 0;
 }

Measured memory_bytes: 256
n,W = map(int,input().split())
table = [[0]*(W+1) for _ in range(n+1)]
for i in range(n):
  w,v = map(int,input().split())
  for k in range(W+1):
    if k < w:
      table[i+1][k] = table[i][k]
    else:
      table[i+1][k] = max(table[i][k],table[i][k-w]+v)

print(table[n][W])
  
  

Measured memory_bytes: 119916
// A - Frog 1
#include <bits/stdc++.h>
using namespace std;

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

	int ha, hb, hc; cin>>ha>>hb;
	int a=0, b, c; b = c = abs(ha-hb);
	// cout<<a<<","<<b<<","<<c<<"\n";

	for(int i=2; i<n; i++){
		cin>>hc;
		c = min(a + abs(hc-ha), b + abs(hc-hb));
		a = b; b = c;
		ha = hb; hb = hc;
		// cout<<a<<","<<b<<","<<c<<"\n";
	}
	cout<< c <<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cctype>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn=200010,MOD=1000000007;
int read(){
    char c;int s=0,t=1;
    while(!isdigit(c=getchar()))if(c=='-')t=-1;
    do{s=s*10+c-'0';}while(isdigit(c=getchar()));
    return s*t;
}
struct cyc{
    int z0,z1,z2;
};
cyc operator + (cyc a,cyc b){
    cyc c;
    c.z0=1ll*a.z0*b.z0%MOD;
    c.z1=(1ll*a.z0*b.z1+1ll*a.z1*b.z0)%MOD;
    c.z2=(1ll*a.z0*b.z2+1ll*a.z2*b.z0+1ll*a.z1*b.z1+1ll*a.z2*b.z2+1ll*a.z1*b.z2+1ll*a.z2*b.z1)%MOD;
    return c;
}
vector<cyc>a[maxn];
int n,fa[maxn],first[maxn],cnt=0,tot=0,b[maxn];
struct edge{int v,from;}e[maxn*2];
void insert(int u,int v){cnt++;e[cnt].v=v;e[cnt].from=first[u];first[u]=cnt;}
int MO(int x){return x>=MOD?x-MOD:x;}
void merge(int &x,int y){
    if(a[x].size()<a[y].size())swap(x,y);
    for(int i=0;i<(int)a[y].size();i++){
        a[x][a[x].size()-i-1]=a[x][a[x].size()-i-1]+a[y][a[y].size()-i-1];
    }
}
int main(){
    n=read()+1;
    for(int i=2;i<=n;i++)fa[i]=read()+1,insert(fa[i],i);
    for(int i=n;i>=1;i--){
        int mx=0;
        if(!first[i]){
            a[b[i]=++tot].push_back((cyc){(MOD+1)/2,(MOD+1)/2,0});
        }
        else{
            b[i]=b[e[first[i]].v];
            for(int j=e[first[i]].from;j;j=e[j].from){
                mx=max(mx,min((int)a[b[i]].size(),(int)a[b[e[j].v]].size()));
                merge(b[i],b[e[j].v]);
            }
            a[b[i]].push_back((cyc){(MOD+1)/2,(MOD+1)/2,0});
        }
        for(int j=(int)a[b[i]].size()-1-1;j>=(int)a[b[i]].size()-mx-1;j--)a[b[i]][j].z0+=a[b[i]][j].z2,a[b[i]][j].z2=0;
    }
    int ans=0,N=1;
    for(int i=1;i<=n;i++)N=(N<<1)%MOD;
    for(int i=0;i<(int)a[b[1]].size();i++)ans=MO(ans+1ll*a[b[1]][i].z1*N%MOD);
    printf("%d",ans);
    return 0;
}

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

#define MAX 100

int main()
{
	vector<int> data(MAX);
	int a, max, i;

	max = 0;
	while (cin>>a)
		if (++data[a-1] > max) max = data[a-1];

	for (i = 0; i < MAX; i++)
		if (data[i] == max) cout<<(i+1)<<endl;

	return 0;
}

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

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    rep(i, n) cin >> v[i];
    int ans = 0;
    rep(l, k + 1){
        rep(r, k - l + 1){
            if(l + r > n)continue;
            priority_queue<int> q;
            int memo = 0;
            rep(i, l){
                memo += v[i];
                q.push(-v[i]);
            }
            rep(i,r){
                memo += v[n - i - 1];
                q.push(-v[n - i - 1]);
            }
            rep(i, k - l - r){
                if(!q.empty() && q.top() > 0){
                    memo += q.top();
                    q.pop();
                }else break;
            }
            ans = max(ans, memo);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
from bisect import bisect
def resolve():
    n=int(input())
    A=[-int(input()) for _ in range(n)]
    Q=[]
    for a in A:
        i=bisect(Q,a)
        if(i==len(Q)): Q.append(a)
        else: Q[i]=a

    print(len(Q))
resolve()

Measured memory_bytes: 48092
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template <typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
    for(auto &e:t) fill_v(e,v);
}
template<class T> bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1;}
    return 0;
}
template<class T> bool chmin(T & a, const T & b) { if (a > b) { a = b; return 1;}
    return 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll i = 1;
    ll ans = 0;
    while(i * i <= N){
        if(N % i == 0){
            ans = i + N / i - 2;
        }
        i++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(a<b){
        cout<<"a < b"<<endl;
    }else if(a>b){
        cout<<"a > b"<<endl;
    }else{
        cout<<"a == b"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3104