akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <string>
#include <map>
#include <stack>

using namespace std;
int main(int argc, const char * argv[]) {
    
    int n;
    cin >> n;
    stack<int> s;
    while (n) {
        if (n%2) {
            s.push(1);
            n--;
        }
        else {
            s.push(0); 
        }
        n /= (-2);
    }
    if (s.empty()) cout << "0";
    
    while(!s.empty()) {
        cout << s.top();
        s.pop();
    }
        cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vec> mat;
ll mod=1e9+7;
vector<int> Era(int n){
    vector<int> is_prime(n,1),P;
    for(int i=2;i<=n;i++){
        if(is_prime[i]){
            for(int j=2*i;j<=n;j+=i) is_prime[j]=0;
            P.push_back(i);
        }
    }
    return P;
}
ll inv(ll a){
    ll n=mod-2,ans=1;
    while(n>0){
        if(n&1) ans=ans*a%mod;
        n=n/2;
        a=a*a%mod;
    }
    return ans;
}
ll pow_(ll n,ll m){
    ll ans=1;
    while(m>0){
        if(m&1) ans=ans*n%mod;
        m=m/2;
        n=n*n%mod;
    }
    return ans;
}
int main(){
    ll n,A[200001];
    cin>>n;
    rep(i,n) cin>>A[i];
    ll g=1;
    int num[1000001]={0};
    rep(i,n){
        int p=A[i];
        for(int j=2;j<=sqrt(p);j++){
            int a=0;
            if(p%j==0){
                while(p%j==0) a++,p=p/j;
            }
            num[j]=max(a,num[j]);
        }
        num[p]=max(1,num[p]);
    }
    rep(i,1000001)if(num[i]) g=g*pow_(i,num[i])%mod;
    ll ans=0;
    rep(i,n) ans=(ans+g*inv(A[i]))%mod;
    cout<<ans<<"\n";
}

Measured memory_bytes: 5632
// failed to generate code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())


int main(){	
	ll N;
	cin >> N;
	vector<ll> L(N), R(N);
	rep(i, N) {
		cin >> L[i] >> R[i];
		R[i]++;
	}
	
	ll res = 0;
	ll p = 0, q = INF;
	rep(i, N) {
		p = max(p, L[i]);
		q = min(q, R[i]);
	}

	if (N == 2) {
		cout << R[0]-L[0]+R[1]-L[1] << endl;
		return 0; 
	}


	vector<P> v;
	rep(i, N) {
		ll a = max(R[i]-p, 0LL), b = max(q-L[i], 0LL);
		v.emplace_back(a, -b);
	}
	SORT(v);
	// rep(i, N) {
	// 	cout << v[i].first << " " << v[i].second << endl;
	// }
	ll mb = INF;
	rep(i, N-1) {
		mb = min(mb, -v[i].second);
		res = max(res, v[i+1].first+mb);
	}

	rep(i, N) {
		res = max(res, max(q-p,0LL)+max(R[i]-L[i],0LL));
		// cout << i << " " << max(q-p,0LL)+max(R[i]-L[i],0LL) << endl;
	}
	// cout << res << endl;

	cout << res << endl;
}


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

using namespace std;

typedef long long ll;
const int _max = 501;

ll a, b, c, d;

map<ll, ll> Map;

ll solve(ll n) {
    if (n == 0) return 0;
    if (n == 1) return d;
    if (Map.count(n)) return Map[n];
    ll l2 = n / 2 * 2, r2 = (n + 1) / 2 * 2;
    ll l3 = n / 3 * 3, r3 = (n + 2) / 3 * 3;
    ll l5 = n / 5 * 5, r5 = (n + 4) / 5 * 5;
    ll res = 1e18;
    if (n < res / d) res = n * d;
    res = min(res, abs(l2 - n) * d + a + solve(l2 / 2));
    res = min(res, abs(r2 - n) * d + a + solve(r2 / 2));

    res = min(res, abs(l3 - n) * d + b + solve(l3 / 3));
    res = min(res, abs(r3 - n) * d + b + solve(r3 / 3));

    res = min(res, abs(l5 - n) * d + c + solve(l5 / 5));
    res = min(res, abs(r5 - n) * d + c + solve(r5 / 5));
    Map[n] = res;
    return res;
}

int main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; i++) {
        Map.clear();
        ll n;
        cin >> n >> a >> b >> c >> d;
        cout<<solve(n)<<endl;
    }

}

Measured memory_bytes: 4392
n, x = (int(i) for i in input().split(' '))
a = sorted([int(i) for i in input().split(' ')])

ch = 0 # 満足した子供の数
s = 0
for i in range(n):
    if x < a[i]:
        x = 0
    elif x >= a[i]:
        x -= a[i]
        ch += 1
        
if x > 0:
    ch = ch -1

print(ch)

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int a[100];
int main()
{
    int i;
    cin>>i;
    for(int j=0;j<i;j++){
        cin>>a[j];
    }
    int b;
    for(int j=0;j<i-1;j++){
        for(int m=j+1;m<i;m++){
            if(a[j]>a[m]){
                b=a[j];
                a[j]=a[m];
                a[m]=b;
            }
        }
    }
    int n=i;
    for(int j=0;j<i-1;j++){
        if(a[j]==a[j+1]){
            n--;
        }
    }
    cout<<n;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int> G[100010];
vector<int> d(100010);

int depth(int u){
	if(G[u].size()==0){
		return d[u]=0;
	}else if(d[u]!=-1){
		return d[u];
	}else{
		int ret=0;
		for(int v: G[u]){
			ret = max(depth(v),ret);
		}
		return d[u]= 1 + ret;
	}
}

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		d[i]=-1;

	for(int i=0;i<m;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		G[x].push_back(y);
	}
	
	int ans=0;
	for(int i=1;i<=n;i++){
		ans=max(ans,depth(i));
	}

	printf("%d",ans);


    return 0;
}

Measured memory_bytes: 8192
#include <iostream>

using namespace std;
bool solve(int a,int b, int c){
	if(a < b && b < c){
		return true;
	}
	if(a > b && b > c){
		return true;
	}
	return false;
}
int p[30];
int main(){
	int i,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> p[i];
	}
	int cnt = 0;
	for(i=1;i<n - 1;i++){
		if(solve(p[i-1],p[i],p[i+1])) cnt++;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4765
const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  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 c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
mint f2(int n, int k) {
  return comb(n+k-1,k-1);
}
mint f(int n, int k) {
  if (n < k) return 0;
  if (n == 0 && k == 0) return 1;
  if (k < 1) return 0;
  return f2(n-k,k);
}
 
int main() {
  init();
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    mint blue = f(k,i);
    mint red = f2(n-k-(i-1),i+1);
    mint ans = blue*red;
    printf("%lld\n", ans.x);
  }
  return 0;
}

Measured memory_bytes: 125568
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip> //fixed << setprecision(10)
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
 
typedef long long ll;
typedef vector<int> vi;
 
int main(){
    ll n, a, b;
    cin >> n >> a >> b;

    ll ans = 0, cnt = 0;
    /*
    while(cnt < n){
        cnt += a;
        cnt += b;
        ans += a;
    }
    */
    ans = a*(n/(a+b));
    ll sum = (a+b)*(n/(a+b));
    if(n%(a+b) != 0){
        ans += a;
        sum += a;
        if(sum > n){
            ans -= (sum - n);
        }
    }
    cout << ans << endl;

    return 0;
}

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

using namespace std;

int n, k, m = 0, ans;

int calc(int x) {
	return (x + k - 2) / (k - 1);
}

int main() {
//	freopen("input.txt", "r", stdin);
	ios::sync_with_stdio(false);
	cin >> n >> k;
	for (int i = 1; i <= n; ++i) {
		int x;
		cin >> x;
		if (x == 1)
			m = i;
	}
	ans = calc(m - 1) + calc(n - m);
	for (int i = max(1, m - k + 1); i <= m && i + k - 1 <= n; ++i)
		ans = min(ans, 1 + calc(i - 1) + calc(n - i - k + 1));
	cout << ans << endl;
//	cerr << clock() << endl;
	return 0;
}



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

int main() {

    int n;
    cin>>n;
vector<int>h(n);
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
vector<int>sol(n,INT_MAX);
  


 sol[0]=0;
 
 
    for(int i=0;i<n;++i){
   for(int j:{i+1,i+2}){
       if(j<n){
           sol[j]=min(sol[j],   sol[i]+ abs(h[j]-h[i])   );
       }
   }
 
 

        
    }
    cout<<sol[n-1];
  




	return 0;
}


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

int Exp(long long int exp_n,long long int exp_e, long long exp_mod);


int main(){
  long long int N,M,K;
  cin >> N >> M >> K;
  long long int A[N+1], B[M+1];
  A[0]=0;
  B[0]=0;
  long long int C=N;
  
  for(long long int i=1;i<N+1;i++){
    cin >> A[i];
    A[i] = A[i]+A[i-1];
    if(C==N && A[i]>K){
      C = i-1;
    }
  }

  for(long long int i=1;i<M+1;i++){
    cin >> B[i];
    B[i] = B[i]+B[i-1];
  }
  long long int D=0;
  while(A[C] + B[D+1]<=K && D<M){
    D++;
  }
  //cout << C << ":" << D << endl;
  long long int Max = C+D;
  for(long long int i=1;i<C+1;i++){
    while(A[C-i]+B[D+1]<=K){
      if(D==M){
        break;
      }
      D++;
    }
    //cout << C-i << ":" << D << endl;
    Max = max(Max, C-i+D);
  }
cout << Max <<endl;
  return 0;
}


int Exp(long long int exp_n,long long int exp_e, long long int exp_mod){
  long long int exp_o = 1;
  long long int exp_x=exp_n;
  long long int exp_tmp;
  
  while(0<exp_e){
    exp_tmp = exp_e/2;
    if(exp_e - exp_tmp*2 == 1){
      exp_o = exp_o*exp_x;
      if(exp_o>exp_mod){
        exp_o=exp_o%exp_mod;
      }
    }
    
    exp_x = exp_x*exp_x;
    if(exp_x>exp_mod){
      exp_x=exp_x%exp_mod;
    }
    exp_e = exp_tmp;
  }
  return exp_o;
}


Measured memory_bytes: 6748
program sample
    implicit none
    character(50)::s,t
    character::a
    integer(8) :: i,j,m,n,h,w
    integer(8),allocatable :: x(:,:),y(:)
    read(*,*)h,w
    allocate(x(0:h+1,0:w+1))
    x(:, :)=0
    do i=1,h
        read(*,*) s
        do j=1,w
            if (s(j:j) .eq. '#')then
                x(i,j)=-10
                x(i-1,j-1)=x(i-1,j-1)+1
                x(i,j-1)=x(i,j-1)+1
                x(i+1,j-1)=x(i+1,j-1)+1
                x(i-1,j)=x(i-1,j)+1
                x(i+1,j)=x(i+1,j)+1
                x(i-1,j+1)=x(i-1,j+1)+1
                x(i,j+1)=x(i,j+1)+1
                x(i+1,j+1)=x(i+1,j+1)+1
            end if
        end do
    end do
    do i=1,h
        t='0'
        do j=1,w
            if(x(i,j)<0)then
                t(j:j)='#'
            else
                write(a,'(i1)')x(i,j)
                t(j:j)=a
            end if

        end do
        write(*,'(a)') t

    end do

    
   
  
    stop
end program sample
  



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

// #include<cstdio>

int main(){
  int H, W;

  while(1){
    cin >> H >> W;
    if (H==0 && W==0) break;

  for (int j=0; j<H; j++){
    for (int i=0; i<W; i++){
      cout << '#';
    }
    cout << "\n";
  }
  cout << "\n";
  
  }

  return 0;
}

Measured memory_bytes: 2984
using System;
using System.Linq;

class Program {
  static void Main() {
    var arr = Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToArray();
    int k = int.Parse(Console.ReadLine());
    arr[0] = arr[0] * (int)Math.Pow(2, k);
    Console.WriteLine(arr.Sum());
  }
}

Measured memory_bytes: 13396
using System;
using static System.Console;

namespace abc168
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(ReadLine());
            WriteLine(Kazu(n));
        }
        static string Kazu(int n)
        {
            switch (n % 10)
            {
                case 3:
                    return "bon";
                case 0:
                case 1:
                case 6:
                case 8:
                    return "pon";
                default:
                    return "hon";
            }
        }
    }
}


Measured memory_bytes: 27212
#include<stdio.h>
int main(void)
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    
    if(a>=b){
        printf("No\n");
    }else if(b>=c){
        printf("No\n");
    }else if(a>=c){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
    return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < N; i++)
using namespace std;
int main()
{
    string S;
    cin >> S;
    vector<char> T(S.size());
    rep(i, S.size())
    {
        if (i % 2 == 0)
        {
            T[i] = '1';
        }
        else
        {
            T[i] = '0';
        }
    }
    int count = 0;
    rep(i, S.size())
    {
        if (S[i] != T[i])
        {
            count++;
        }
    }
    int A = S.size() - count;
    cout << min(count, A) << endl;
}


Measured memory_bytes: 512
S=list(input())
N=len(S)

for i in range(N):
  if S[i]!=S[N-i-1]:
    print("No")
    exit()
    
for i in range((N-1)//2):
  if S[i]!=S[(N-1)//2-i-1]:
    print("No")
    exit()
    
for i in range((N-1)//2):
  if S[(N+3)//2+i-1]!=S[N-i-1]:
    print("No")
    exit()
    
print("Yes")

Measured memory_bytes: 3064
N=int(input())
A=list(map(int,input().split()))
a=0
for i in range(N):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            a=0
        else:
            a=1
            break
if a==1:
    print("DENIED")
else:
    print("APPROVED")

Measured memory_bytes: 3060
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
    string c;
	getline(cin,c);
	printf("%c%d%c",c[0],c.length()-2,c[c.length()-1]);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define lson l,mid,p<<1
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
using namespace std;
const int inf=1e9+10;
const int mod=1e9+7;
const int maxn=1e5+10;
ll a,b,c;
int main(){
	//ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	cin>>a>>b>>c;
	if(c-a-b>=0&&4*a*b<(c-a-b)*(c-a-b)) puts("Yes");
	else puts("No");
	return 0;
}
//2*sqrt(ab)<c-a-b

Measured memory_bytes: 384
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<iostream>
#include<map>
#include<cstring>
#define INF 0x3f3f3f3f
#define eps 1e-10
using namespace std;
string s,t;
long long ans,a=0,inx=0,maxn=-1,now=0,b=0;
int main(){
    cin>>s>>t;
    ans=t.size();
    for(int i=0;i<s.size();i++){
        now=0;
        for(int j=0;j<t.size();j++){
            if(i+j>=s.size()){
                b=1;
                break;
            }
            if(s[i+j]==t[j])
                now++;
        }
        if(b)
            break;
        maxn=max(now,maxn);
    }
    ans=t.size()-maxn;
    printf("%lld",ans);
}


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

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,n) for(int i = 1; i < n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

  int n, m;
  cin >> n >> m;
  vi h(n);
  rep(i,n) cin >> h[i];
  vector<set<int>> tree(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    tree[a].insert(b);
    tree[b].insert(a);
  }
  int ans = 0;
  rep(i,n) {
    bool ok = true;
    for(auto it = tree[i].begin(); it != tree[i].end(); it++) {
      if(h[i] <= h[*it]) ok = false;
    }
    ans += ok;
  }
  cout << ans << endl;
}

Measured memory_bytes: 17704
#include <stdio.h>


#define infty 500000
#define whi 0
#define gry 1
#define bla 2

static const int MAX = 500; 
static const int INFTY = (1<<21);



int impossiblemission(int key,int kazu1,int *stuff1){
  int left=0,right=kazu1,mid;
  while(left<right){
    mid=(left+right)/2;
    if(stuff1[mid]==key){
      return 1;
    }
    else if(key<stuff1[mid]){
      right=mid;
    }
    else {
      left=mid+1;
    }
  }
  return 0;
}

int prim(){
  int qwerty[MAX][MAX];
  int nk,abc[MAX][MAX];
  int uni,minvmin;
  int doctor[MAX],parent[MAX],cocoichi[MAX];

  for(int i=1;i<=nk;i++){
    doctor[i]=infty;
    parent[i]=-1;
    cocoichi[i]=whi;
  }

  doctor[1]=0;
  while(1){
    minvmin=infty;
    uni=-1;
    for(int i=1;i<=nk;i++){
      if(minvmin>doctor[i] && cocoichi[i] != bla){
	uni=i;
	minvmin=doctor[i];
      }
    }
    if(uni==-1)break;
    cocoichi[uni]=bla;
    for(int v=1;v<=nk;v++){
      if(cocoichi[v]!=bla && abc[uni][v]!=infty){
	if(doctor[v]>abc[uni][v]){
	  doctor[v]=abc[uni][v];
	  parent[v]=uni;
	  cocoichi[v]=gry;
	}
      }
    }
  }
  int sum=0;
  for(int i=1;i<=nk;i++){
    if(parent[i]!=-1){
      sum=sum+abc[i][parent[i]];
    }
  }
  return sum;
}

int main(void){ 
  int n, i, j; 
  int M[MAX][MAX]; 
  int d[MAX]; 
  int tmp[MAX]; 
  int m; 
  int u, k, c, v;

  
  scanf("%d", &n);
  for ( i = 0; i< n; i++ ){ 
    for ( j = 0; j < n; j++ ){ 
      M[i][j] = 0; 
    } 
  } 
  for ( i = 0; i< n; i++ ){ 
    for ( j = 0; j < n; j++ ){ 
      M[i][j] = INFTY; 
    } 
  } 
  for ( i = 0; i < n; i++ ){ 
    scanf("%d %d", &u, &k); 
    for ( j = 0; j < k; j++ ){ 
      scanf("%d %d", &v, &c); 
      M[u][v] = c; 
    } 
  } 
  for( i=0; i<n; i++ ){ 
    tmp[i]=0; d[i]=INFTY; 
  } 
  d[0]=0; m=INFTY; 
  while(1){ m=INFTY; u=-1; 
    for( i=0; i<n; i++ ){ 
      if(d[i]<m){
	if(tmp[i]==0){
	  u=i; 
	  m=d[i];
	}
      } 
    } 
    if(u==-1)break; 
    tmp[u]=1; 
    for( v=0; v<n; v++ ){ 
      if(d[v]>=d[u]+M[u][v]) d[v]=d[u]+M[u][v]; 
    } 
  } 
  for ( i = 0; i < n; i++ ) printf("%d %d\n", i, (d[i]==INFTY?-1:d[i])); 
  return 0; 
}



Measured memory_bytes: 2036
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long

using namespace std;

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

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

    int k, x;
    cin >> k >> x;
    if(k * 500 >= x)
        cout << "Yes";
    else
        cout << "No";

    return 0;
}


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

#define pb push_back
#define fi first
#define se second
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int, int> ii;

const int N = 1000007, inf = 0x3f3f3f3f;

int acc[N];
string s; 
int n;
int memo[N][2];

int solve(int i, int c) {
    int & st = memo[i][c];
    if(i == n) {
        return c;
    }
    if(st == -1) {
        int flag = 0;
        if(c){
            if(s[i] == '9') {
                s[i] = '0';
                flag = 1;
            } else {
                s[i]++;
            }
        } 
        st = solve(i+1, flag) + (s[i] - '0');
        if(s[i] != '0') st = min(st, solve(i+1, 1) + ('9' - s[i] + 1));
    }
    return st;
}

int main() {
    memset(memo, -1, sizeof memo);
    ios::sync_with_stdio(0); cin.tie(0);

    cin >> s;
    n = s.size();


    cout << solve(0, 0) << endl;

}

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

int main() 
{
    lli n, k = 0, l = 0;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for(lli i = 0; i < 2*n; i++)
    {
        if(i % 2 == 0)
            cout << s[k++];
        else
            cout << t[l++];
    }
}

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

using namespace std;

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

// UnionFindTree
// T: 可換群
template<class T>
class UnionFindTree {
    const int n;
    std::vector<int> par, size;
    std::vector<T> diff_potential;
public:
    // 要素数を指定して初期化
    UnionFindTree(int n, T ZERO) : n(n), par(n), size(n), diff_potential(n) {
        for (int i = 0; i < n; i++) {
            par[i] = i;
            size[i] = 1;
            diff_potential[i] = ZERO;
        }
    }

    // 要素iが属する集合を表す木の根を求める
    int getRoot(int i) {
        if (par[i] == i) {
            return i;
        } else {
            int r = getRoot(par[i]);
            diff_potential[i] += diff_potential[par[i]];
            return par[i] = r;
        }
    }

    // 要素iのポテンシャル
    T getPotential(int i) {
        getRoot(i);
        return diff_potential[i];
    }

    // 要素iと要素jのポテンシャル差
    T getDiff(int i, int j) {
        return getPotential(j) - getPotential(i);
    }

    // getDiff(i, j) = dとなるように要素iと要素jの属する集合を併合
    void unite(int i, int j, T d) {
        d -= getDiff(i, j);
        i = getRoot(i);
        j = getRoot(j);
        if (i == j)return;
        if (size[i] < size[j])swap(i, j), d = -d;
        par[j] = i;
        size[i] += size[j];
        diff_potential[j] = d;
    }

    // 要素iと要素jが同じ集合に属するか否か
    bool isSame(int i, int j) {
        return getRoot(i) == getRoot(j);
    }

    // 要素iが属する集合の大きさ
    int getSize(int i) {
        return size[getRoot(i)];
    }
};

int N, M;
int A[110000], B[110000];
int ans[110000];

signed main() {
    cin >> N >> M;
    for (int i = 1; i <= M; i++)cin >> A[i] >> B[i];
    UnionFindTree<int> uf(N + 1, 0);
    ans[M] = N * (N - 1) / 2;
    for (int i = M; i >= 2; i--) {
        ans[i - 1] = ans[i];
        if (!uf.isSame(A[i], B[i])) {
            ans[i - 1] -= uf.getSize(A[i]) * uf.getSize(B[i]);
            uf.unite(A[i], B[i], 0);
        }
    }
    for (int i = 1; i <= M; i++)cout << ans[i] << endl;

}

Measured memory_bytes: 6016
N = int(input())

def solver(num):
  ctr = 0
  while num % 2 == 0:
    num = int(num / 2)
    ctr += 1
  return ctr

ct = 0
ans = 0

for i in range(1,N+1):
  if solver(i) >= ct:
    ans = i
    ct = solver(i)

print(ans)
  

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<algorithm>
#include <string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>

#define ok printf("ok\n");
#define MAX 1000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define pb push_back

using namespace std;

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
int main()
{
	int a,b,n,k,ans = 0;
	cin >> n >> k;
	vi v,kosuu(n);
	rep(i,n)
	{
		cin >> b;
		v.push_back(b);
		//cout << v[i] << endl;
	}
	sort(all(v));
	int x = 0;
	rep(i,n)
	{
		kosuu[x]++;
		if(i==n-1)
			continue;
		else if(v[i] != v[i+1] && i != n)
			x++;
	}
	/*rep(i,x+1)
		cout << kosuu[i] << endl;*/
	sort(all(kosuu));
	rep(i,n-k)
		ans += kosuu[i];
	cout << ans;
	return 0;
}

Measured memory_bytes: 2168
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);


int main() {
    string s, t;
    cin >> s >> t;
    if (t.substr(0, s.size()) == s)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  int result = 0;
  for (int i = A; i <= B; ++i) {
    int r = 0;
    div_t d; d.quot = i; d.rem = 0;
    while (d.quot) {
      d = div(d.quot, 10);
      r = 10 * r + d.rem;
    }
    if (i == r) ++result;
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 256
interleave :: [Char] -> [Char] -> [Char]
interleave xs [] = xs
interleave [] ys = ys
interleave (x:xs) (y:ys) = [x]++[y]++(interleave xs ys)

main :: IO ()
main = do
    oddChars <- getLine
    evenChars <- getLine
    putStrLn (interleave oddChars evenChars)


Measured memory_bytes: 508
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <numeric>
#include <string>
#include <cassert>
#include <bitset>

using namespace std;
typedef long long ll;

int main() {
  string S;
  cin >> S;
  if (S[2] == S[3] and S[4] == S[5]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline int_fast64_t read(){int_fast64_t x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x*f;}
void Main(){
    int A = read(), B = read(), C = read();
    printf("%d\n", max(A, max(B, C))*9+A+B+C);
}
int main(){cin.tie(nullptr);ios::sync_with_stdio(false);Main();return 0;}

Measured memory_bytes: 256
s = gets.chomp!
chs = s.chars.chunk_while{|i, j| i == j }.to_a
chs.unshift([])
chs.push([])
ans = Array.new(s.length, 0)

i = 0
chs.each_cons(3) do |before_part, part, next_part|
    #pp ans
    if part[0] == "R"
        # 末尾以外
        (part.length - 1).times do |x|
            ans[i + x] = 0
        end
        i += part.length - 1
        # 末尾
        if part.length % 2 == 1
            ans[i] = 
                (part.length + next_part.length) / 2 + 
                (part.length + next_part.length) % 2
        else
            ans[i] = (part.length + next_part.length) / 2
        end
        i += 1
    else
        # 先頭
        if (before_part.length + 1) % 2 == 0
            ans[i] = (part.length + before_part.length) / 2
        else
            ans[i] = 
            (part.length + before_part.length) / 2 + 
            (part.length + before_part.length) % 2
        end
        i += 1

        # 先頭以外
        (part.length - 1).times do |x|
            ans[i + x] = 0
        end
        i += part.length - 1
    end
end

puts ans.join(" ")


Measured memory_bytes: 17532
#[derive(Clone)]
struct BitSet {
    size: usize,
    a: Vec<usize>,
}

fn bit_size() -> usize {
    8 * std::mem::size_of::<usize>()
}

fn quot_rem(n: usize) -> (usize, usize) {
    let w = bit_size();
    (n / w, n % w)
}

#[allow(dead_code)]
impl BitSet {
    fn new(size: usize) -> Self {
        let w = bit_size();
        BitSet {
            size: size,
            a: vec![0; (size + w - 1) / w],
        }
    }
    fn set_at(&mut self, x: usize) {
        assert!(x < self.size);
        let (q, r) = quot_rem(x);
        self.a[q] |= 1 << r;
    }
    fn get_at(&self, x: usize) -> usize {
        assert!(x < self.size);
        let (q, r) = quot_rem(x);
        (self.a[q] >> r) & 1
    }
    fn fix(&mut self) {
        let (q, r) = quot_rem(self.size);
        if r != 0 {
            self.a[q] &= (1 << r) - 1;
        }
    }
    fn clear(&mut self) {
        let len = self.a.len();
        self.a.clear();
        self.a.resize(len, 0);
    }
    fn shift_left(&self, rhs: usize) -> Self {
        let (q, r) = quot_rem(rhs);
        let mut ans = BitSet::new(self.size + rhs);
        if r == 0 {
            for (x, y) in ans.a[q..].iter_mut().zip(self.a.iter()) {
                *x = *y;
            }
        } else {
            let w = bit_size();
            let mut prev = 0;
            for (x, y) in ans.a[q..].iter_mut().zip(self.a.iter()) {
                *x = (*y << r) | (prev >> (w - r));
                prev = *y;
            }
            *ans.a.last_mut().unwrap() |= prev >> (w - r);
        }
        ans.fix();
        ans
    }
}

use std::ops::*;

impl BitOrAssign for BitSet {
    fn bitor_assign(&mut self, rhs: Self) {
        if self.size < rhs.size {
            self.size = rhs.size;
            self.a.resize(rhs.a.len(), 0);
        }
        for (a, b) in self.a.iter_mut().zip(rhs.a.iter()) {
            *a |= *b;
        }
    }
}

impl BitOr for BitSet {
    type Output = Self;
    fn bitor(mut self, rhs: Self) -> Self {
        self |= rhs;
        self
    }
}

use std::io::Read;

fn run() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let _n: usize = it.next().unwrap().parse().unwrap();
    let mut bit = BitSet::new(1);
    bit.set_at(0);
    let mut sum = 0;
    for s in it {
        let a: usize = s.parse().unwrap();
        bit |= bit.shift_left(a);
        sum += a;
    }
    let mut ans = (sum + 1) / 2;
    while bit.get_at(ans) == 0 {
        ans += 1;
    }
    println!("{}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 6396
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

r,d,x = I()
for i in range(10):
    x = r*x - d
    print(x)


Measured memory_bytes: 10104
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
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);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int64 dp[5010 * 5010];
int main() {
    int64 N, x[3] = {}, y[3] = {};
    cin >> N;
    cin >> x[0] >> x[1] >> x[2];
    cin >> y[0] >> y[1] >> y[2];

    {
        int64 v[4] = {}, p[4] = {};
        for(int k=0; k<3; k++) {
            v[k] = x[k];
            p[k] = y[k];
        }
        v[3] = p[3] = 1;

        fill(dp, dp + N + 1, -1);
        dp[0] = 0;
        for(int i=0; i<4; i++) {
            for(int k=0; k<=N; k++) {
                if(dp[k] < 0 or k + v[i] > N) continue;
                chmax(dp[k + v[i]], dp[k] + p[i]);
            }
        }
    }

    int64 M = *max_element(dp, dp + N + 1);
    // fprintf(stderr, "M = %lld\n", M);
    {
        int64 v[4] = {}, p[4] = {};
        for(int k=0; k<3; k++) {
            v[k] = y[k];
            p[k] = x[k];
        }
        v[3] = p[3] = 1;

        fill(dp, dp + M + 1, -1);
        dp[0] = 0;
        for(int i=0; i<4; i++) {
            for(int k=0; k<=M; k++) {
                if(dp[k] < 0 or k + v[i] > M) continue;
                chmax(dp[k + v[i]], dp[k] + p[i]);
            }
        }
    }

    int64 ans = *max_element(dp, dp + M + 1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 195584
#include <stdio.h>

int main(){
    int H;
	int W;
    
	while(true){
		scanf("%d %d",&H,&W);
		
		if(H == 0 && W == 0){
			break;
		}
		
		for (int hol=0;hol<W;hol++){
			printf("#");
		}
		printf("\n");
		
		for (int var=0;var<H-2;var++){
			printf("#");
			for (int hol=1;hol<W-1;hol++){
				printf(".");
			}
			printf("#\n");
		}
		for (int hol=0;hol<W;hol++){
			printf("#");
		}
		printf("\n");
		
		printf("\n");
	}
    return 0;
}


Measured memory_bytes: 2572
import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.typecons;

const EPS = 1e-8;

struct Point {
    double y, x;
    Point opBinary(string op)(in Point a) const {
        static if (op == "+" || op == "-") {
            return Point(mixin("y" ~ op ~ "a.y"),
                         mixin("x" ~ op ~ "a.x"));
        }
    }
    Point opBinary(string op)(double a) const {
        static if (op == "*" || op == "/") {
            return Point(mixin("y" ~ op ~ "a"),
                         mixin("x" ~ op ~ "a"));
        }
    }
}
double norm(in Point a) {
    return sqrt(a.x * a.x + a.y * a.y);
}
double dot(in Point a, in Point b) {
    return a.x * b.x + a.y * b.y;
}
double cross(in Point a, in Point b) {
    return a.x * b.y - a.y * b.x;
}
int CCW(Point a, Point b, Point c) {
    b = b - a; c = c - a;
    if (cross(b, c) > EPS) return +1;
    if (cross(b, c) < EPS) return -1;
    if (dot(b, c) < 0) return +2;
    if (b.norm < c.norm) return -2;
    return 0;
}
 
void main() {
    Point[] segs = new Point[3];
    Point[] segt = new Point[3];
    bool input() {
        auto ps = readln.chomp.split(" ").map!(to!double).array;
        if (ps.all!"a == 0") return false;
        segs[0].x = ps[0]; segs[0].y = ps[1];
        segt[0].x = ps[2]; segt[0].y = ps[3];
        foreach (i; 1 .. 3) {
            ps = readln.chomp.split(" ").map!(to!double).array;
            segs[i].x = ps[0]; segs[i].y = ps[1];
            segt[i].x = ps[2]; segt[i].y = ps[3];
        }
        return true;
    }

    bool intersect(in Point s1, in Point t1,
            in Point s2, in Point t2) {
        return CCW(s1, t1, s2) * CCW(s1, t1, t2) <= 0 &&
            CCW(s2, t2, s1) * CCW(s2, t2, t1) <= 0;
    }

    Point iPoint(in Point s1, in Point t1,
            in Point s2, in Point t2) {
        double d = cross(t2 - s2, t1 - s1);
        return s1 + (t1 - s1) * (cross(t2 - s2, t2 - s1) / d);
    }

    void solve() {
        foreach (i; 0 .. 3) {
            if (!intersect(segs[i], segt[i], 
                        segs[(i + 1) % 3], segt[(i + 1) % 3])) {
                writeln("kyo"); return;
            }
        }
        auto vs = new Point[3];
        foreach (i; 0 .. 3) {
            vs[i] = iPoint(segs[i], segt[i], 
                        segs[(i + 1) % 3], segt[(i + 1) % 3]);
        }
        foreach (i; 0 .. 3) {
            if (vs[i] == vs[(i + 1) % 3]) {
                writeln("kyo"); return;
            }
        }
        double area = cross(vs[2] - vs[0], vs[1] - vs[0]).abs / 2;
        if (1_900_000 <= area) {
            writeln("dai-kichi");
        } else if (1_000_000 <= area) {
            writeln("chu-kichi");
        } else if (100_000 <= area) {
            writeln("kichi");
        } else if (0 < area) {
            writeln("syo-kichi");
        } else {
            writeln("kyo");
        }
    }

    while (input) solve;
}

Measured memory_bytes: 1084
#include<bits/stdc++.h>
using namespace std;
#define next Next
#define last Last
#define int long long
const int mod=1e9+7;
const int N=1e6+5;
int n,k,ans,a[N],b[N];
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
signed main()
{
	n=read();k=read();
	for(int i=1;i<=n;i++)a[i]=read();
	for(int i=1;i<=n;i++)b[a[i]]++;
	for(int i=0;i<=2000;i++)b[i]+=b[i-1];
	for(int i=1;i<=n;i++)
	{
		int y=0;
		for(int j=1;j<i;j++)
			if(a[i]<a[j])y++;
		(ans+=y*k%mod)%=mod;
		int x=b[2000]-b[a[i]];
		(ans+=k*(k-1)/2%mod*x%mod)%=mod;
	}
	cout<<ans;
}

Measured memory_bytes: 2304
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("YES") if fl else print("NO")
import collections
import math
import itertools
import heapq as hq
import sys

s = input()
tmp=10**11
for i in range(0,len(s)-2):
    tmp = min(tmp,abs(753-int(s[i:i+3])))
print(tmp)


Measured memory_bytes: 9440
import java.util.*;
import java.math.*;

public class Main {

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

    for (int i = 1; ; i++) {
      int k = a*i;
      if (k%b == c) {
        System.out.println("YES");
        return;
      }
      if ((k%b == a%b) && i > 1) {
        System.out.println("NO");
        return;
      }
    }


  }

}


Measured memory_bytes: 23252
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	ll x; cin>>x;
	ll t = 100;
	for(int i = 0; ; ++i){
		if(t>=x){cout<<i<<endl; return 0;}
		t *= 1.01;
	}
	return 0;
}

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

#define ran 1011

int n, m;
int x[ran], y[ran];

int main() {
	scanf("%d%d%d%d", &n, &m, &x[0], &y[0]);
	n++; m++;
	for(int i=1;i<n;i++) scanf("%d", &x[i]);
	for(int i=1;i<m;i++) scanf("%d", &y[i]);
	sort(x, x+n);
	sort(y, y+m);
	if (x[n-1] < y[0]) puts("No War");
	else puts("War");
	return 0;
}

Measured memory_bytes: 128
use std::io::stdin;
use std::collections::HashMap;

fn main() {
    let mut st = String::new();
    stdin().read_line(&mut st).unwrap();
    let (h, w) = {
        let nk:Vec<_> = st.trim().split(" ").map(|x| x.parse::<i32>().unwrap()).collect();
        (nk[0], nk[1])
    };
    let mut map:HashMap<char, i32> = HashMap::new();
    for _i in 0..h {
        let mut st = String::new();
        stdin().read_line(&mut st).unwrap();
        let a:Vec<char> = st.trim().chars().collect();
        for j in a {
            let count:&mut i32 = map.entry(j).or_insert(0);
            *count += 1;
        };
    };
    let mut f:i32 = 0;
    let mut t:i32 = 0;
    let mut one:i32 = 0;
    f = w*h/4;
    if h%2==1 {
        t += w/2;
    }
    if w%2==1 {
        t += h/2;
    }
    if h%2==1 && w%2==1 {
        one = 1;
    };
    let mut result = "Yes";
    for (i, j) in map.iter() {
        let mut num = *j as i32;
        if num%2==1 {
           if one > 0 {
               num -= 1;
               one -= 1;
           } else {
               result = "No"
           };
        }
        while f > 0 && num >= 4 {
            num -= 4;
            f -= 1;
        }
        while t > 0 && num >= 2 {
            num -= 2;
            t -= 1;
        };
        if num > 0 {
            result = "No";
            break;
        } else if result =="No" {
            break;
        }
    };
    println!("{}", result);
}

Measured memory_bytes: 4352
N = int(input())
S = input()
K = int(input())
O = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if S.islower():
    if len(S) == N:
        if 1 <= K <= N <= 10:
            W = str(S[K - 1])
            O.remove(W)
            for i in range(24):
                S = S.replace(O[i],"*")
print(S)
                

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

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector< ii >
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }

int gcd(int a, int b){
  if(a == 0) return b;
  else return gcd(b%a, a);
}

struct node {
  node *left, *right;
  int val = INF;
  int lazy = INF;
  node() {
    //initialize attributes
    val = INF;
    lazy = INF;
    left = NULL;
    right = NULL;
  }
};
  
void combine(node *ans, node *left, node *right){
  //combine operation
  ans->val = min(left->val, right->val);
}

void propagate(node * root, int l, int r){
  //check if exists lazy
  if(root->lazy == INF) return;
  //apply lazy on node
  root->val = min(root->lazy, root->val);
  //propagate
  if(!root->left) root->left = new node();
  if(!root->right) root->right = new node();
  
  if(l != r){
    //propagate operation
    root->left->lazy = min(root->lazy,root->left->lazy);
    root->right->lazy = min(root->right->lazy, root->lazy);
  }
  
  //reset lazy
  root->lazy = INF;
} 

void update(node *root, int l, int r, int a, int b, int val){
  propagate(root, l, r);
  //cout << l << " " << r << " " << root->val <<endl;
  if(l == a && r == b){
    //do lazy operation
    root->lazy = min(root->lazy, val);
    propagate(root, l, r);
    return;
  }
  int m = (l+r) >> 1;
  if(!root->left) root->left = new node();
  if(!root->right) root->right = new node();
  if(b <= m) update(root->left, l, m, a, b, val);
  else if(m < a) update(root->right, m+1, r, a, b, val);
  else {
    update(root->left, l, m, a, m, val);
    update(root->right, m+1, r, m+1, b, val);
  }
  propagate(root, l, r);
  propagate(root->left, l, m);
  propagate(root->right, m+1, r);
  combine(root, root->left, root->right);
}

node* query(node *root, int l, int r, int x){
  propagate(root, l, r);
  if(l == r){
    return root;
  }
  int m = (l+r) >> 1;
  if(!root->left) root->left = new node();
  if(!root->right) root->right = new node();
  if(x <= m) return query(root->left, l, m, x);
  else return query(root->right, m+1, r, x);
}


int32_t main(){
  DESYNC;
  int n,q;
  cin >> n >> q;
  node * root = new node();
  for(int i=0; i<n; i++){
    int l,r,x;
    cin >> l >> r >> x;
    int ta = max(0LL, l-x), tb = max(0LL, r-x-1);
    //cout << "up " << ta << " " << tb << " " << x << endl;
    update(root, 0, 1000000000, ta, tb, x);
  }
  while(q--){
    int x;
    cin >> x;
    int ans = query(root, 0, 1000000000, x)->val;
    if(ans == INF) ans = -1;
    cout << ans << endl;
  }
}



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

template<typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}

signed main(){
  int n,m;cin>>n>>m;
  if(n==1){
    int ans=-1;
    while(m--){
      int s,c;cin>>s>>c;
      if(~ans&&ans!=c)fin(-1);
      ans=c;
    }
    fin(max(ans,0));
  }
  vector<int> v(n,-1);
  while(m--){
    int s,c;cin>>s>>c;
    if(s==1&&c==0)fin(-1);
    if(~v[s-1]&&v[s-1]!=c)fin(-1);
    v[s-1]=c;
  }
  if(!~v[0])v[0]=1;
  for(int i=0;i<n;i++){
    cout<<(~v[i]?v[i]:0);
  }
  cout<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int N,K,mod=1e9+7;
	cin>>N>>K;
	vector<int>dp1(K+1,1),dp2(K+1);
	while(N--) {
		int a;
		cin>>a;
		for(int i=0;i<=K;i++) dp2[i]=(dp1[i]-(i-a-1>=0?dp1[i-a-1]:0)+mod)%mod;
		dp1[0]=dp2[0];
		for(int i=1;i<=K;i++) dp1[i]=(dp1[i-1]+dp2[i])%mod;
	}
	cout<<dp2[K]<<"\n";
	return 0;
}

Measured memory_bytes: 3964
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A[] = new int[N];
		boolean possible = true;

		for (int i = 0; i < N;i ++) {
			A[i] = sc.nextInt();
			if (A[i] % 2 == 0 && !(A[i] % 3 == 0 || A[i] % 5 == 0)) {
				possible = false;
			}
		}

		if (possible) {
			System.out.println("APPROVED");
		} else {
			System.out.println("DENIED");
		}
	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (500000)
#define pii pair<int, int>

/////////////////////////////////////////////////////////

class XY{
public:
  ll x, y;
  XY() {x = y = 0;}
  XY(ll u, ll v) {x = u; y = v;}
};

class e{
public:
  ll a, b;
  e() {a = b = -1;}
  e(ll u, ll v) {a = u; b = v;}
};

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

template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
  if(n == 0) return 1;
  if(n == 1) return a;
  if(n % 2) return a * mypow(a, n - 1);
  ll tmp = mypow(a, n / 2);
  return tmp * tmp;
}

template<typename T>
int BS(vector<T> &V, int left, int right, T key){
  int mid = (left + right) / 2;
  if(V[mid] <= key) left = mid;
  else right = mid;
  if(right - mid == 1) return left;
  else return BS(V, left, right, key);
}

ll comb(ll n, ll r){
	ll res = 1;
  rep(i, 0, r){
    res *= n - i;
    res /= i + 1;
  }
  return res;
}

template<typename T>
T euclid(T a, T b){
  if(b == 0) return a;
  else return euclid(b, a % b);
}

vector<ll> fact(MAX, 0), fact_inv(MAX, 0);

ll pow_mod(ll a, ll b){
	ll res = 1;
	while(b > 0){
		if(b & 1) res = res * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return res;
}

void prepare_comb_mod(ll n){
	fact[0] = 1LL;
	for(ll i = 0; i < n; i++) fact[i+1] = fact[i] * (i + 1) % MOD;
	fact_inv[n] = pow_mod(fact[n], MOD - 2);
	for(ll i = n - 1; i >= 0; i--) fact_inv[i] = fact_inv[i + 1] * (i + 1) % MOD;
}

ll comb_mod(ll n, ll r){
	return (fact[n] * fact_inv[r]) % MOD * fact_inv[n - r] % MOD;
}

/////////////////////////////////////////////////////////

vector<ll> prime(ll n){
  vector<ll> res;
  if(n == 1) return res;
  ll N = n;
  ll k = 2;
  ll cnt = 0;
  while(n > 1){
    if(n % k == 0){
      if(cnt == 0) res.push_back(k);
      n /= k;
      cnt++;
    }else{
      k++;
      cnt = 0;
    }
    if(k > pow(N, 0.5)){
      res.push_back(n);
      n = 1;
    }
  }
  return res;
}

void Main() {
  ll A, B; cin >> A >> B;
  vector<ll> Aprime = prime(A);
  ll res = 1;
  rep(i, 0, Aprime.size()){
    if(B % Aprime[i] == 0) res++;
  }
  
  cout << res << endl;
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);

  Main();
}


Measured memory_bytes: 8448
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<=(end);i++)
#define REP(i, n) FOR(i,1,n)
#define IFOR(i, begin, end) for(int i=(begin);i>=(end);i--)
#define IREP(i, n) IFOR(i,1,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())

#define ll long long
using namespace std;

int main()
{
    // 入力
    ll M,K;
    cin>>M>>K;
    if(pow(2,M)<=K || (K==1 && M==1)){
    	cout<<-1<<endl;
    	return 0;
    }

    if(K==0){
    	cout<<0<<" "<<0;
    	FOR(i,1,pow(2,M)-1){
    		cout<<" "<<i<<" "<<i;
    	}
    	cout<<endl;
    	return 0;
    }

    cout<<0<<" "<<K<<" "<<0;
    FOR(i,1,pow(2,M)-1){
    	if(i==K) continue;
    	else {
    		cout<<" "<<i;
    	}
    }
    cout<<" "<<K;
    IFOR(i,pow(2,M)-1,1){
    	if(i==K) continue;
    	else{
    		cout<<" "<<i;    		
    	}
    }

    cout<<endl;

    return 0;
}

Measured memory_bytes: 1792