akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;


int main() {
    int n; cin >> n;
    vector<ll> x(n), y(n), h(n);
    rep(i, n) cin >> x[i] >> y[i] >> h[i];

    // あるh[i] > 0が存在
    rep(cx, 101) rep(cy, 101) {
        bool flag = 0;
        ll H;
        rep(i, n) {
            if (h[i] > 0) {
                H = h[i] + abs(x[i]-cx) + abs(y[i]-cy);
            }
        }
        rep(i, n) {
            if (h[i] != max(H - abs(x[i]-cx) - abs(y[i]-cy), 0LL)) {
                flag = 1;
                break;
            }
        }
        if (flag) continue;
        cout << cx << " " << cy << " " << H << endl;
        return 0;
    }




    return 0;
}


    


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int a,b,i;
  cin>>a>>b;
  if(a<b)
  {
    for(i=1;i<=b;i++)
      cout<<a;
  }
  else if(b<a)
  {
    for(i=1;i<=a;i++)
      cout<<b;
  }
  else
  {
    for(i=1;i<=a;i++)
      cout<<a;
  }
  return 0;
}

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

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

    auto div = [&] (int c) {
    	int count = 0;
    	int ans = 0;
    	for(int i = 0; 2 * i + 1 <= c; i++) {
    		for(int j = 1; j <= 2 * i + 1; j++) {
    			if((2 * i + 1) % j == 0) {
    				count++;
    			}
    		}
    	    if(count == 8) {
    		    ans += 1;
    	    }
    	    count = 0;
    	}
    	return ans;
    };

    int n;
    cin >> n;
    cout << div(n) << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	private static Scanner sc;

	public static void main(String[] args){
		sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int a[][]=new int[n][m];
		int b[]=new int[m];
		int c=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				a[i][j]=sc.nextInt();
			}
		}
		for(int i=0;i<m;i++){
			b[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				c=c+a[i][j]*b[j];
			}
			System.out.println(c);
			c=0;
		}
	}
}

Measured memory_bytes: 40896
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<cstdio>
#include<iostream>
using namespace std;
int n,k,q,x,a[100005];
inline int read(){
	char ch=getchar();
	int x=0,f=1;
	while(ch<'0' || ch>'9')	{if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9') {x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int main(){
    n=read(),k=read(),q=read();
    for(int i=1;i<=q;i++){
		x=read();
		a[x]++;
    }
    for(int i=1;i<=n;i++){
    	if(a[i]+k-q<=0){
    		printf("No\n");
    		continue ;
		}
		printf("Yes\n");
	}
	return 0;
}



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

using i64 = long long;
using P = pair<i64, i64>;

#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()

const string YES = "Yes";
const string NO = "No";

void solve(std::string S, std::string T){
    bool flag = true;
    rep(i, S.length()) if(S[i] != T[i]) flag = false;
    if(flag) cout << YES << endl;
    else cout << NO << endl;
}

struct IoSetup {
    IoSetup() {
        // cin.tie(nullptr);
        // ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


Measured memory_bytes: 3620
#include <stdio.h>
#include <string.h>

void SGet(int Num, char s[][11]);
int Hantei(int junban, int N, int M, char s1[][11], char s2[][11]);

int main(){

	int N,M;
	char s1[100][11] = {0};
	char s2[100][11] = {0};
	int sum = 0;
	int maxsum = 0;

	scanf("%d",&N);
	SGet(N,s1);
	scanf("%d",&M);
	SGet(M,s2);

	for(int i = 0; i < N; i++){
		sum = Hantei(i, N, M, s1, s2);
		if(sum > maxsum) maxsum = sum;
	}

	printf("%d",maxsum);

	return 0;
}

void SGet(int Num, char s[][11]){
	for(int i = 0; i < Num; i++){
			scanf("%s",&s[i]);
	}
}

int Hantei(int junban, int N, int M, char s1[][11], char s2[][11]){
	int sum = 0;
	char buf[11];
	strcpy(buf,s1[junban]);

	for(int i = 0; i < N; i++){
		if((strcmp(buf,s1[i])) == 0){
			sum++;
		}
	}
	for(int j = 0; j < M; j++){
		if((strcmp(buf,s2[j])) == 0){
			sum--;
		}
	}


	return sum;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

struct uftree{
	int par[200005];
	int rank[200005];
	int cnt[200005];
	int sz[200005];
	uftree(){
	}
	void init(int n){
		for(int i=0;i<n;i++){
			par[i]=i;
			rank[i]=0;
			cnt[i]=0;
			sz[i]=1;
		}
	}
	int find(int x){
		if(par[x]==x)return x;
		return par[x]=find(par[x]);
	}

	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y)return;
		if(rank[x]<rank[y]){
			par[x]=y;
			cnt[y]+=cnt[x];
			sz[y]+=sz[x];
		}else{
			if(rank[x]==rank[y])rank[x]++;
			par[y]=x;
			cnt[x]+=cnt[y];
			sz[x]+=sz[y];
		}
	}

	bool same(int x,int y){
		return find(x)==find(y);
	}
};

struct edge{
	int f,t,w;
	edge(){}
	edge(int ff,int tt,int ww){
		f=ff;
		t=tt;
		w=ww;
	}
	bool operator<(const edge &e)const{
		return w>e.w;
	}
};

uftree uf;
int n,h,w;
edge e[100005];

int main(void){
	scanf("%d%d%d",&n,&h,&w);
	uf.init(h+w);
	for(int i=0;i<n;i++){
		scanf("%d%d%d",&e[i].f,&e[i].t,&e[i].w);
		e[i].f--;
		e[i].t--;
		e[i].t+=h;
	}
	sort(e,e+n);
	ll ans=0;
	for(int i=0;i<n;i++){
		int f=uf.find(e[i].f);
		int t=uf.find(e[i].t);
		if(f==t){
			if(uf.cnt[f]-uf.sz[f]>=0){
				continue;
			}else{
				uf.cnt[f]++;
				ans+=e[i].w;
			}
		}else{
			if(uf.cnt[f]-uf.sz[f]+uf.cnt[t]-uf.sz[t]>=0){
				continue;
			}else{
				uf.unite(f,t);
				ans+=e[i].w;
				uf.cnt[uf.find(f)]++;
			}
		}
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 4480
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int me = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int farA = Math.abs(me - a);
		int farB = Math.abs(me - b);
		System.out.println(farA < farB ? "A" : "B");
	}
}


Measured memory_bytes: 21844
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int n,ans=0;
  std::cin >> n;
  ll a[n];
  for(int i=0; i<n; i++) std::cin >> a[i];
  sort(a,a+n);
  for(int i=0; i<n; i++){
    int cnt=1;
    while(a[i]==a[i+1]){
      cnt++;
      i++;
    }
    ans+=cnt%2;
  }

  std::cout << ans << '\n';

  return 0;
}


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

using ll = long long;
using ld = long double;
using P = pair<int, int>;
//using P = pair<double, double>;
using edge = struct {int to; ll cost;};

#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) (a).begin(), (a).end()

const int di[] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int dj[] = {0, -1, 0, 1, 1, -1, 1, -1};
const int INF = 1e9+100;
const ll INF64 = 7e18l;
const int mod = 1000000007;

struct prime
{
  vector<bool> num;
  prime(int n) : num(n+1, true)
  {
    num[0] = false;
    num[1] = false;
    for(int i = 2; i <= n; i++) {
      if(num[i]) {
        for(int j = 2; i*j <= n; j++) num[i*j] = false;
      }
    }
  }
  bool isPrime(int x)
  {
    return num[x];
  }
};
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};
struct combination
{
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1)
  {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i)
      fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i)
      ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k)
  {
    if (k < 0 || k > n)
      return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

long long gcd(long long a, long long b)
{
  if (a < b)
    swap(a, b);
  while (true)
  {
    if (a % b == 0ll)
      break;
    ll _a = a;
    a = b;
    b = _a % b;
  }
  return b;
}

long long lcm(long long a, long long b)
{
  return (max(a, b) / gcd(a, b)) * min(a, b);
}

void solve()
{
  string s;
  int k;
  cin >> s >> k;
  int n = s.length();
  set<string> substr;
  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= n-i; j++){
      if(j > k) break;
      substr.insert(s.substr(i, j));
    }
  }
  int i = 1;
  for(auto x : substr) {
    if(i == k){
      cout << x << "\n";
      return;
    }
    i++;
  }
}

int main()
{
  solve();
  return 0;
}

Measured memory_bytes: 1664
#include <stdio.h>
int main(void){
    int n, a[100000+5];
    scanf("%d", &n);
    for(int i=0; i<n; i++)scanf("%d", &a[i]);
    
    int ans=0;
    for(int i=0; i<n; i++){
        ans++;
        while(a[i]==a[i+1] && i+1<n)i++;
        if(a[i]<a[i+1])while(a[i]<=a[i+1])i++;
        else while(a[i]>=a[i+1])i++;
        
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 2108
import numpy as np
Q = int(input())

p = np.array([i for i in range(2*10**5+1)])
p[1]=0
for i in range(2,10**5):
    p[2*i::i] = 0
p = p[p!=0]

dic = {i:1 for i in p}
d = {}
for i in range(len(p)):
    if dic.get((p[i]+1)//2,0)==1:
        d[p[i]] = 1
sum_=0
arr = [0 for i in range(10**5+2)]
for i in range(10**5+2):
    arr[i] = sum_
    if d.get(i,0)==1:
        sum_+=1
for _ in range(Q):
    l,r = list(map(int,input().split()))
    print(arr[r+1]-arr[l])

Measured memory_bytes: 21752
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;

const int MAXN=20+1;
const int MAXM=20+1;

int n,m;
char mp[MAXN][MAXM];
int ans[MAXN][MAXM];

struct q_node
{
	int x,y,num;
};

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

void bfs(int x,int y)
{
	int vis[MAXN][MAXM];
	memset(vis,0,sizeof(vis));
	queue<q_node> q;
	
	q_node head;
	head.x=x,head.y=y,head.num=0;
	vis[x][y]=1;
	q.push(head);
	
	while(!q.empty())
	{
		q_node tmp=q.front();
		for(int i=1; i<=4; i++)
		{
			q_node next;
			next.x=tmp.x+dx[i];
			next.y=tmp.y+dy[i];
			next.num=tmp.num+1;
			
			if(next.x<=n && next.x>=1&& next.y<=m && next.y>=1
			&& !vis[next.x][next.y]&& mp[next.x][next.y]=='.')
			{
				vis[next.x][next.y]=1;
				q.push(next);
				ans[next.x][next.y]=max(ans[next.x][next.y],next.num);
			}
		}
		
		q.pop();
	}
}

int main()
{
	cin>>n>>m;
	
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			cin>>mp[i][j];
	
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			if(mp[i][j]=='.')
				bfs(i,j);
				
	int res=0;
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			res=max(res,ans[i][j]);
	
	cout<<res<< endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int sum = 0;
  for(int i = 0;i<=a;i++){
    int d = i/10000+i%10000/1000+i%1000/100+i%100/10+i%10;
    if(b<=d&&d<=c){
      sum += i;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
struct Node{
  int parent,left,right;
};
Node T[100005];
int n,D[1000005],hei[1000005];

void Preorder(int pp){
  if(pp==-1)return;
  cout<<" "<<pp;
  Preorder(T[pp].left);
  Preorder(T[pp].right);
}


void Inorder(int in){
  if(in==-1)return;
  Inorder(T[in].left);
  cout<<" "<<in;
  Inorder(T[in].right);
}

void Postorder(int po){
  if(po==-1)return;
  Postorder(T[po].left);
  Postorder(T[po].right);
  cout<<" "<<po;
}
int main(){
  int i=0,j=0,k=0,c=0,l=0,r=0,Tc=0;
  int id=0;
  cin>>n;
  for( i=0;i<n;i++){
    T[i].parent=T[i].left=T[i].right=-1;
  }
  for(i=0;i<n;i++){
    cin>>id>>l>>r;
    T[id].right=r;
    if(r!=-1)T[r].parent=id;
    T[id].left=l;
    if(l!=-1)T[l].parent=id;
  }
  for(i=0;i<n;i++){
    if(T[i].parent==-1){
      Tc=i;
    }
  }
  cout<<"Preorder"<<endl;
  Preorder(Tc);
  cout<<endl;
  cout<<"Inorder"<<endl;
  Inorder(Tc);
  cout<<endl;
  cout<<"Postorder"<<endl;
  Postorder(Tc);
  cout<<endl;
  return 0;
}



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

int main(){
    int N;
    cin >> N;
    static int num[2][200001];
    for(int k=0; k<2; k++) for(int i=0; i<N; i++){
        int a;
        cin >> a;
        num[k][a]++;
    }
    vector<int> ord;
    for(int i=1; i<=N; i++) ord.push_back(i);
    // 前ほどBが多い
    sort(ord.begin(), ord.end(), [&](int i, int j){ return num[0][i]-num[1][i] < num[0][j]-num[1][j]; });

    int offset = 0;
    vector<int> V[2];
    for(int i : ord){
        int l0 = V[0].size(), l1 = V[1].size();
        int r0 = l0 + num[0][i], r1 = l1 + num[1][i];
        offset = max(offset, min(r0, r1) - max(l0, l1));
        for(int k=0; k<2; k++) for(int t=0; t<num[k][i]; t++) V[k].push_back(i);
    }

    rotate(V[1].begin(), V[1].end()-offset, V[1].end());

    vector<pair<int, int>> ans(N);
    for(int i=0; i<N; i++){
        if(V[0][i] == V[1][i]){
            cout << "No" << endl;
            return 0;
        }
        ans[i] = {V[0][i], V[1][i]};
    }

    cout << "Yes" << endl;
    sort(ans.begin(), ans.end());
    for(int i=0; i<N; i++) cout << ans[i].second << " \n"[i==N-1];
    return 0;
}


Measured memory_bytes: 8912
#include<bits/stdc++.h>
#define pb push_back
#define PI acos(-1)
#define mp make_pair
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sdl(x) scanf("%lld",&x)
#define sd2l(x,y) scanf("%lld%lld",&x,&y)
#define maxn 100010
#define S second
#define ll long long int
#define inf 1000000014
#define infl (ll)(1e18+1)
#define mod 1000000007
#define clrs(x) memset(x,0,sizeof x)
#define sz(x) (int) x.size()
#define pi pair< int,int >
#define pii pair<pi,int>
#define pu push
#define ld long double
#define trace1(x)  cerr << #x << ": " << x << endl
#define trace2(x, y)  cerr << #x << ": " << x << " | " << #y << ": " << y << endl
using namespace std;
int arr[maxn];
int ans[maxn];
int cnt[maxn];
int main(int argc, char const *argv[])
{
   // freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int n;
    sd(n);
    ans[0]=1;
    for (int i = 1; i <= n; ++i)
    {
        sd(arr[i]);
        cnt[arr[i]]++;
        ans[i] = (ans[i-1]*2)%mod;
    }
    if(n%2==0){
    int fl = 0;
    for(int i=0;i<=n;i++)
    {
        if(cnt[i]!=2 && cnt[i]!=0)
        {
            fl = 1;
            break;
        }
    }
    if(fl)
        puts("0");
    else
        printf("%d\n",ans[n/2]);
    }
    else
    {
    int fl = 0;
    for(int i=1;i<=n;i++)
    {
        if(cnt[i]!=2 && cnt[i]!=0)
        {
            fl = 1;
            break;
        }
    }
    if(fl)
        puts("0");
    else
    {
        if(cnt[0]==1)
            printf("%d\n",ans[n/2]);
        else
            puts("0");
    }  
    }
    return 0;
}

Measured memory_bytes: 1408
import java.util.*;

public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main() {
		new AOJ0655().doIt();
	}
	
	class AOJ0655{
		void doIt(){
			int n = in.nextInt();
			Team team[] = new Team[n];
			for(int i=0;i<n;i++)team[i] = new Team();
			int limit = (n*n-n)/2;
			for(int i=0;i<limit;i++){
				int a = in.nextInt(),b = in.nextInt();
				int c = in.nextInt(),d = in.nextInt();
				if(c>d)team[a-1].win+=3;
				else if(c<d)team[b-1].win+=3;
				else{
					team[a-1].win++;
					team[b-1].win++;
				}
			}
			int result[] = new int[n];
			//自分より上に何人いるか数える
			for(int i=0;i<n;i++){
				int cnt = 1;
				for(int s=0;s<n;s++)if(team[i].win<team[s].win)cnt++;
				result[i] = cnt;
			}
			for(int i=0;i<n;i++)System.out.println(result[i]);
		}
		class Team{
			int win;
			public Team() {
				this.win=0;
			}
		}
	}
}

Measured memory_bytes: 42036
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using vi = vector<int>;
using vv = vector<vi>;

int main(){
    int n;
    string x;
    cin>>n>>x;
    
    int popx = 0;
    rep(i,n)if(x[i]=='1')popx++;
    
    if(popx==0){
        rep(i,n)cout<<1<<endl;
        return 0;
    }
    
    vi popn(2,0);
    
    popn[0] = popx+1;
    popn[1] = popx-1;
    
    vv modpop(2, vi (n, 0));
    
    modpop[0][n-1] = 1%popn[0];
    if(popn[1]!=0)modpop[1][n-1] = 1%popn[1];
    
    for(int i=n-2; i>=0; i--){
        modpop[0][i] = 2*modpop[0][i+1]%popn[0];
        if(popn[1]!=0)modpop[1][i] = 2*modpop[1][i+1]%popn[1];
    }
    
    vi count(2,0);
    
    for(int i=0; i<n; i++){
        if(x[i]=='1'){
            count[0] += modpop[0][i];
            count[1] += modpop[1][i];
            count[0] %= popn[0];
            if(popn[1]!=0)count[1] %= popn[1];
        }
    }
    
    for(int j=0; j<n; j++){
        int c = 0;
        if(x[j]=='1')c = 1;
        
        if(popn[1]==0 && c==1){
            cout<<0<<endl;
            continue;
        }
        
        int num = (count[c] + popn[c] + (1-2*c)*modpop[c][j])%popn[c];
        int ans = 1;
        
        while(num){
            int p = 0;
            int b = num;
            while(b){
                p += (b&1);
                b /= 2;
            }
            num %= p;
            ans++;
        }
        
        cout << ans << endl;
    }
    
    return 0;
}

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

#define rep(i,n) for (int i=0;i<(n);++i)
#define rep2(i,a,b) for (int i=(a);i<(b);++i)
#define rrep(i,n) for (int i=(n)-1;i>=0;--i)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;--i)
#define chmin(a,b) (a)=min((a),(b));
#define chmax(a,b) (a)=max((a),(b));
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) cout<<(#v)<<":";for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;
#define printVS(vs) cout<<(#vs)<<":"<<endl;for(auto(s):(vs)){cout<<(s)<< endl;}
#define printVV(vv) cout<<(#vv)<<":"<<endl;for(auto(v):(vv)){for(auto(x):(v)){cout<<" "<<(x);}cout<<endl;}
#define printP(p) cout<<(#p)<<(p).first<<" "<<(p).second<<endl;
#define printVP(vp) cout<<(#vp)<<":"<<endl;for(auto(p):(vp)){cout<<(p).first<<" "<<(p).second<<endl;}

inline void output(){ cout << endl; }
template<typename First, typename... Rest>
inline void output(const First& first, const Rest&... rest) {
    cout << first << " "; output(rest...);
}

using ll = long long;
using Pii = pair<int, int>;
using TUPLE = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
const int inf = 1e9;
const int mod = 1e9 + 9;
using Graph = vector<vector<int>>;

class UnionFind {
private:
    const int n;
    vector<int> uni;
public:
    UnionFind(int _n) : n(_n), uni(_n, -1) {}
    int root(int x) {
        if (uni[x] < 0) return x;
        return uni[x] = root(uni[x]);
    }
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (uni[x] > uni[y]) swap(x, y);
        uni[x] += uni[y];
        uni[y] = x;
        return true;
    }
    void print() {
        for (auto x : uni) cout << x << " ";
        cout << endl;
    }
};

struct edge {
    int from, to, cost;
    edge(){}
    edge(int _from, int _to, int _cost) : from(_from), to(_to), cost(_cost) {}
    bool operator< (const edge& e) const {
        return cost == e.cost ? (from == e.from ? to < e.to : from < e.from) : cost < e.cost;
    }
};

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

    int n, m;
    cin >> n >> m;
    vector<edge> edges;
    rep(i, m) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        edges.emplace_back(a, b, c);
    }

    sort(all(edges));

    int W = 0;
    vector<edge> T;
    UnionFind uf(n);
    rep(i, edges.size()) {
        if (uf.unite(edges[i].from, edges[i].to)) {
            W += edges[i].cost;
            T.emplace_back(edges[i]);
        }
    }

    int num = 0, sm = 0;
    for (auto e : T) {
        UnionFind uf(n);
        int w = 0, ne = 0;
        rep(i, edges.size()) {
            if ((edges[i] < e || e < edges[i]) && uf.unite(edges[i].from, edges[i].to)) {
                w += edges[i].cost;
                ne++;
            }
        }
        if (ne < n - 1 || w > W) {
            num++;
            sm += e.cost;
        }
    }

    cout << num << " " << sm << endl;
}

Measured memory_bytes: 4564
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define FAST {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pll pair<ll,ll>
#define LB lower_bound
#define UB upper_bound
#define endl "\n"
using namespace std;
ll dist(string &a,string &b)
{
    int n=a.length();
    int res=0;
    f(i,0,n) if(a[i]!=b[i]) res++;
    return res;
}
int main()
{
    FAST
    string s,t;
    cin>>s>>t;
    ll ans = INT_MAX;
    int n=s.length(),m=t.length();
    for(int i=0;i+m-1<n;i++)
    {
        string temp = s.substr(i,m);
        ans = min(ans,dist(t,temp));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3660
X = input()
a = []

for v in X:
    if v == 'S':
        a.append(v)
    if v == 'T':
        if len(a) == 0 or a[-1] == 'T':
            a.append(v)
        elif a[-1] == 'S':
            assert a.pop()

print(len(a))

Measured memory_bytes: 5096
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

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

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	H, _ := sc.nextInt(), sc.nextInt()
	for i := 0; i < H; i++ {
		str := sc.nextStr()
		for j := 0; j < 2; j++ {
			fmt.Fprintln(wtr, str)
		}
	}

	wtr.Flush()
}


Measured memory_bytes: 640
M=[0,31,28,31,30,31,30,31,31,30,31,30]
def L(y,m):
  if m<=2: y-=1
  return y/4-y/100+y/400+sum(M[:m])
while 1:
  x=map(int,raw_input().split(" "))
  if x==[-1]*6: break
  a,b,c,d,e,f=x
  print (d-a)*365+f-c+L(d,e)-L(a,b)

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

int main(){
    uint_fast32_t N;
    scanf("%u", &N);

    array<uint_fast32_t, 3> now({0, 0, 0}), prev({0, 0, 0});

    for(auto i = 0, a = 0, b = 0, c = 0; i < N; ++i){
        scanf("%d%d%d", &a, &b, &c);

        swap(now, prev);

        now[0] = max(prev[1], prev[2]) + a;
        now[1] = max(prev[2], prev[0]) + b;
        now[2] = max(prev[0], prev[1]) + c;
    }

    printf("%d\n", *max_element(now.begin(), now.end()));

    return 0;
}

Measured memory_bytes: 256
//
// Created by Naman Bhalla on 2019-03-23.
//

#include <cstdio>
#include <algorithm>
#include <string>
#include <iostream>

using namespace std;

int main(){
  	int n{0};
  	string s{};

  cin >> n >> s;

  long long int charsa[26] {};

  for(auto chars: s){
    charsa[chars - 'a']++;
  }

  long long int answer {1};

  for(auto vals: charsa){
  	answer *= (vals + 1);
  	answer= answer % (1000000007LL);
  }

  printf("%lld\n", answer -1);

 	return 0;
}

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

using namespace std;
using ll = long long;

#define REP(i,n) for(ll i=0; (i)<(n); ++(i))

ll binary(const ll s[], const ll x, const ll first, const ll last){
  if(last-first <= 1) return (s[first]!=x) ? 0 : 1;
  ll m = (last + first) / 2;
  if(s[m] < x) return binary(s, x, m+1, last);
  else if(s[m] > x) return binary(s, x, first, m);
  else if(s[m] == x) return 1;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  ll n; cin >> n;
  ll s[n]; REP(i,n) cin >> s[i];
  ll q; cin >> q;
  ll t[q]; REP(i,q) cin >> t[i];
  
  ll res = 0;
  for(ll x : t){
    res += binary(s,x,0,n-1);
  }
  
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 4264
#include <stdio.h>
#include <stdlib.h>

int main(){
    int M[101][101];
    int i = 0;
    int j = 0;
    int n  =0;
    scanf("%d", &n);

    for(i=0; i<n; i++){
        for(j=0; j<n; j++){
            M[i][j] = 99999999;
            if(i == j) M[i][j] = 0;
        }
    }

    int id, p, g, v;
    for(i=0; i<n; i++){
        scanf("%d", &id);
        scanf("%d", &p);
        for(j=0; j<p; j++){
            scanf("%d %d", &g, &v);
            M[id][g] = v;
        }
    }

    for(i=0; i<n; i++){
        for(j=0; j<n; j++){
            for(p=0; p<n; p++){
                if(M[j][p] > M[j][i]+M[i][p]){
                    M[j][p] = M[j][i]+M[i][p];
                }
            }
        }
    }

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

    return 0;
}



Measured memory_bytes: 2084
using System;
class abc148_c{
  public static void Main(){
    String[] str = Console.ReadLine().Split(' ');
    long a = int.Parse(str[0]);
    long b = int.Parse(str[1]);
    if(a < b){
      swap(ref a, ref b);
    }
    long gcd = calc_gcd(a,b);
    Console.WriteLine(a/gcd * b/gcd * gcd);
  }
  public static long calc_gcd(long n, long m){
    while(true){
      if(n%m == 0){
        break;
      }
      else{
        long a = n/m;
        long b = n - m*a;
        n = m;
        m = b;
      }
    }
    return m;
  }
  public static void swap(ref long x, ref long y){
    long temp = x;
    x = y;
    y = temp;
  }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i < n; i++)
#define rep3(i, n) for(int i = n-1; i >= 0; i--)
#define rep4(i, x, n) for(int i = x; i > n; i--)
#define elif else if
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
const ll INF = 1e15;

int main(){
    int N;
    cin >> N;
    ll A[N];
    rep(i, N) cin >> A[i];
    map<ll, int> mp;
    sort(A, A+N, greater<ll>());
    rep(i, N){
        if(mp.count(A[i])) mp[A[i]]++;
        else mp.insert(P(A[i], 1));
    }
    ll M = A[0];
    ll e[40];
    e[0] = 1;
    rep2(i, 1, 40) e[i] = e[i-1]*2;
    int n = 0;
    while(M >= e[n]){
        if(M >= e[n+1]) n++;
        else break;
    }
    int j = 0;
    int pos[n+2];
    pos[n+1] = -1;
    rep3(i, n+1){
        while(j+1 < N && A[j+1] >= e[i]) j++;
        pos[i] = j;
    }
    ll count = 0;
    rep3(i, n+1){
        rep2(j, pos[i+1]+1, pos[i]+1){
            if(mp[A[j]]){
                ll k = e[i+1]-A[j];
                if(mp.count(k) && mp[k]){
                    if(k == A[j]){
                        if(mp[A[j]] >= 2){
                            count++;
                            mp[A[j]] -= 2;
                        }
                    }
                    else{
                        count++;
                        mp[A[j]]--;
                        mp[k]--;
                    }
                }
            }
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 14844
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <bitset>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define MAX 510000
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;



int main(){
    ll a,b,k; cin >> a >> b >> k;
    if(b-a <= 2*k-1){
        rep(i,b-a+1) cout << i+a << endl;
    }else{
        rep(i,k) cout << i+a << endl;
        rep(i,k) cout << b+i-k+1 << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>


#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long
//#define lint long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
int n;
int a,b;
int x[200000];
signed main(){
  cin >> n >> a >> b;
  REP(i,n) cin >> x[i];
  int ans = 0;
  REP(i,n-1){
    if((x[i+1]-x[i])*a>b) ans += b;
    else ans += (x[i+1]-x[i])*a;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
N, K = map(int, input().split())
h = list(map(int, input().split()))

# DPテーブル
dp = [10 ** 10] * N

# 初期値
dp[0] = 0

# ループ
for i in range(1, N):
    for j in range(1, K + 1):
        if i - j < 0:
            pass
        else:
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))

# 解を出力
print(dp[N - 1])

Measured memory_bytes: 52448
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String s = sc.next();

        if (a >= 3200) {
            System.out.println(s);
        } else {
            System.out.println("red");
        }
    }
}


Measured memory_bytes: 21716
#include<iostream>

using namespace std;

int main(){
  int k,x;
  
  cin >> k >> x;
  
  int min = x - k + 1;
  int max = x + k - 1;
  
  if(min < -1000000)min = -1000000;
  if(max > 1000000) max = 1000000;
  
  for(int i = min ; i <= max ; i++){
    cout << i << ' ';
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main (){
	
	int p,q,r;
	int min = 300;
	scanf("%d %d %d", &p, &q, &r);
	
	if(p + q < min ){
		min = p + q;
	}
	if (p + r < min){
		min = p + r;
	}
	if (q + r < min){
		min = q + r;
	}
	
	printf("%d", min);

	
	
	
	
	
	
	return 0;
}

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

int keta(int t){
    int cnt = 0;
    while(t){t/=10;cnt++;}
    return cnt;
}

int main()
{
    long long n;
    std::cin >> n;
    long long f,s;
    for(int i = std::sqrt(n); i >= 1; i--){
        if(n % i == 0){
            f = n / i;
            s = i;
            break;
        }
    }
    std::cout << std::max(keta(f),keta(s)) << std::endl;
    
}

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  int n; cin >> n;
  vector<string> s(n);
  rep(i,n) cin >> s[i];
  
  vector<int> cnt(4,0);
  cnt[0] = count(s.begin(),s.end(),"AC");
  cnt[1] = count(s.begin(),s.end(),"WA");
  cnt[2] = count(s.begin(),s.end(),"TLE");
  cnt[3] = count(s.begin(),s.end(),"RE");

  cout << "AC x " << cnt[0] << endl;
  cout << "WA x " << cnt[1] << endl;
  cout << "TLE x " << cnt[2] << endl;
  cout << "RE x " << cnt[3] << endl;
  
  return 0;
}


Measured memory_bytes: 6376
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int(i)=0;i<(n);i++)

int main(){
  int x,f=0;cin>>x;
  REP(i,10001) if(i*100<=x&&x<=i*105) f=1;
  cout<<f<<endl;
}

Measured memory_bytes: 256
url = "https://atcoder.jp//contests/abc069/tasks/arc080_a"

def main():
    s = int(input())
    t = list(map(int, input().split()))
    dic = {1: 0, 2: 0, 4: 0}

    for v in t:
        if v % 4 == 0:
            dic[4] += 1
        elif v % 2 == 0:
            dic[2] += 1
        else:
            dic[1] += 1
    if dic[1] <= dic[4]:
        print('Yes')
    elif dic[1] <= dic[4] + 1:
        if dic[2] != 0:
            print('No')
        else:
            print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()


Measured memory_bytes: 14252
void main() {
	auto s = rs.to!dstring;
	ulong res = ulong.max;
	foreach(dchar i; 'a'..'z'+1) {
		ulong cnt;
		auto tmp = s.to!(dchar[]);
		while(tmp.uniqcount != 1)
		{
			cnt++;
			foreach(c; 0..tmp.length-1) {
				dchar current = tmp[c];
				dchar next = tmp[c+1];
				if(next == i) tmp[c] = i;
			}
			tmp = tmp[0..$-1];
			if(cnt > 100) break;
		}
		res = min(res, cnt);
	}
	writeln(res);
}

ulong uniqcount(T)(T[] arr) {
	auto a = arr.deepcopy;
	return a.sort().uniq.array.length;
}

T[] deepcopy(T)(T[] a) {
	import std.traits : isArray;
	static if(isArray!T) {
		T[] res;
		foreach(i; a) {
			res ~= deepcopy(i);
		}
		return res;
	} else {
		return a.dup;
	}
}

unittest
{
	auto a = [[[1,2],[3,4]],[[5,6],[7,8]]];
	auto b = a.deepcopy;
	b[0][0][1] = 100;
	assert(a != b);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 1148
// ABC064_C
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;

#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define MIN(vec) min_element(vec.begin(), vec.end())  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(vec.begin(), vec.end())
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(vec.begin(), vec.end(), 0LL)  // 0 は初期値
#define pll pair<ll, ll>
#define F first
#define S second

int main() {
    // input
    ll N;
    cin >> N;
    vector<ll> vec(N), num(9, 0);
    REP(i, N) cin >> vec[i];
    
    // calculation
    REP(i, N) {
        if (vec[i] <= 399) {
            num[0]++;
        } else if (400 <= vec[i] && vec[i] <= 799) {
            num[1]++;
        }  else if (800 <= vec[i] && vec[i] <= 1199) {
            num[2]++;
        }  else if (1200 <= vec[i] && vec[i] <= 1599) {
            num[3]++;
        }  else if (1600 <= vec[i] && vec[i] <= 1999) {
            num[4]++;
        }  else if (2000 <= vec[i] && vec[i] <= 2399) {
            num[5]++;
        }  else if (2400 <= vec[i] && vec[i] <= 2799) {
            num[6]++;
        } else if (2800 <= vec[i] && vec[i] <= 3199) {
            num[7]++;
        } else {
            num[8]++;
        }
    }
    
    ll res = 0;
    REP(i, 8) {
        if (num[i] != 0) res++;
    }
    
    if (res == 0) {
        // 赤より大きい人しかいない
        cout << 1 << " " << num[8] << "\n";
    } else {
        cout << res << " " << res + num[8] << "\n";
    }
    
    return 0;
}

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

using namespace std;

#define MOD 1000000007

int n, p, ta;
long long cnt[2] = {1}, tb, tc;

int main() {
	scanf("%d%d", &n, &p);
	while (n--) {
		scanf("%d", &ta);
		tb = cnt[0], tc = cnt[1];
		if (ta & 1)
			swap(tb, tc);
		cnt[0] += tb;
		cnt[1] += tc;
	}
	printf("%lld\n", cnt[p]);
	return 0;
}

Measured memory_bytes: 256
X, Y = map(int, input().split())

if X == 1 and Y == 1:
    print(1000000)
else:
    ans = 0
    if X == 1:
        ans += 300000
    elif X == 2:
        ans += 200000
    elif X == 3:
        ans += 100000

    if Y == 1:
        ans += 300000
    elif Y == 2:
        ans += 200000
    elif Y == 3:
        ans += 100000

    print(ans)


Measured memory_bytes: 9124
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;

int main(){
    int K,N; cin >> K >> N;
    if (K*500>=N) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 888
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
typedef long double ld;

constexpr int INF = 1e9;
constexpr ll BIGINF = 1e18;
constexpr double EPS = 1e-16;
constexpr int MOD = 1e9 + 7;

void preambule() {
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
}

string s;

void input() {
  cin >> s;
}

void solve() {
  for (auto&& i : s) {
    if (i == '9')
      cout << 1;

    if (i == '1')
      cout << 9;
  }
}

int main() {
#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  preambule();
  input();
  solve();
}


Measured memory_bytes: 256
def preorder(idx):
    if idx == -1:
        return 
    left,right = tree[idx]
    print(' {}'.format(idx), end='')
    preorder(left)
    preorder(right)

def inorder(idx):
    if idx == -1:
        return 
    left,right = tree[idx]
    inorder(left)
    print(' {}'.format(idx),end='')
    inorder(right)

def postorder(idx):
    if idx == -1:
        return
    left,right = tree[idx]
    postorder(left)
    postorder(right)
    print(' {}'.format(idx),end='')

n = int(input())
tree = [None]*n
root = set(range(n))

for _ in range(n):
    idx,left,right = map(int,input().split())
    tree[idx] = (left,right)
    root -= set([left,right])
root_node = root.pop()

print("Preorder")
preorder(root_node)
print()

print("Inorder")
inorder(root_node)
print()

print("Postorder")
postorder(root_node)
print()


Measured memory_bytes: 5612
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}


int main(){
  
  int n;
  cin>>n;
  vector<int> l(2*n);
  REP(i,2*n){
    cin>>l[i];
  }
  sort(ALL(l));
  int ans = 0;
  REP(i,2*n){
    if(i%2 == 1)continue;
    ans += l[i];
  }
  cout<<ans<<endl;
  return 0; 
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
using ll = long long int;

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};
const int mod = 1E+09 + 7;
using modint = ModInt< mod >;

template< typename T >
struct Combination {
  vector< T > _fact, _rfact, _inv;

  Combination(int sz) : _fact(sz + 1), _rfact(sz + 1), _inv(sz + 1) {
    _fact[0] = _rfact[sz] = _inv[0] = 1;
    for(int i = 1; i <= sz; i++) _fact[i] = _fact[i - 1] * i;
    _rfact[sz] /= _fact[sz];
    for(int i = sz - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1);
    for(int i = 1; i <= sz; i++) _inv[i] = _rfact[i] * _fact[i - 1];
  }

  inline T fact(int k) const { return _fact[k]; }

  inline T rfact(int k) const { return _rfact[k]; }

  inline T inv(int k) const { return _inv[k]; }

  T P(int n, int r) const {
    if(r < 0 || n < r) return 0;
    return fact(n) * rfact(n - r);
  }

  T C(int p, int q) const {
    if(q < 0 || p < q) return 0;
    return fact(p) * rfact(q) * rfact(p - q);
  }

  T H(int n, int r) const {
    if(n < 0 || r < 0) return (0);
    return r == 0 ? 1 : C(n + r - 1, r);
  }
};


int main(){
    ll k;
    string s;
    cin >> k >> s;
    Combination<modint> COM(k + s.length());
    modint all = modint(26).pow(k + s.length());
    for(int i = 0; i < s.length(); i++){
        modint sub = COM.C(k + s.length(), i) * modint(25).pow(k + s.length() - i);
        all = all - sub;
    }
    cout << all << endl;
    return 0;
}

Measured memory_bytes: 27388
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>

#define MIN(x, y) (x < y ? x : y)
#define MAX(x, y) (x > y ? x : y)

using namespace std;


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

	cout << 48 - M << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <map>           // sorted map so O(logn)
#include <unordered_map> // O(1)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

int main()
{
    int a;
    cin >> a;
    int sum = a + (a * a) + (a * a * a);
    cout << sum << endl;
}

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

using namespace std;

#define fto(i, s, e) for(int i = s; i <= e; ++i)
#define fto1(i, s, e) for(int i = s; i < e; ++i)
#define fdto(i, s, e) for(int i = s; i >= e; --i)
#define fit(var, it) for(__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define frit(var, it) for(__typeof(var.rbegin()) it = var.rbegin(); it != var.rend(); ++it)

#define newl '\n'
#define debugt cerr << 0.001*clock() << newl
#define debug1(x, i) cout << #x << '[' << i << "] = " << x[i] << newl
#define debug(v, l, r) fto(_i, l, r) debug1(v, _i)
#define debug2(x, i, j) cout << #x << '[' << i << "][" << j << "] = " << x[i][j] << newl
#define debug3(x, i, j, k) cout << #x << '[' << i << "][" << j << "][" << k << "] = " << x[i][j][k] << newl

#define ll long long
#define ii pair<int, int>
#define ff first
#define ss second
#define pb push_back
#define glen(v) int((v).size())

template<typename T1, typename T2> ostream& operator<< (ostream &os, pair<T1, T2> const &v) {
	return os << '(' << v.ff << ", " << v.ss << ')';
}

#define eps 1e-15
#define oo 1000000007
#define OO 1000000000000000003LL
#define maxn 1003

int n, m;
int f[maxn][maxn];
char a[maxn][maxn];

int main() {
	#ifndef ONLINE_JUDGE
		//freopen("main.inp", "r", stdin);
		//freopen("main.out", "w", stdout);
	#endif
	//ios_base::sync_with_stdio(0); cin.tie(0);

	scanf("%d%d", &n, &m);

	fto (i, 1, n) {
		scanf("%*c");
		fto (j, 1, m) {
			scanf("%c", &a[i][j]);
		}
	}

	f[1][1] = 1;

	fto (j, 2, m) if (a[1][j] == '.') f[1][j] = f[1][j-1];
	fto (i, 2, n) if (a[i][1] == '.') f[i][1] = f[i-1][1];

	fto (i, 2, n) fto (j, 2, m) if (a[i][j] == '.') {
		f[i][j] = f[i-1][j] + f[i][j-1];
		f[i][j] %= oo;
	}

	printf("%d\n", f[n][m]);

	return 0;
}


Measured memory_bytes: 5120