akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;

// OÏ
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
// a1,a2ð[_Æ·éüªÆb1,b2ð[_Æ·éüªÌð·»è
int is_intersected_ls(P a1, P a2, P b1, P b2) {
    // üªª½sÈêÍdÈÁÄ¢È¢±ÆÉ·é
    if(abs(cross(a2-a1,b2-b1)) < EPS){
        return 0;
    }
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
        ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}
// a1,a2ð[_Æ·éüªÆb1,b2ð[_Æ·éüªÌð_vZ
P intersection_ls(P a1, P a2, P b1, P b2) {
  P b = b2-b1;
  double d1 = abs(cross(b, a1-b1));
  double d2 = abs(cross(b, a2-b1));
  double t = d1 / (d1 + d2);

  return a1 + (a2-a1) * t;
}

P p1,p2;

class Point{
public:
    P p;
    int t;
    bool operator<(const Point &pp)const{
        double dist1=abs(p1-pp.p);
        double dist2=abs(p1-this->p);
        return dist2<dist1;
    }
};

int main(){
    int data;
    cin>>data;
    while(data--){
        int x,y;
        cin>>x>>y;
        p1=P(x,y);
        cin>>x>>y;
        p2=P(x,y);
        int n;
        cin>>n;
        vector<Point> crossPoint;
        for(int i = 0; i < n; i++){
            int xs,ys,xt,yt,o,l;
            cin>>xs>>ys>>xt>>yt>>o>>l;
            P a=P(xs,ys);P b=P(xt,yt);
            if(is_intersected_ls(a,b,p1,p2)){
                P res=intersection_ls(a,b,p1,p2);
                Point pp;
                pp.p=res;
                pp.t=l^o;
                crossPoint.push_back(pp);
            }
        }
        // ð_ðp1Éß¢ÔÉ\[g
        sort(crossPoint.begin(),crossPoint.end());
        if(crossPoint.size()==0){
            cout<<0<<endl;
            continue;
        }
        // »ÝÌ©ªÌHüîñ(1:nã,0:nº)
        int sit=0;
        sit=crossPoint[0].t;
        // ð_ðp1Éß¢ÔÉ
        int cnt=0;
        for(int i = 1; i < crossPoint.size(); i++){
            if(crossPoint[i].t!=sit){
                sit=crossPoint[i].t;
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }
}

Measured memory_bytes: 936
// When you are hungry for something and you're determined and you're focused 
// and you're committed to something it's hard to surrender, isn't it?

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define ll long long 
#define int ll
#define mod 1000000007
#define mod1 1000000006
#define modi 998244353
#define setbit(x) __builtin_popcount(x)
#define fff(i,n) for(int i=0;i<n;i++)
#define fab(i,a,b) for(int i=(a);i<(b);i++)
#define ff first
#define ss second
#define pb push_back
vector<ll> vi[300005];
int color[100005];
ll pa[500005];
ll si[500005];
#define pb push_back
bool visi[1000005]={false};
bool is[100005];
ll fac[10000001];
ll prime[400005];
ll bit[100005];
const long double eps = 1.0e-14;      // allowable error
#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
 
 
void fact(){
    fac[0]=1;
    for(int i=1;i<=10000000;i++){
        fac[i]=(fac[i-1]*i)%mod;
    }
    return ;
}
void sieve(){
    prime[0]=0;
    prime[1]=0;
    for(int i=2;i<400005;i++){
        prime[i]=1;
    }
    for(int i=2;i*i<400005;i++){
        if(prime[i]==1){
            for(int j=i*i;j<400005;j+=i){
                prime[j]=0;
            }
        }
    }
    
}
 
ll power(ll n , ll p ){
    if(p==0)
        return 1;
    
    ll res = power((n*n)%mod,p/2);
    if(p%2==1)
        res = (n*res)%mod;
    
    return res;
}
 
 
void upd(ll i,ll val,ll n) {
    for(;i<=n;i+=i&(-i))
        bit[i]+=val;
}
 
ll qry(ll i) {
    ll sum=0;
    for(;i>0;i-=i&(-i))
        sum+=bit[i];
    return sum;
}
 
 
ll fin(ll u) {
    if(pa[u]==u)
        return u;
    return fin(pa[u]);
}
 
void uni(ll u,ll v) {
    ll p1=fin(u);
    ll p2=fin(v);
    if(p1==p2)
        return;
    if(si[p1]<si[p2])
        swap(p1,p2);
    si[p1]+=si[p2];
    pa[p2]=p1;
    return;
}

int log(int x) {
    int i;
    for(i=0;(1<<i)<=x;i++);
    return i;
}

vector<int> osci(vector<int> v) {
	vector<int> v1;
	int n=v.size();
	int i=0,j=n-1;
	for(int k=0;k<n;k++) {
		if(k%2==0)
			v1.pb(v[i++]);
		else
			v1.pb(v[j--]);
	}
	reverse(all(v1));
	return v1;
} 
 
int32_t main() {
    fio
	cout << fixed << setprecision(15);
    
    string s;cin >> s;
    int n=s.size();
    int c=-1 , ans=0 , f=0;
    fff(i,n-1) {
        
        if(s[i]=='B' and s[i+1]=='W' and c!=-1) {
            s[c]='W';
            s[i+1]='B';
            ans+=(i+1-c);
            c++;
            //f=0;
        }  
        else if(s[i]=='B' and s[i+1]=='W') {
            s[i]='W';
            s[i+1]='B';
            c=i+1;
            ans++;
            //f=0;
        }
        
        else if(s[i]=='B' and f==0) {
            c=i;
            f=1;
        }
        
    }
    
    cout << ans << endl;
    
    return 0;
    
}

Measured memory_bytes: 9424
#include<cstdio>
#include<algorithm>
using namespace std;

int main(void) {
	int K, N;
	scanf("%d", &N);
	scanf("%d", &K);
	int p[1100];
	for (int i = 0; i < N; i++) {
		scanf("%d", &p[i]);
	}
	sort(&p[0], &p[N]);
	int ans = 0;
	for (int i = 0; i < K; i++) {
		ans += p[i];
	}
	printf("%d", ans);

	return 0;
}


Measured memory_bytes: 1740
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main() {
    int n, K;
    cin >> n >> K;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    int ans = 2e9;
    for (int i = 0; i + K - 1 < n; i++) {
        ans = min(ans, a[i + K - 1] - a[i]);
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

//
#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0, sizeof(x))
#define mm(x) memset((x), -1, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define bit(n) (1LL << (n))
#define bitset(a, b) (a) |= (1 << (b))
#define bitunset(a, b) (a) &= ~(1 << (b))
#define bitcheck(a, b) ((((a) >> (b)) & 1) == 1)
#define bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
const int INF = (int)1e18;
const int MOD = (int)1e9 + 7;
const double PI = (double)acos(-1);
const double EPS = (double)1e-10;
const int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
const int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
};

signed main() {
  int a[10];
  int mx = 0, min = INF;
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
    chmax(mx, a[i]);
    chmin(min, a[i]);
  }
  int k;
  cin >> k;
  if (mx - min > k) {
    cout << ":(" << endl;
  } else {
    cout << "Yay!" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}
//combination(Nが小さい時はこれを使う)
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int k, a, b;
	cin >> k >> a >> b;
	for (int i = a; i <= b; i++) {
		if (i % k == 0) {
			puts("OK");
			ggr
		}
	}
	puts("NG");
	ggr
}


Measured memory_bytes: 3732
#include <stdio.h>
int solve(int,int);
int A[2001],n;

int main(){
  int q,m,i;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i = 0; i < q; i++){
    scanf("%d",&m);
    if(solve(0,m)) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}

int solve(int i, int m){
  if(m == 0) return 1;
  if(i >= n) return 0;

  return solve(i+1,m) || solve(i+1,m-A[i]);
}

Measured memory_bytes: 580
using System;

class C
{
	static void Main()
	{
		var h = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		int n = h[0], k = h[1];

		var r = (long)Math.Pow(n / k, 3);
		if (k % 2 == 0) r += (long)Math.Pow((n + k / 2) / k, 3);
		Console.WriteLine(r);
	}
}


Measured memory_bytes: 13140
#include <stdio.h>

int partition(int *,int,int);

int main()
{
  int n,i,youso;
  
  scanf("%d",&n);

  int A[n];

  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }
  
  youso=partition(A,0,n-1);

  for(i=0;i<n-1;i++)
    {
      if(youso==i)printf("[%d] ",A[i]);
      else printf("%d ",A[i]);
    }

  if(youso==i)printf("[%d]\n",A[i]);
      else printf("%d\n",A[i]);
  
  return 0;
}

int partition(int *A,int p,int r)
{
  int x,i,j,koukan;

  x=A[r];
  i=p-1;
  for(j=p;j<r;j++)
    {
      if(A[j]<=x)
	{
	  i=i+1;
	  koukan=A[i];
	  A[i]=A[j];
	  A[j]=koukan;
	}
    }
  koukan=A[i+1];
  A[i+1]=A[r];
  A[r]=koukan;
  
  return i+1;
}
  
  



Measured memory_bytes: 2144
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<ll, int> P;
typedef tuple<int, int, int> T;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n, m;
int a[200100], b[200100];

vector<int> G[100100];

void solve() {
    for (int i = 0; i < m; i++) {
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }

    int res[n];
    memset(res, -1, sizeof(res));
    queue<int> que;
    que.push(0);
    res[0] = 0;
    while (!que.empty()) {
        int v = que.front(); que.pop();
        for (int u : G[v]) {
            if (res[u] < 0) {
                res[u] = v+1;
                que.push(u);
            }
        }
    }

    cout << "Yes" << endl;
    for (int i = 1; i < n; i++) {
        cout << res[i] << endl;
    }
}

void input() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    solve();
}


Measured memory_bytes: 11592
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n, x;
	cin >> n >> x;
	int l[n], i;
	for (i = 0; i < n; i++)
		cin >> l[i];
	int sum = 0, ans = 0;
	for (i = 0; i < n; i++) {
		sum += l[i];
		if (sum > x)
			break;
	}
	cout << i + 1;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#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 N;
  cin >> N;
  string S, T;
  cin >> S >> T;
  rep(i,N) cout << S[i] << T[i];
  cout << endl;
  return 0;
}

Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <string.h>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
 
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;
 
 
int main(void) {
  std::setprecision(16);
  long double l;
  cin >> l;
  long double ans = pow(l/3,3);
  cout << fixed << setprecision(8) << ans << endl;
}

Measured memory_bytes: 512
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];

        for(int i=0; i<n; i++) {
            a[i] = sc.nextInt();
        }

        for(int i=0; i<n; i++) {
            b[i] = sc.nextInt();
        }
        sc.close();

        ArrayList<Integer> list = new ArrayList<>();
        int sumA = 0;
        int sumB = 0;
        for(int i=0; i<n; i++) {
            sumA += a[i];
            for(int j=i; j<n; j++) {
                sumB += b[j];
            }
            list.add(sumA+sumB);
            sumB = 0;
        }

        java.util.Collections.sort(list);
        System.out.println(list.get(list.size()-1));
    }
}


Measured memory_bytes: 23124
// Created by sz
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int h,w;
    cin >> h >> w;
    vector<string> s(h);
    for (int i = 0; i < h; i++){
        cin >> s[i];
    }
    
    vector<vector<int> > dp(h, vector<int>(w, 100000));
    
    function<int(int, int)> DP=[&](int row, int col){
        if(dp[row][col]!=100000)return dp[row][col];
        if(row == h-1 &&  col == w-1){
            if(s[h-1][w-1] == '.')return dp[h-1][w-1] =0;
            else return dp[h-1][w-1] = 1;
        }
        int& dp_value = dp[row][col];
        
        if(row+1< h){
            dp_value = min(dp_value, DP(row+1,col) + (s[row][col]=='#' &&s[row+1][col] == '.' ));
        }
        if(col+1<w){
            
            dp_value = min(dp_value, DP(row,col+1) + (s[row][col]=='#' && s[row][col+1] == '.'));
        }
        
        return dp_value;
    };
    
    cout << DP(0,0) << "\n";
    
    
    return 0;
}


Measured memory_bytes: 384
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a)-1;i>=(b);i--)

int main() {
    ll N, D, A;
    cin >> N >> D >> A;
    struct Enemy {
        ll x;
        ll h;
    };
    vector<Enemy> enemies(N);
    rep(i,0,N) {
        cin >> enemies[i].x >> enemies[i].h;
    }
    sort(enemies.begin(), enemies.end(), [](Enemy lhs, Enemy rhs){
        return lhs.x < rhs.x;
    });
    vector<ll> coords(N);
    rep(i,0,N) {
        coords[i] = enemies[i].x;
    }
    ll ans = 0;
    vector<ll> end_count(N);
    ll damage = 0;
    rep(i,0,N) {
        damage -= end_count[i];
        enemies[i].h -= damage * A;
        if (enemies[i].h >= 0) {
            ll count = enemies[i].h/A + (enemies[i].h%A != 0);
            ans += count;
            damage += count;
            auto it = upper_bound(coords.begin(), coords.end(), enemies[i].x + 2*D);
            ll idx = distance(coords.begin(), it);
            if (idx < N) {
                end_count[idx] += count;
            }
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 6528
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <fstream>
#include <numeric>

using namespace std;

#define max(a,b) a > b ? a : b
#define min(a,b) a < b ? a : b

#define X_MAX 100000
#define Y_MAX 100000
#define A_MAX 100000
#define B_MAX 100000
#define C_MAX 100000
//#define n_MAX 1000000000
#define M_PI 3.1415926535

int main()
{
    double R;

    cin >> R;

    cout << 2 * M_PI * R << endl;

    return 0;
}

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

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

    char c = N[N.length()-1];

    if (c=='3')
        cout << "bon" << endl;
    else if (c=='0'||c=='1'||c=='6'||c=='8')
        cout << "pon" << endl;
    else
        cout << "hon" << endl;

    return 0;
}



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

int main(){
    int N, T;
    cin >> N >> T;
    int c[10000], t[10000];
    for(int i=1;i<=N; ++i) cin >> c[i] >> t[i];
    for(int i=1; i<=N; ++i){
        if(t[i] > T) c[i] = 100000;
    }
    sort(c + 1, c + N+1);
    if(c[1] > 1000){
        cout << "TLE" << endl;
    }
    else cout << c[1] << endl;
    return 0;
}

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

int main() {
  int m,d,cnt;
  cin >> m >> d;
  cnt = 0;
  if(m > 1 && d > 21){
  for(int i = 2;i <= m;i++){
    for(int j = 22;j <= d;j++){
	int d10 = j/10;
    int d1 = j - (d10*10);
    if(d1 >= 2 && d10 >= 2){
      if(i == d10*d1){
        cnt++;
        }
      }
    }
  }
 }   
    cout << cnt << endl;

}


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

int main() {
  long long n,t;
  cin>>n;
  int k=sqrt(n);
  for(int i=k+1;i>0;i--){
    if(n%i==0){
      t=n/i;
    break;
    }
  }
  for(int i=10;i>-1;i--){
    if(t>=pow(10,i)){
      cout<<i+1<<endl;
      break;
    }
  }
}


Measured memory_bytes: 256
import math

n=int(input())
k=math.floor(math.log10(n))+1
#print(k)

much=0

if k%2==0:
    for i in range(int(k/2)):
        much+=9*(10**(i*2))
else:
    for i in range(int((k-1)/2)):
        much+=9*(10**(i*2))
    much+=n-(10**(k-1))+1

print(much)

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

#define FOR(i,l,r) for(int i = int(l);i < int(r);i++)
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;



int main()
{
    int N,r;
    r=40;
    cin >>N;
    for(int i=0;i<N;i++){
      int a;
      cin >> a ;
        int b=0;
      while(a%2==0){
        b++;
        a/=2;  
      }  
      r=min(r,b);
        
    } 
    cout << r<<endl; 
}  


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int[] array = new int[10000000];

		for(int i=0;i<S.length();i++) {
			array[S.charAt(i)]++;
		}
		for(int i:array) {
			if(i > 1) {
				System.out.println("no");
				System.exit(0);
			}
			//System.out.println(i);
		}
		System.out.println("yes");
	}
	public static int sample() {
		return 1;
	}

}


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

int main(){
    int N;
    cin >> N;
    vector<int>A(N);
    set<int>Set;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        Set.insert(A[i]);
    }
    if(N == Set.size()) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 10368
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

ans = 0

for i in range(N):
    num = i+1
    if num%3 != 0  and num%5 != 0:
        ans += num

print(ans)

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

#define NDEBUG
#include <cassert>


typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair

#define PQ(T) priority_queue<T>
#define RPQ(T) priority_queue<T,vector<T>,greater<T>>

template<class T> inline void amin(T & a, T const & b) { a = min(a, b); }
template<class T> inline void amax(T & a, T const & b) { a = max(a, b); }

inline ll square(ll x) { return x * x; }
inline ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }
template <typename T>
inline T mod(T a, T b) { return ((a % b) + b) % b; }


const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

ll bt(ll x, int b){
    ll cycle = 1LL << (1LL + b);
    ll q = x / cycle, r = x % cycle;
    ll a = (q * cycle/2) % 2;
    if (r < cycle/2) return a;
    a += (r - cycle/2) % 2;
    return a % 2;
}

ll f(ll x){
    ll a=0;
    ++x;
    for (ll b=0; b<40; ++b) {
        ll bi = bt(x, b);
        a |= (bi << b);
    }
    return a;
}

ll solve(ll a, ll b) {
    ll fa_=f(a-1), fb=f(b);
    return fb ^ fa_;
}

int main() {
    ll a,b; cin >> a >> b;
    cout << solve(a,b) << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3

# from numba import njit

# from collections import Counter
# from itertools import accumulate
# import numpy as np
# from heapq import heappop,heappush
# from bisect import bisect_left

# @njit
def solve(n,a):
  h_max = max(a)
  res = 0

  for h in range(h_max):
    flag = 0 #一つ前に水をやる必要があるかどうか

    for i in range(n):
      if a[i] > h and not flag:
        res += 1
        flag = 1
      elif a[i] <= h:
        flag = 0

  return res



def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()


Measured memory_bytes: 9168
Scanf.sscanf (read_line ()) "%d %d" (fun n p ->
    let s = read_line () in
    if p = 2 || p = 5 then (
        let rec loop i d acc =
            if i < 0 then acc else (
                let c = int_of_char s.[i] - int_of_char '0' in
                let d = if c mod p = 0 then d + 1 else d in
                let acc = acc + d in
                loop (i - 1) d acc
            )
        in
        loop (n - 1) 0 0 |> Printf.printf "%d\n"
    ) else (
        let dp = Array.make p 0 in
        dp.(0) <- 1;
        let rec loop i mul prev acc =
            if i < 0 then acc else
                let c = int_of_char s.[i] - int_of_char '0' in
                let d = (c * mul + prev) mod p in
                let () = dp.(d) <- dp.(d) + 1 in
                loop (i - 1) ((mul * 10) mod p) d (acc + dp.(d) - 1)
        in
        loop (n - 1) 1 0 0 |> Printf.printf "%d\n" 
    )
)


Measured memory_bytes: 2688
/*
    author - NIRANJAN E.N.S
    account - flyHigher
    codeforces
*/
#include <bits/stdc++.h>
using namespace std;

#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define deb3(x,y,z) cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<char> vc;

#define fr first
#define sd second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()

#define fo(i,n) for(int i = 0; i < int(n); i++)
#define fo1(i,n) for(int i = 1; i < int(n); i++)
#define fom(i,n,m) for(int i = m; i < int(n); i++)
#define rfo(i,n) for(int i = int(n-1); i >= 0; i--)
#define rfo1(i,n) for(int i = int(n-1); i >= 1; i--)
#define rfom(i,n,m) for(int i = int(n-1); i >= (int)m; i--)

#define M0(a) memset(a, 0, sizeof(a))
#define M1(a) memset(a, -1, sizeof(a))
#define V0(v,n) v.resize(n,0);
#define V1(v,n) v.resize(n,-1);
#define VV0(v,n,m) v.resize(n,vi(m,0));
#define VV1(v,n,m) v.resize(n,vi(m,-1));
#define VVL0(v,n,m) v.resize(n,vl(m,0));
#define VVL1(v,n,m) v.resize(n,vl(m,-1));

const ll inf  = 1e9+7;
const ll mod  = 1e9+7;
const ll maxn = 1e5+7;

void print_int(vi);
void print_ll(vl);
ll power(ll,ll);

inline ll inv(int a) {
    return power(a, mod-2);
}

void solve() {
    int n;
    cin>>n;
    int m = n%10;
    if(m==3)
        cout<<"bon"<<endl;
    else if(m==0 or m==1 or m==6 or m==8)
        cout<<"pon"<<endl;
    else 
        cout<<"hon"<<endl;
}   

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int T=1;
    //cin>>T;
    for(int t=1;t<=T;t++) {
        //cout<<"Case #"<<t<<": ";
        solve();
    }

    return 0;
}

void print_int(vi v) {
    for(int i:v)
        cout<<i<<" ";
    cout<<endl;
}

void print_ll(vl v) {
    for(ll i:v)
        cout<<i<<" ";
    cout<<endl;
}

ll power(ll n,ll p) {
    ll res = 1;
    while(p!=0) {
        if(p&1)
            res = res*n;
        n = n*n;
        p = p>>1;
    }
    return res;
}

Measured memory_bytes: 3624
#include <iostream>
#include <fstream>
#include <cmath>
#include <list>
#include <vector>
#include <tuple>
using namespace std;
//#define FILENAME "./F/in/b04"
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long

#define MOD 1000000007

int n,imax,imax2;
vector<int> a;

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

#ifdef FILENAME
  ifstream file(FILENAME);
  cin.rdbuf(file.rdbuf());
#endif

  cin >> n;
  a.resize(n);

  cin >> a[0] >> a[1];
  if(a[0] > a[1]) { imax = 0; imax2 = 1; }
  else { imax = 1; imax2 = 0; }
  rep(i,n) {
    if(i==0 || i==1) continue;
    cin >> a[i];
    if(a[i] > a[imax]) {
      imax2 = imax;
      imax = i;
    }else if(a[i] > a[imax2]) {
      imax2 = i;
    }
  }

  rep(i,n) {
    if(i == imax) cout << a[imax2] << endl;
    else cout << a[imax] << endl;
  }
  
  
  return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
using namespace std;
#define loop(i,N) for(ll (i)=0; (i)<(N);++(i))
struct _OMAZINAI_ { _OMAZINAI_() { std::ios::sync_with_stdio(false); std::cin.tie(0); } } __omazinai_instance__;
#define INF (1LL<<61 + 1<<29)
#define YesNo(x) {std::cout << ((x)?"Yes":"No") << std::endl;}
#define YESNO(x) {std::cout << ((x)?"YES":"NO") << std::endl;}
#define OddEven(x) {std::cout << ((x)%2?"Odd":"Even") << std::endl;}
#define ODDEVEN(x) {std::cout << ((x)%2?"ODD":"EVEN") << std::endl;}
typedef long long int ll;
void _INPUT_IMPL_() {};
template <class T, class... Args> void _INPUT_IMPL_(T& dest, Args&... args) { cin >> dest; _INPUT_IMPL_(args...); }
void _OUTPUT_IMPL_() {};
template <class T, class... Args> void _OUTPUT_IMPL_(T dest, Args... args) { cout<< dest << (sizeof...(Args)?" ":""); _OUTPUT_IMPL_(args...); }
#define in(type, ...) type __VA_ARGS__; _INPUT_IMPL_(__VA_ARGS__)
#define in_v(type, name, cnt) vector<type> name(cnt); loop(i, cnt) cin >> name[i];
#define sort_v(v) std::sort(v.begin(), v.end())
#define sum_v(v) std::accumulate(v.begin(), v.end(), (long double)0)
#define out(...) (_OUTPUT_IMPL_(__VA_ARGS__), std::cout<<std::endl)
//小さい方に寄る
#define space_op(x, y, a, b, c) ([](auto x_, auto y_, auto a_, auto b_, auto c_){if(x_<y_)return a_;if(x_>y_)return c_;return b_;}(x,y,a,b,c))
#define space_out(x, y, a, b, c) out(space_op(x, y, a, b, c))

int cnt;
int main() {
	in(int, N, x);
	in_v(int, a, N);
	sort_v(a);
	
	loop(i, N)
		if(x-a[i] >= 0) x-=a[i], ++cnt;
		else break;

	cnt -= (cnt == N && x);

	out(cnt);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define x first
#define y second

using namespace std;

typedef long long ll;

ll len[200005];
int n;
stack <pair <ll, ll> > qu;

bool ok(ll kol)
{
    while (!qu.empty()) qu.pop();
    qu.push(mp(len[1], 1));
    for (int i = 2; i <= n; i++)
    {
        if (len[i] > len[i - 1])
            qu.push(mp(len[i] - len[i - 1], 1));
        if (len[i] == len[i - 1])
        {
            ll ls = 0;
            while (!qu.empty() && qu.top().y == kol)
            {
                ls += qu.top().x;
                qu.pop();
            }
            if (qu.empty()) return false;

            pair <ll, ll> v = qu.top();
            qu.pop();
            if (v.x != 1) qu.push(mp(v.x - 1, v.y));
            qu.push(mp(1, v.y + 1));
            if (ls != 0) qu.push(mp(ls, 1));
        }
        if (len[i] < len[i - 1])
        {
            ll ls = len[i - 1];
            while (!qu.empty() && ls - qu.top().x >= len[i])
            {
                ls -= qu.top().x;
                qu.pop();
            }
            while (!qu.empty() && qu.top().y == kol)
            {
                ls -= qu.top().x;
                qu.pop();
            }
            if (qu.empty()) return false;

            pair <ll, ll> v = qu.top();
            qu.pop();
            if (min(v.x - 1, len[i] - (ls - v.x) - 1) > 0) qu.push(mp(min(v.x - 1, len[i] - (ls - v.x) - 1), v.y));
            qu.push(mp(1, v.y + 1));
            if (ls < len[i]) qu.push(mp(len[i] - ls, 1));
        }
    }
    return true;
}

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll sum = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> len[i];
        sum += len[i];
    }
    ll lef = 0, rig = sum;
    while (lef + 1 < rig)
    {
        ll mid = (lef + rig) / 2;
        if (ok(mid)) rig = mid;
        else lef = mid;
    }
    cout << rig;
    return 0;
}


Measured memory_bytes: 5168
use std::io;
use std::cmp::Ordering;
use std::str::FromStr;

fn get_line() -> String {
    let mut line = String::new();
    io::stdin().read_line(&mut line).ok();
    line
}

fn get_vector() -> Vec<i32> {
    let line = get_line();
    let vec : Vec<i32> = line.split_whitespace().map(|x| i32::from_str(x).unwrap()).collect();
    return vec;
}

fn main() {
    let vec = get_vector();
    let (a, b, c) = (vec[0], vec[1], vec[2]);
    let ans = if a < b && b < c { "Yes" } else { "No" };
    println!("{}", ans);

}



Measured memory_bytes: 5020
function main(lines) {
    const input = lines.split('\n').slice(1)
    const n = input.length
    
    // let str = []
    let obj = {}
    input.forEach(function(arr){
        const judge = arr.split(' ')

        if(judge[0] === 'insert'){
            // str.push(judge[1])
            obj[judge[1]]= true
        }
        if(judge[0] === 'find'){
            console.log(obj.hasOwnProperty(judge[1]) ? 'yes' : 'no')
            // console.log(str.includes(judge[1]) ? 'yes' : 'no')
        }
    })
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));




Measured memory_bytes: 249492
import sys
s = list(map(int, list(input())))
result = []
a = 0
for i in range(len(s)-2):
    a = 100*s[i]+10*s[i+1]+s[i+2]
    if a < 753:
        a = 753 - a
    elif a > 753:
        a = a - 753
    else:
        print(0)
        sys.exit()
    result.append(a)
print(min(result))

Measured memory_bytes: 3064
#include <stdio.h>
 
int main(){

    int a, b, c;
    int i;
    int x = 0;

    scanf("%d %d %d", &a, &b, &c);
 
    for(i = a; i <= b ; i++ ){
        if(c % i == 0) x++;
    }
    printf("%d\n", x);
 
    return 0;
}

Measured memory_bytes: 1848
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int l = s.length();
	int i, j;
	for(i=0;i<l;i++)
	{
		for(j=0;j<l-1;j++)
		{
			if(s[j]>=s[j+1])
			{
				char t = s[j];
				s[j] = s[j+1];
				s[j+1] = t;
			}
		}
	}
	//cout<<s<<endl;
	int c = 1;
	i = 1;
	while(i<l)
	{
		if(s[i]!=s[i-1])
		{
			c++;
		}
		i++;
	}
	if(c==2)
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
 int N,cnt=0;
  cin>>N;
  int a[N];
  for(int i=0;i<N;i++) cin>>a[i];
  for(int i=0;i<N;i++){
    if(a[i]==a[i+1]){
      a[i+1]=10000-cnt;
      cnt++;
      i=0;
    }
  }
  cout<<cnt<<endl;
}	


Measured memory_bytes: 256
import scala.io.StdIn.{readInt, readLine};

object Main {
    def main(args: Array[String]): Unit = {
        val n = readInt;
        val preorder = readLine.split(" ").map(_.toInt);
        val inorder = readLine.split(" ").map(_.toInt);
        val (root, tree) = buildTree(n, preorder, inorder);
        println(postorder(root, tree).mkString(" "));
        
    }
    
    def buildTree(size: Int, preorder: Array[Int], inorder: Array[Int]): (Int, Array[Node]) = {
        val tree = new Array[Node](size + 1);
        def go(prePtr: Int, inFirst: Int, inLast: Int): (Int, Int) = {
            if (prePtr >= size) {
                (-1, prePtr);
            } else {
                val pivot = preorder(prePtr);
                val pivotIdx = inorder.indexOf(pivot);
                val (left, prePtr1) = if (inFirst == pivotIdx) (-1, prePtr) else go(prePtr + 1, inFirst, pivotIdx - 1);
                val (right, prePtr2) = if (inLast == pivotIdx) (-1, prePtr1) else go(prePtr1 + 1, pivotIdx + 1, inLast);
                tree(pivot) = Node(pivot, left, right);
                (pivot, prePtr2);
            }
        }
        go(0, 0, size - 1);
        (preorder(0), tree);
    }
    
    def postorder(root: Int, tree: Array[Node]): List[Int] = {
        def go(curr: Int, ret: List[Int]): List[Int] = {
            if (curr == -1) {
                ret;
            } else {
                val Node(id, left, right) = tree(curr);
                val ret1 = go(left, ret);
                val ret2 = go(right, ret1);
                val ret3 = id :: ret2;
                ret3;
            }
            
        }
        go(root, Nil).reverse;
    }
}
case class Node(id: Int, left: Int, right: Int);


Measured memory_bytes: 44008
#include <iostream>

using namespace std;

int n,m,i,j,b[105],a[105][105],c,nr;

int main() 
{
    cin>>n>>m>>c;
    for (i=1; i<=m; i++)
        cin>>b[i];
    for (i=1; i<=n; i++)
    {
        int sum=0;
        for (j=1; j<=m; j++)
        {
            cin>>a[i][j];
            sum+=a[i][j]*b[j];
        }
        if (sum+c>0) nr++;
    }
    cout<<nr;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 105
#define MOD 1000000007
using namespace std;
int n, dp[M][256];
bool ban[256];
char sp[5] = "TAGC";
void init() {
    MSET(ban, false);
    char tmp[5];
    REP(i,0,255) {
        int x = i;
        for (int p=3; p>=0; p--) {
            tmp[p] = sp[x%4];
            x /= 4;
        }

        auto check = [&]() {
            REP(j,2,3) if(tmp[j-2]=='A' && tmp[j-1]=='G' && tmp[j]=='C') return true;
            return false;
        };

        if (check()) ban[i] = true;
        REP(j,0,2) {
            swap(tmp[j], tmp[j+1]);
            if (check()) ban[i] = true;
            swap(tmp[j], tmp[j+1]);
        }
    }
}
int main()
{
    init();
    
    while (~scanf("%d", &n)) {
        MSET(dp, 0);
        dp[0][0] = 1;
        REP(i,0,n-1) REP(j,0,255) if(dp[i][j]) {
            REP(k,0,3) {
                int j2 = ((j*4)&255) + k;
                if (!ban[j2]) {
                    dp[i+1][j2] += dp[i][j];
                    dp[i+1][j2] %= MOD;
                }
            }
        }

        int ans = 0;
        REP(i,0,255) ans = (ans+dp[n][i]) % MOD;
        printf("%d\n", ans);
    }
    
    return 0;
}



Measured memory_bytes: 384
import math
#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return [-1]
    else:
        factor.append(n)
        return factor
    return [-1]

a,b = input().split(' ')
a = int(a)
b = int(b)
aSet = trial_division(a)+[1]
bSet = trial_division(b)+[1]
if aSet[0] == -1:
    aSet = [1,a]
if bSet[0] == -1:
    bSet = [1,b]
aSet= set(aSet)
bSet = set(bSet)
ngo = aSet&bSet
print(len(ngo))

Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>

const int mod = 1e9 + 7;
const int MAXN = 3e5 + 5;

template<typename _T>
void read( _T &x )
{
	x = 0;char s = getchar();int f = 1;
	while( s > '9' || s < '0' ){if( s == '-' ) f = -1; s = getchar();}
	while( s >= '0' && s <= '9' ){x = ( x << 3 ) + ( x << 1 ) + ( s - '0' ), s = getchar();}
	x *= f;
}

template<typename _T>
void write( _T x )
{
	if( x < 0 ){ putchar( '-' ); x = ( ~ x ) + 1; }
	if( 9 < x ){ write( x / 10 ); }
	putchar( x % 10 + '0' );
}

template<typename _T>
_T MIN( const _T a, const _T b )
{
	return a < b ? a : b;
}

int f[MAXN][3][3];
char S[MAXN];
int N;

int add( int &x, const int y ) { return x = ( x + y >= mod ? x + y - mod : x + y ); }

int main()
{
	scanf( "%s", S + 1 );
	f[0][0][0] = 1, N = strlen( S + 1 );
	for( int i = 0 ; i < N ; i ++ )
		for( int j = 0 ; j < 3 ; j ++ )
			for( int k = 0 ; k < 3 ; k ++ )
				if( f[i][j][k] )
				{
					if( S[i + 1] ^ '1' ) add( f[i + 1][j][k == 2 ? 1 : k + 1], f[i][j][k] );
					if( S[i + 1] ^ '0' ) 
					{
						if( k ) add( f[i + 1][j][k - 1], f[i][j][k] );
						else add( f[i + 1][MIN( j + 1, 2 )][k], f[i][j][k] );
					}
				}
	write( add( f[N][1][0], add( f[N][2][0], add( f[N][2][1], f[N][2][2] ) ) ) ), putchar( '\n' );
	return 0;
}

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

int main() {
	int n;
  cin >> n;
  if(n==111){
    cout << "999";
  }else if(n==119){
    cout << "991";
  }else if(n==191){
    cout << "919";
  }else if(n==199){
    cout << "911";
  }else if(n==999){
    cout << "111";
  }else if(n==991){
    cout << "119";
  }else if(n==919){
    cout << "191";
  }else if(n==911){
    cout << "199";
  }
	return 0;
}


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

int main(void){
  int N, M;
  cin >> N >> M;
  vector<string> A(N), B(N);
  for(auto& a: A){
    cin >> a;
  }
  for(auto& b: B){
    cin >> b;
  }

  int ans = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < M; j++){
      if(A[i][j] != B[i][j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 11132
import bisect
n = int(input())
add_num = 1
draw_money = []
while add_num <= 10 ** 5:
    draw_money.append(add_num)
    add_num *= 6
    
add_num = 1
while add_num <= 10 ** 5:
    draw_money.append(add_num)
    add_num *= 9

#重複を削除
draw_money = list(set(draw_money))
ans = 0
draw_money.sort()
# dp[i] = i円引き出すのに必要な最小操作
dp = [10000000] * (n + 1)
dp[0] = 0
for i in range(1,n + 1):
    for j in draw_money:
        if  i - j >= 0:
            dp[i] = min(dp[i - 1] + 1, dp[i - j] + 1,dp[i])
        else:
            dp[i] = min(dp[i-1] + 1, dp[i])

print(dp[n])





Measured memory_bytes: 3828
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 H, N;
  std::cin >> H >> N;
  std::vector<i64> A;
  tools::read(A, N);
  std::cout << (std::accumulate(A.begin(), A.end(), static_cast<i64>(0)) >= H ? "Yes" : "No") << std::endl;
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
const int MAX=5040;
const ll MOD=1000000007;
vector<int> conn[MAX],pos;
int par[MAX],cnt[MAX],cntrd,n,chk[MAX];
ll polys[MAX],poly[MAX];
ll fact[MAX],fact_rev[MAX],wow;
int dfs(int x,int p){
    par[x]=p; cnt[x]=1;
    for(int i=0;i<conn[x].size();i++) if(conn[x][i]!=p) cnt[x]+=dfs(conn[x][i],x);
    return cnt[x];
}
int dfs2(int x){
    int t=1;
    if(chk[x]) return 0;
    chk[x]=1;
    for(int i=0;i<conn[x].size();i++) t+=dfs2(conn[x][i]);
    return t;
}
int find_cntrd(int x){
    for(int i=0;i<conn[x].size();i++) if(cnt[conn[x][i]]>n/2&&par[x]!=conn[x][i]) return find_cntrd(conn[x][i]);
    return x;
}
ll power(int x,int y){
    if(y==0) return 1;
    if(y==1) return x;
    ll t=power(x,y/2);
    if(y%2) return (((t*t)%MOD)*x)%MOD;
    return (t*t)%MOD;
}
ll mycount(){
    int tot=0;
    ll fin=0;
    for(int i=0;i<=n;i++) poly[i]=0,polys[i]=0;
    poly[0]=1;
    for(int i=0;i<pos.size();i++){
        tot+=pos[i];
        for(int j=0;j<=pos[i];j++){
            ll t=(fact[pos[i]]*fact_rev[pos[i]-j])%MOD;
            t=(t*t)%MOD; t=(t*fact_rev[j])%MOD;
            for(int k=0;k<=n-j;k++) polys[k+j]+=poly[k]*t,polys[k+j]%=MOD;
        }
        for(int j=0;j<=n;j++) poly[j]=polys[j],polys[j]=0;
    }
    for(int i=0;i<=n;i++) poly[i]*=fact[tot-i],poly[i]%=MOD;
    for(int i=0;i<=n;i++) {
        if(i%2) fin-=poly[i];
        else fin+=poly[i];
        fin+=MOD,fin%=MOD;
    }
    //printf("%lld ",poly[i]);
    return fin;
}
int main(){
    scanf(" %d",&n);
    for(int i=0;i<n-1;i++){
        int t1,t2;
        scanf(" %d %d",&t1,&t2);
        conn[t1].push_back(t2);
        conn[t2].push_back(t1);
    }
    dfs(1,0);
    cntrd=find_cntrd(1); chk[cntrd]=1; fact[0]=1;
    for(int i=0;i<conn[cntrd].size();i++) pos.push_back(dfs2(conn[cntrd][i]));
    //for(int i=0;i<pos.size();i++) printf("%d ",pos[i]);
    for(ll i=1;i<=n;i++) fact[i]=(fact[i-1]*i)%MOD;
    for(ll i=0;i<=n;i++) fact_rev[i]=power(fact[i],MOD-2);
    pos.push_back(1);
    wow+=mycount();
    pos.pop_back();
    wow+=mycount();
    printf("%lld\n",wow%MOD);
}


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

#define pb       push_back
#define all(a)   a.begin(), a.end()
#define mp       make_pair
#define ll	long long

using namespace std;
string s;

int main(){
	cin >> s;
  int sum=0;
  for(char c : s){
    sum += c - '0';
  }
  cout << ((stoi(s) % sum == 0)?"Yes":"No") << endl;
	return 0;
}

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

int main(){
  int n; cin>>n;
  int count=0;
  for(int i=0;i<n;i++){
    int a; cin>>a;
    while(a%2!=1){
      a /= 2;
      count++;
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 384
c = []
for _ in range(3):
  c.append(list(map(int, input().split())))
if c[0][1]-c[0][0] == c[1][1]-c[1][0] and c[2][1]-c[2][0] == c[1][1]-c[1][0] and c[0][2]-c[0][1] == c[1][2]-c[1][1] and c[2][2]-c[2][1] == c[1][2]-c[1][1]:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9048
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int n, m;
    cin >> n >> m;
    
    auto coin = vector<int>(m, 0);
    int ci;
    for (int i=0; i<m; i++) {
        cin >> ci;
        coin[i] = ci;
    }
    
    auto coin_num = vector<int>(n+1, 999999);
    coin_num[0] = 0;
    for (int g=0; g<=n; g++) {
        for (int c : coin) {
            if (g + c > n) {
                continue;
            }
            if (coin_num[g] + 1 < coin_num[g+c]) {
                coin_num[g+c] = coin_num[g] + 1;
            }
        }
    }
    
    cout << coin_num[n] << endl;
}



Measured memory_bytes: 3116
import java.util.*;

public class Main {

  public static void main (String[] args) {

     Scanner sc = new Scanner(System.in);
 
    int N = sc.nextInt();
    int Y = sc.nextInt();
 
    sc.close();

    String result = "-1 -1 -1";

     for (int i = 0; i <= N; i++) {

      for (int j = 0; j <= N - i; j++) {

        int k = N - i - j;
        int sum = i * 10000 + j * 5000 + k * 1000;
        if (sum == Y) {
          result = i + " " + j + " " + k;
          break;
        }

      }

    }

    System.out.println(result);

  }

}

Measured memory_bytes: 23124