akhauriyash/Code-Regression huggingface dataset:
//package com.company;
import java.util.*;
import java.lang.*;
import java.io.*;
//****Use Integer Wrapper Class for Arrays.sort()****
public class Main {
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] Args)throws Exception{
        FastReader scan=new FastReader(System.in);
        int t=1;
        //t=scan.nextInt();
        while(t-->0){
            int d=scan.nextInt();
            int ti=scan.nextInt();
            int s=scan.nextInt();
            if(s*ti>=d){
                out.println("Yes");
            }else{
                out.println("No");
            }
        }
        out.flush();
        out.close();
    }
    static class FastReader {

        byte[] buf = new byte[2048];
        int index, total;
        InputStream in;

        FastReader(InputStream is) {
            in = is;
        }

        int scan() throws IOException {
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0) {
                    return -1;
                }
            }
            return buf[index++];
        }

        String next() throws IOException {
            int c;
            for (c = scan(); c <= 32; c = scan()) ;
            StringBuilder sb = new StringBuilder();
            for (; c > 32; c = scan()) {
                sb.append((char) c);
            }
            return sb.toString();
        }

        int nextInt() throws IOException {
            int c, val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
        long nextLong() throws IOException {
            int c;
            long val = 0;
            for (c = scan(); c <= 32; c = scan()) ;
            boolean neg = c == '-';
            if (c == '-' || c == '+') {
                c = scan();
            }
            for (; c >= '0' && c <= '9'; c = scan()) {
                val = (val << 3) + (val << 1) + (c & 15);
            }
            return neg ? -val : val;
        }
    }
}


Measured memory_bytes: 32416
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pll pair<ll,ll>
#define forA(i,a,n,x) for(auto i=a;i<n;i+=x)
#define forD(i,a,n,x) for(auto i=n-1;i>=0;i-=x)
#define ranit(it,n) for(auto it:n)
#define testCases ll t;cin>>t;while(t--)
#define mp make_pair
#define pb push_back5 5 3 2
#define F first
#define S second
#define mod 1000000007
#define init(a,x) memset(a,x,sizeof(a))

string x,y;
ll dp[3003][3003];

string  lcs(ll n , ll m)
{
	forA(i,0,n+1,1)dp[i][0]=0; forA(i,0,m+1,1)dp[0][i]=0;

	forA(i,1,n+1,1)
	{
		forA(j,1,m+1,1)
		{
			if(x[i-1]==y[j-1])dp[i][j]=1+dp[i-1][j-1];
			else dp[i][j] = max(dp[i-1][j] , dp[i][j-1]);
		}
	}

	ll i=n,j=m; string s="";
	while(i>0 && j>0)
	{
		if(x[i-1]==y[j-1])
		{
			s=x[i-1]+s; i--;j--;
		}
		else
		{
			if(dp[i-1][j]>=dp[i][j-1])i--;
			else j--;
		}
	}
	return s;
}

int main()
{
	ios_base::sync_with_stdio(false);	cin.tie(NULL);	cout.tie(NULL);
	//init(dp,-1);
	cin>>x; cin>>y; ll n,m ; n=x.size(); m=y.size();
	cout<<lcs(n,m);

	return 0;
}

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

using namespace std;

int const maxn = 3030;

int dp[maxn][maxn];

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

    string s, t;
    cin >> s >> t;

    int n = s.size(), m = t.size();

    for (int i = n-1; i >= 0; i--) {
        for (int j = m-1; j >= 0; j--) {
            if (s[i] == t[j]) {
                dp[i][j] = 1 + dp[i+1][j+1];
            }
            else {
                dp[i][j] = max(dp[i][j+1], dp[i+1][j]);
            }
        }
    }

    int i = 0, j = 0;
    while (i < n and j < m) {
        if (s[i] == t[j]) {
            cout << s[i];
            i++, j++;
        }
        else {
            if (dp[i][j] == dp[i+1][j]) {
                i++;
            }
            else  {
                j++;
            }
        }
    }
    cout << "\n";
}

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

int state[100][100];
bool reached[100][100];
int w,h;

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

void dfs(int x, int y) {

	if(x==0 || h<x || y==0 || w<y || state[x][y] == 0)
		return;
	if(reached[x][y] == true)
		return;

	reached[x][y]=true;

	for(int i=0; i<8; i++) {
		dfs(x+dx[i],y+dy[i]);
	}
}

int main() {

	while(1){
		cin >> w >> h;
		if(w==0 && h==0) {
			return 0;
		}
		memset(state, 0, sizeof(state));
		memset(reached, false, sizeof(reached));
		for(int i=1; i<=h; i++) {
			for(int j=1; j<=w; j++) {
				cin >> state[i][j];
			}
		}
		int count=0;
		for(int i=1; i<=h; i++) {
			for(int j=1; j<=w; j++) {
				if(reached[i][j]==true || state[i][j] == 0)
					continue;
				else{
					dfs(i,j);
					count++;
				}
			}
		}
		cout << count << endl;
	}
	return 0;
}



Measured memory_bytes: 3180
import sys
from statistics import *
from collections import *
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

ct = 0
li = []
for i in range(3):
    li.append(na())

bbb = li[0]
aaa = [0, li[1][0] - li[0][0], li[2][0] - li[0][0]]
ans = "Yes"
for i in range(3):
    for j in range(3):
        if li[i][j] != aaa[i] + bbb[j]:
            ans = 'No'
            break
print(ans)

Measured memory_bytes: 5148
#include <bits/stdc++.h>
 
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sll set<long long>
#define si set<int>
#define stk stack<int>
#define que queue<int>
#define pb push_back
#define ff first
#define ss second
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
using namespace std;
 
void solve(){
	int n;
	cin>>n;
	vll a(n);
	ll xo=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		xo^=a[i];
	}

	for(auto i:a)
		cout<<(xo^i)<<" ";

}
 
int main(){
    IOS;
    int q=1;
    //cin>>q;
    while(q--){
        solve();
    }
}

Measured memory_bytes: 4756
(defun remaining-balls ()
  (let ((s (read)) 
        (t1 (read)) 
        (a (read)) 
        (b (read)) 
        (u (read-line))) 
    (if (string-equal s u)
        (decf a) 
        (decf b))
    (format t "~d ~d~%" a b)))

(remaining-balls)



Measured memory_bytes: 11748
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;

template<typename T, typename Q>
istream &operator>>(istream &is, pair<T, Q> &p) {
	return is >> p.first >> p.second;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v) {
	for (auto &x : v) is >> x;
	return is;
}

template<typename T, typename Q>
ostream &operator<<(ostream &os, pair<T, Q> p) {
	return os << "(" << p.first << ", " << p.second << ")";
}

template<typename T>
ostream &operator<<(ostream &os, vector<T> v) {
	os << "[";
	for (auto it = v.begin(); it != v.end(); it++)
		os << (it == v.begin() ? "" : ", ") << *it;
	return os << "]";
}

template<typename T, typename Q>
ostream &operator<<(ostream &os, map<T, Q> m) {
	os << "[";
	for (auto it = m.begin(); it != m.end(); it++) 
		os << (it == m.begin() ? "" : ", ") << *it;
	return os;
}
#define imie(...) " [" << #__VA_ARGS__": " << (__VA_ARGS__) << "] "

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int mn = -1000000;
	int k, x; cin >> k >> x;
	set<int> s;
	if (x - k + 1 < mn) {
		for (int i = mn; i <= mn + k - 1; i++) {
			s.insert(i);
		}
		for (int i = x; i <= x + k - 1; i++) {
			s.insert(i);
		}
	} else if (x + k - 1 > -mn) {
		for (int i = -mn; i >= -mn - k + 1; i--) {
			s.insert(i);
		}
		for (int i = x; i >= x - k + 1; i--) {
			s.insert(i);
		}
	} else {
		for (int i = x; i <= x + k - 1; i++) {
			s.insert(i);
		}
		for (int i = x; i >= x - k + 1; i--) {
			s.insert(i);
	 	}
	}
	for (auto x : s) cout << x << " ";
}


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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    ll N;
    cin >> N;
    vector<ll> a(N);
    ll count = 0;
    REP(i, N)
    {
        ll a;
        cin >> a;
        if (a == count + 1) count++;
    }
    ll ans;
    if (count != 0) ans = N - count;
    else ans = -1;

    cout << ans << endl;
}


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

#define LEFT 1
#define RIGHT 2
#define DOWN 3
#define UP 4

int main() {
  int width, height, point_num;
  cin >> width >> height >> point_num;
  int square[height][width];
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
       square[i][j] = 1;
    }
  }
  for (int i = 0; i < point_num; i++) {
    int x, y, a;
    cin >> x >> y >> a;
    switch (a) {
      case LEFT:
        for (int i = 0; i < height; i++) {
          for (int j = 0; j < x; j++) {
            square[i][j] = 0;
          }
        }
        break;
      case RIGHT:
        for (int i = 0; i < height; i++) {
          for (int j = x; j < width; j++) {
            square[i][j] = 0;
          }
        }
        break;
      case DOWN:
        for (int i = 0; i < y; i++) {
          for (int j = 0; j < width; j++) {
            square[i][j] = 0;
          }
        }
        break;
      case UP:
        for (int i = y; i < height; i++) {
          for (int j = 0; j < width; j++) {
            square[i][j] = 0;
          }
        }
        break;
    }
  }
  int area = 0;
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      if (square[i][j]) {
        area += 1;
      }
    }
  }
  cout << area << endl;
}


Measured memory_bytes: 256
h, n = map(int, input().split())
dat = [list(map(int, input().split())) for _ in range(n)]
dp = [[10**9 for _ in range(h+1)] for _ in range(n+1)]
dp[0][h] = 0
for i in range(n):
    for j in range(h, -1, -1):
        dp[i+1][j] = dp[i][j]
        if j + dat[i][0] <= h:
            dp[i+1][j] = min([dp[i+1][j], dp[i+1][j+dat[i][0]]+dat[i][1]])
        if j == 0:
            for k in range(1, min([h, dat[i][0]])+1):
                dp[i+1][j] = min([dp[i+1][j], dp[i+1][k] + dat[i][1]])
print(dp[n][0])

Measured memory_bytes: 125276
q = int(input( ))
st = set()
for i in range(q):
    cmmd,tx = map(int, input().split( ))
    if cmmd == 0:
        st.add(tx) 
        print(len(st)) 
    elif cmmd == 1 :
        if tx in st:
            print(1)
        else:
            print(0)
    else:
        if tx in st:
            st.remove(tx)
        


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

int f(int n)
{
    int i,flag=0;
    for(i=2; i<=n*1.0/2; i++)
    {
        if(n%i==0)
        {
            flag=1;
            break;
        }
    }
    return flag;
}
int main()
{
    int n,i,j;
    scanf("%d",&n);
    for(i=0,j=1; i<n; i++)
    {
        do
        {
            j+=10;
        }
        while(f(j)!=0);
        printf("%d ",j);
    }
    return 0;
}


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

//Start
typedef long long ll;
typedef double db;
#define mp(a,b) make_pair((a),(b))
#define x first
#define y second
#define be(a) (a).begin()
#define en(a) (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define R(i,a,b) for(int i=(a),I=(b);i<I;i++)
#define L(i,a,b) for(int i=(b)-1,I=(a)-1;i>I;i--)
const int iinf=0x3f3f3f3f;
const ll linf=0x3f3f3f3f3f3f3f3f;

//NetWorkFlow
const int tN=10002;
int tn,s,t;
vector<int> e[tN],to,fw,co;
void adde(int u,int v,int w,int c){
	e[u].pb(sz(to)),to.pb(v),fw.pb(w),co.pb(+c);
	e[v].pb(sz(to)),to.pb(u),fw.pb(0),co.pb(-c);
}
bool vis[tN]; int pre[tN],dep[tN];
bool spfa(){
	fill(vis,vis+tn,false);
	fill(pre,pre+tn,-1);
	fill(dep,dep+tn,-iinf);
	queue<int> q; q.push(s),dep[s]=0,vis[s]=true;
	while(sz(q)){
		int u=q.front(); q.pop(),vis[u]=false;
		for(int v:e[u])if(fw[v]&&dep[to[v]]<dep[u]+co[v]){
			dep[to[v]]=dep[u]+co[v],pre[to[v]]=v;
			if(!vis[to[v]]) vis[to[v]]=true,q.push(to[v]);
		}
	}
	return dep[t]!=-iinf;
}
pair<int,int> mcmf(){
	pair<int,int> res(0,0);
	while(spfa()){
//		cout<<"lycfucking.\n";
		int f=iinf;
		for(int i=t;i!=s;i=to[pre[i]^1]) f=min(f,fw[pre[i]]);
		for(int i=t;i!=s;i=to[pre[i]^1]) fw[pre[i]]-=f,fw[pre[i]^1]+=f;
		res.x+=f,res.y+=dep[t]*f;
//		cout<<"fengyangyang\n";
	}
	return res;
}

//Data
const int N=100;
int n,m;
char Map[N][N];
#define p(x,y) ((x)*(m)+(y))

//Main
int main(){
//	ios::sync_with_stdio(0);
//	cin.tie(0),cout.tie(0);
	cin>>n>>m; tn=(t=(s=n*m)+1)+1;
	R(i,0,n) cin>>Map[i];
	R(i,0,n)R(j,0,m)if(Map[i][j]!='#'){
		if(Map[i][j]=='o') adde(s,p(i,j),1,0);
		if(i+1<n&&Map[i+1][j]!='#') adde(p(i,j),p(i+1,j),iinf,1);
		if(j+1<m&&Map[i][j+1]!='#') adde(p(i,j),p(i,j+1),iinf,1);
		adde(p(i,j),t,1,0);
	}
//	cout<<"?\n";
	pair<int,int> ans=mcmf();
//	cout<<"!\n";
	cout<<ans.y<<'\n';
	return 0;
}

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

using namespace std;

int main()
{
  long long n;
  cin>>n;
  string ans="";
  while(n)
  {
    n--;
    ans+=(char)('a'+(n%26));
    n/=26;
  }
  reverse(ans.begin(),ans.end());
  cout<<ans<<endl;
}

Measured memory_bytes: 3568
import Control.Applicative
import Control.Monad

qsort :: [Int] -> [Int]
qsort [] = []
qsort (p:xs) = qsort lt ++ [p] ++ qsort gteq
  where lt   = [x | x <- xs, x < p ]
        gteq = [x | x <- xs, x >= p]

solver' :: Int -> [Int] -> Int
solver' 0 _      = 0
solver' _ []     = 0
solver' n (x:xs) = (n-1) * x + solver' (n-1) xs


solver :: Int -> [Int] -> Int
solver n xs = solver' n (qsort xs)

main ::IO()
main = do
  n <- (read :: String -> Int) <$> getLine
  unless (n == 0) $ do
    line <- map (read :: String -> Int) <$> replicateM n getLine
    print $ solver n line
    main

Measured memory_bytes: 7560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"
template<class T> void chmax(T &a, const T b){ a = max(a, b); }
template<class T> void chmin(T &a, const T b){ a = min(a, b); }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    const ll inf = LONG_LONG_MAX / 2 - 1;
    ll N, M, R;
    cin >> N >> M >> R;
    vector<ll> r(R);
    rep(i, R) {
        cin >> r[i];
        r[i]--;
    }
    sort(all(r));
    vector<vector<ll>> dist(N, vector<ll>(N, inf));
    rep(i, M) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        dist[a][b] = c;
        dist[b][a] = c;
    }
    rep(i, N) rep(j, N) rep(k, N) chmin(dist[j][k], dist[j][i] + dist[i][k]);
    ll ans = inf;
    do {
        ll tmp = 0;
        rep(i, R - 1) {
            tmp += dist[r[i]][r[i + 1]];
        }
        chmin(ans, tmp);
    }
    while(next_permutation(all(r)));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3732
#include <iostream>
#include <ctype.h>
using namespace std;
int main(void){
    // Here your code !
    string str;
    int len;
    getline(cin,str);
    len = str.size();
    for(int i=0;i<len;i++) {
        if(isalpha(str[i])) {
            if(isupper(str[i])) {
                str[i] = tolower(str[i]);
            } else {
                str[i] = toupper(str[i]);
            }
        }
    }
    cout << str << endl;
}

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

using namespace std;

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

	for (int i = 0; i < S.length(); i++) {
		if (S[i] == ',') {
			cout << " ";
		}
		else {
			cout << S[i];
		}
	}

	cout << endl;
}





Measured memory_bytes: 3584
S = list(map(int , input()))
lst0 = []
lst1 = []
for i in range(len(S)):
    lst1.append(i % 2)
    lst0.append((i + 1) % 2)
cnt0 = 0
cnt1 = 0
for i in range(len(S)):
    if S[i] != lst0[i]:
        cnt0 += 1
    if S[i] != lst1[i]:
        cnt1 += 1
print(min(cnt0,cnt1))

Measured memory_bytes: 54620
#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 1000000007;
// const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;


const int MAX_n = 10;
int n, a[MAX_n];


int oN, eN;



signed main(){

    cin >> n;
    for(int i = 0;i < n;i++){
        cin >> a[i];
        if((a[i]%2) == 0){
            eN++;
        }else{
            oN++;
        }
    }
    int ans = pow(3, n)-pow(2, eN);

    cout<< ans<< endl;


    return 0;
}

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

const int mod=1e9+7;
const int maxn=2000+5;
char shit[2005][2005];
int a[maxn],l[maxn],r[maxn];
int q[maxn],top;
int n,m;
int work(int c)
{
    for(int i=1;i<m;i++)
    {
        if((shit[c][i]==shit[c][i-1])==(shit[c-1][i]==shit[c-1][i-1]))
            a[i]++;
        else a[i]=1;
    }
    top=0;
    q[top++]=0;
    for(int i=1;i<m;i++)
    {
        while(a[i]<=a[q[top-1]]) top--;
        l[i]=q[top-1]+1;
        q[top++]=i;
    }
    top=0;
    q[top++]=m;
    int ans=0;
    for(int i=m-1;i;i--)
    {
        while(a[i]<=a[q[top-1]]) top--;
        r[i]=q[top-1]-1;
        q[top++]=i;
    }
//    printf("-----------%d\n",c);
//    for(int i=1;i<m;i++)
//        printf("%d ",a[i]);
//    printf("\n");
    for(int i=1;i<m;i++)
    {
        //printf("%d %d\n",l[i],r[i]);
        ans=max(ans,a[i]*(r[i]-l[i]+2));
    }
    //printf("%d\n",ans);
    return ans;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%s",shit[i]);
    int ans=max(n,m);
    for(int i=1;i<m;i++)
        a[i]=1;
    a[0]=a[m]=-100;
    for(int i=1;i<n;i++)
    {
        ans=max(ans,work(i));
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rof(i,a,b) for(int i=(a);i>=(b);--i)
#define S(i) ((int)(A[i]>=Pos))
#define LL long long
using namespace std;
int N,A[300001],INF=10000000;
bool Check(int Pos){
	int m[2];
	m[0]=m[1]=INF;
//	For(i,1,2*N-1) printf("%d ",S(i));puts("");
	For(i,N,2*N-2)
		if(S(i)==S(i+1)){
			m[S(i)]=min(m[S(i)],i-N);
//			cout<<'-'<<i<<' '<<S(i)<<endl;
			break;
		}
	Rof(i,N,2)
		if(S(i)==S(i-1)){
			m[S(i)]=min(m[S(i)],N-i);
			break;
		}
//	cout<<m[1]<<' '<<m[0]<<endl;
	if(m[0]==INF&&m[1]==INF)return (S(N)^(N&1)^1);
	if(m[1]<m[0])return 1;
	return 0;
}
int main(){
	scanf("%d",&N);For(i,1,2*N-1) scanf("%d",&A[i]);
	int l=1,r=2*N-1,Mid,Ans;
//	cout<<Check(4);

	while(l<=r){
		Mid=l+r>>1;
		if(Check(Mid))
			Ans=Mid,l=Mid+1;
		else
			r=Mid-1;
	}

	printf("%d\n",Ans);

	return 0;
}
/*
3
1 5 2 4 3
*/

Measured memory_bytes: 1024
A, B, C, X, Y = map(int, input().split())


if A + B <= 2 * C:
    ans = Y * B + X * A
else:
    if X > Y:
        ans = min(2 * C * Y + (X-Y) * A, 2*C*X)
    else:
        ans = min(2 * C * X + (Y-X) * B, 2*C*Y)

print(ans)


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

#define ll long long
#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
inline void Fail(){
	printf("0");
	exit(0);
}

const int maxn=55;
int n,mx=-1,id;
int a[maxn];

int main(){
	scanf("%d",&n);
	REP(i,n){
		scanf("%d",&a[i]);
		if(abs(a[i])>mx){
			mx=abs(a[i]);
			id=i;
		}
	} 
	printf("%d\n",2*n);
	int cnt=0;
	if(a[id]>0){
		printf("%d %d\n",id,n);
		printf("%d %d\n",id,n);
		printf("%d %d\n",n,n);
		cnt=3;
		for(int i=2;i<n;i++){
			printf("%d %d\n",n,i);
			cnt++;
			if(a[i]>a[i+1])printf("%d %d\n",n,n),cnt++; 
		}
		for(int i=cnt+1;i<=2*n;i++)printf("%d %d\n",n,n); 
	}
	else{
		printf("%d %d\n",id,1);
		printf("%d %d\n",id,1);
		printf("%d %d\n",1,1);
		cnt=3;
		for(int i=n-1;i>=2;i--){
			printf("%d %d\n",1,i);
			cnt++;
			if(a[i-1]>a[i])printf("%d %d\n",1,1),cnt++;
		}
		for(int i=cnt+1;i<=2*n;i++)printf("%d %d\n",1,1);
	}
	return 0;
}

/*
Input:
-----------------
Output:
*/

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int main() {
	int a, b, c; cin >> a >> b >> c;
	if (b - a == c - b)cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
a = list(reversed([int(_) for _ in input()]))
n = len(a)
ans = 0
tmp = 1
for i in range(0, n):
    tmp = 1 << (n - i - 1)
    for j in range(0, i + 1):
        ans += (10 ** j) * a[i] * tmp * (1 << max(0, (i - 1 - j)))
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define rollcall cout << "I'm Sucu." << endl;
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
      }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
string substr(const string &str, int S1, int S2 = -1){
  if(S2 == -1)return str.substr(S1);
  return str.substr(S1, S2-S1);
}
// typedef
typedef complex<double> Point;
typedef pair<int, int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[10], b[] = {1, 4, 7, 9};
signed main(){
  rep(i,4)scanf("%lld", &a[i]);
  sort(a, a+4);
  int ans = 1;
  rep(i,4)if(a[i] != b[i])ans = 0;
  printf("%s\n", ans ? "YES" : "NO");
  return 0;
}






Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<utility>
#include<string>
#include<numeric>

int main(){

    size_t n, m;
    std::cin >> n >> m;

    std::vector<bool> ac(n, false);
    std::vector<size_t> wa(n, 0);

    size_t cnt_ac = 0, cnt_wa = 0;

    for(size_t i = 0; i < m; i++){
        size_t p;
        std::string s;
        std::cin >> p >> s;

        if(ac.at(p - 1)) continue;

        if(s == "AC"){
            ac.at(p - 1) = true;
            cnt_ac++;
            cnt_wa += wa.at(p - 1);
        }else{
            wa.at(p - 1)++;
        }
    }

    std::cout << cnt_ac << ' ' << cnt_wa << std::endl;

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define endl              "\n"
#define pb              push_back
#define fir               first
#define sec               second
#define all(v)            ((v).begin()), ((v).end())
#define sz(v)            ((int)((v).size()))
#define ll              long long
#define ld              long double
#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)
#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)
#define isPowerOfTwo(s) (!(s & (s-1)))
typedef vector<int> vi;
typedef deque<int> de;
void origi() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
int arr[100003];
int ans[100003];
int n;
void tiranga() {
    cin >> n;
    loop(i, 1, n) {
        cin >> arr[i];
        ans[arr[i]] = i;
    }
    loop(i, 1, n) cout << ans[i] << " ";
}
int main() {
#ifndef ONLINE_JUDGE.
    //freopen("input.txt", "r", stdin);
#else
#endif
    
    origi();
    tiranga();
    //cout << sumOfDig(123654);
   // genLarge(10, 10);
   // genSmall(10);

}


Measured memory_bytes: 1664
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;



/* Name of the class has to be "Main" only if the class is public. */
public class Main
 
 
{
    static Scanner in = new Scanner(System.in);
    
    public static void solve()
    {
        int n=in.nextInt();
        int[] a = new int[n-1];
        for(int i=0;i<n-1;i++)
        {
            a[i]=in.nextInt();
        }
        
        int[] ans= new int[n+1];
        
        for(int i=0;i<n-1;i++)
        {
            ans[a[i]]++;
        }
        
        for(int i=1;i<=n;i++)
        {
            System.out.println(ans[i]);
        }
        
        
        
    }
    

    
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		
		int t=1;
		//in.nextLine();
		
		while(t>0)
		{
		    
		    solve();
		    t--;
		}
		
		
	
	//	System.out.println(x);
	}
}


Measured memory_bytes: 60688
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100003,INF=1<<30;

int main(){
    
    double A,B,X;cin>>A>>B>>X;
    double S=X/A;
    
    double left=0.0,right=M_PI/2.0;
    
    for(int i=0;i<300;i++){
        double mid=(left+right)/2.0;
        double l=A*sin(mid),h=B*sin(M_PI/2.0-mid);
        double size;
        
        if(l<=h){
            size=A*B-A*A*tan(mid)/2.0;
        }else{
            size=B*B*tan(M_PI/2.0-mid)/2.0;
        }
        
        if(size>=S) left=mid;
        else right=mid;
    }
    
    //printf("%.12lf\n",left*90.0/(M_PI/2.0));
    cout<<setprecision(25)<<left*90.0/(M_PI/2.0)<<endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	ll ans = 0;
	int n;
	cin>>n;
	ll mx = 0;
	for(int i=1;i<=n;i++)
	{
		ll x;
		cin>>x;
		if(mx>x)
			ans += mx-x;
		else
			mx = x;
	}
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 3596
while True:
  H, W = map(int,input().split())
  if H == 0 and W == 0:
    break
  print('#' * W)
  for i in range(1,H-1):
    print('#', end='')
    for j in range(1,W-1):
      print('.', end='')
    print('#')
  print('#' * W)
  print()


Measured memory_bytes: 7000
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(int)(b); i++)
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
using namespace std;
 
const int maxN = 1 << 17, INF = 1 << 30;

pair <int, int> T[maxN];
int minSuf[maxN];

int len(int a, int b)
{	return max(0, b-a+1);	}

inline void remax(int& a, int b)	{   a = max(a, b);  }

void solve()
{
	int n, M = 0;
	scanf ("%d", &n);
	FOR(i, 0, n)
		scanf ("%d%d", &T[i].first, &T[i].second), remax(M, len(T[i].first, T[i].second));
		
	FOR(i, 0, n)
		if (T[i].second < T[n-1].second)
			swap(T[i], T[n-1]);
	n--;
	sort(T, T+n);
	minSuf[n] = INF;
	for (int i=n-1; i>=0; i--)
		minSuf[i] = min(minSuf[i+1], T[i].second);
	int res = len(T[n].first, T[n].second) + len(T[n-1].first, minSuf[0]);
	FOR(i, 1, n)
	{
		int a = len(max(T[i-1].first, T[n].first), T[n].second);
		int b = len(T[n-1].first, minSuf[i]);
		remax(res, a + b);
	}
	
	int a = len(max(T[n].first, T[n-1].first), T[n].second);
	remax(res, a + M);
	
	if (n == 1)
		res = len(T[0].first, T[0].second) + len(T[1].first, T[1].second);
	
	printf("%d\n", res);
}
 
int main()
{
	int t;
	t = 1;//scanf ("%d", &t);
	while (t--)
		solve();
	return 0;
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N;
  cin >> N;
  vector<PII> as(N), bs(N);
  cin >> as >> bs;

  SORT(bs);
  vector<bool> used(N);
  REP(i,N){
	int r = -1;
	REP(j,N){
	  if(used[j]) continue;
	  if((as[j].FF < bs[i].FF && as[j].SS < bs[i].SS)
		 && (r == -1 || as[r].SS < as[j].SS))
		r = j;
	}
	if(r != -1) used[r] = true;
  }
  cout << count(ALL(used), true) << endl;

  return 0;
}


Measured memory_bytes: 256
/* C - :(Colon) */

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int A = scan.nextInt();
    int B = scan.nextInt();
    int H = scan.nextInt();
    int M = scan.nextInt();
    double arg1 = 30 * H + 0.5 * M;
    double arg2 = 6 * M;
    double x1 = A * Math.cos(Math.toRadians(arg1));
    double y1 = A * Math.sin(Math.toRadians(arg1));
    double x2 = B * Math.cos(Math.toRadians(arg2));
    double y2 = B * Math.sin(Math.toRadians(arg2));
    System.out.println(Math.hypot(x2 - x1, y2 - y1));
  }
}


Measured memory_bytes: 36056
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    int N;
    cin >> N;
    cout << ((N >= 30) ? "Yes" :"No") << endl;
}


Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;


int main(){
	int D,N;

	scanf("%d %d", &D, &N);

	int ans = 1;
	for(int i=0;i<D;i++){
		ans *= 100;
	}
	if(N<100) ans *= N;
	else ans *= 101;

	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	int n,k;
	cin >> n >> k;
	if (n%k ==0) {
		cout << 0 << endl;
	} else {
		cout << 1 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>
#include <complex>

const long INF = (1l << 30);
const long LINF = (1l << 60);
const long MOD = 1000000007;

long n;
long cnt[3];
long ans = 1;
typedef std::pair<long, long> P;

P count(long a){//number, index
    long res =0;
    long vis = 0;
    for(int i = 0; i < 3; i++){
        if(cnt[i] == a){
            res++;
            vis = i;
        }
    }
    return P(res, vis);
}

int main(){
    scanf("%ld", &n);
    for(int i = 0; i < n; i++){
        long a;
        scanf("%ld", &a);
        P res = count(a);
        ans *= res.first;
        ans %= MOD;
        cnt[res.second]++;
    }
    printf("%ld\n", ans);
}


Measured memory_bytes: 256
from itertools import permutations
import math
menu=5
times=[int(input()) for i in range(menu)]
orders=list(permutations(times,menu))
minimum=sum(math.ceil(time/10)*10 for time in times)
for order in orders:
    total=order[0]
    for i in range(1,menu):
        total+=math.ceil(order[i]/10)*10
    minimum=min(minimum,total)
print(minimum)

Measured memory_bytes: 9176
#include<bits/stdc++.h>
using namespace std;
int l[21][530000],r[21][530000],f[530000],g[530000],mi[530000],x[530000];
int main()
{
	int n,v,lim=0;scanf("%d%d",&n,&v);while (v>>(lim+1)) lim++;lim++;cerr<<(1<<(lim+1))<<endl;
	for (int i=1;i<=n;i++) scanf("%d",&x[i]);
	for (int p=0;p<=lim;p++)
	{
		l[p][0]=1;for (int i=1;i<=n;i++) l[p][i]=(x[i]-x[i-1]<=(v>>p))?l[p][i-1]:i;
		r[p][n+1]=n;for (int i=n;i>=1;i--) r[p][i]=(x[i+1]-x[i]<=(v>>p))?r[p][i+1]:i;
	}
	for (int s=0;s<(1<<(lim+1));s++) g[s]=n+1;
	for (int s=0;s<(1<<(lim+1));s++)
	for (int i=0;i<=lim;i++) if (!(s&(1<<i)))
	{
		f[s|(1<<i)]=max(f[s|(1<<i)],r[i][f[s]+1]);
		g[s|(1<<i)]=min(g[s|(1<<i)],l[i][g[s]-1]);
	}
	for (int i=0;i<=n;i++) mi[i]=n+2;
	for (int i=0;i<(1<<(lim+1));i+=2) mi[f[i]]=min(mi[f[i]],g[(1<<(lim+1))-2-i]);
	for (int i=n-1;i>=0;i--) mi[i]=min(mi[i],mi[i+1]);
	for (int i=1;i<=n;i++) puts((mi[l[0][i]-1]<=r[0][i]+1)?"Possible":"Impossible");
	//for (int i=1;i<=n;i++) printf("%d %d %d\n",l[0][i],r[0][i],mi[i]);
}

Measured memory_bytes: 87168
n = int(input())
h_list = [[0] * 3 for _ in range(n + 1)]
for i in range(1, n + 1):
    a, b, c = [int(x) for x in input().split()]
    h_list[i][0] = a + max(h_list[i - 1][1], h_list[i - 1][2])
    h_list[i][1] = b + max(h_list[i - 1][0], h_list[i - 1][2])
    h_list[i][2] = c + max(h_list[i - 1][0], h_list[i - 1][1])
print(max(h_list[n]))

Measured memory_bytes: 28760
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;

#define rep(i,n) for (int i=0; i<(n); i++)
const int INF =1001001001;


int main(){
    int n;
    cin >>n;
    vector<int> a_v(n,0);
    vector<int> staff_v(n,0);
    for(int i=0; i<n-1; i++){
        int staff;
        cin >> staff;
        staff_v[staff-1] += 1;
    }
    rep(i,n) {cout << staff_v[i] << endl;}
    return 0;
}

Measured memory_bytes: 4792
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
//#define PI 3.14159265358979

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

typedef pair< int, int > pii;
typedef long long ll;

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1 << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;

signed main() {
	string S;
	cin >> S;
	N = S.size();
	vector< int > dp(N + 1, LINF);
	vector< int32_t > dp2(1 << 26, N * 10);
	dp2[0] = 0;
	int h = 0;
	dp[0] = 0;
	rep(i, N) {
		h ^= (1 << (S[i] - 'a'));
		rep(k, 27) {
			int h2 = h;
			if (k < 26) {
				h2 ^= (1 << k);
			}
			chmin(dp[i + 1], dp2[h2] + 1);
		}
		chmin(dp2[h], dp[i + 1]);
	}
	cout << dp[N] << endl;
	return 0;
}

Measured memory_bytes: 264324
var N = Int(readLine()!)!
var result = ""
let base = Int(Character("a").unicodeScalars.first!.value)
while N > 0 {
  N -= 1
  let mod = N % 26
  result.append(String(Character(UnicodeScalar(mod + base)!)))
  N /= 26
}
print(String(result.reversed()))

Measured memory_bytes: 7760
n, k = map(int, input().split())
s = input()

change = [0]
for i, (e1, e2) in enumerate(zip(s, s[1:])):
	e1 = int(e1)
	e2 = int(e2)
	if e1 ^ e2:
		change.append(i + 1)

change.append(n)
end = len(change) - 1

ans = 0
for i, l in enumerate(change[:-1]):
	if s[l] == "1":
		ri = min(i + 2 * k + 1, end)
	else:
		ri = min(i + 2 * k, end)

	r = change[ri]

	ans = max(ans, r - l)

print(ans)


Measured memory_bytes: 8024
/*
    @uthor: Amit Kumar
    user --> GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"\Case #"<<x<<"\:"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}


void virus(){
        string fir, sec;
        cin>>fir>>sec;
        string copy = sec.substr(0,fir.size());
        if(fir.compare(copy) == 0) cout<<"Yes";
        else cout<<"No";
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t = 1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Measured memory_bytes: 3644
while 1:
    m, f, r = map(int, input().split())
    
    if m == f == r == -1:
        break
    elif (m == -1 or f == -1) or (m + f < 30):
        print("F")
    elif m + f >= 80:
        print("A")
    elif m + f >= 65 and m + f < 80:
        print("B")
    elif m + f >= 50 and m + f < 65:
        print("C")
    elif m + f >= 30 and m + f < 50:
        if r >= 50:
            print("C")
        else:
            print("D")
        

Measured memory_bytes: 7628
#include<bits/stdc++.h>
#define int long long
#define MOD 1000000007

using namespace std;

bool visit[100001];
int ans, h, n, k, frac[100001] = {};
vector<int> tree[100001];

int fpow(int a, int n)
{
    a %= MOD;
    int ans = 1;
    for (; n; n /= 2, a = a * a % MOD)
        if (n & 1)
            ans = ans * a % MOD;
    return ans;
}

int P(int a, int b)
{
    if (b > a)
        return 0;
    return frac[a] * fpow(frac[a - b], MOD - 2) % MOD;
}

void dfs(int n)
{
    visit[n] = true;
    if (ans == 0)
        return;
    ans = ans * P(k - 1 - (h > 0), tree[n].size() - (h > 0)) % MOD;

    for (int i : tree[n])
    {
        if (!visit[i])
            h++, dfs(i), h--;
    }
    return;
}

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

    frac[0] = 1;
    for (int i = 1; i < 100001; i++)
        frac[i] = frac[i - 1] * i % MOD;

    int a, b;
    cin >> n >> k;
    for (int i = 0; i < n - 1; i++)
        cin >> a >> b, tree[a].push_back(b), tree[b].push_back(a);

    ans = k;
    h = 0;
    dfs(1);
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 8960
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define ft first
#define sd second
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
typedef pair<long long,long long> pll;

int main() {
    fastIO;
    int n, aux, rta = 0;
    cin >> n;
    for(int i = 1; i <= n; i++){
        aux = log10(i)+1;
        if(aux%2) rta++;
    }
    cout << rta << endl;
    return 0;
}



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

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1,i,j;
   // cin>>t;
    while(t--)
    {
        int n,m,count=0,sum=0,maxi=0,mini=1e18;
        string s;
        cin>>m;
        cin>>s;
        if(s.length()>m)
        {
            for(i=0;i<m;i++)
                cout<<s[i];
            cout<<"...";    
        }
        else
        {
            cout<<s;
        }
    }
}

Measured memory_bytes: 3640
unittest
{
	assert( [ "4", "10 30 40 20" ].parse.expand.solve == 30 );
	assert( [ "2", "10 10" ].parse.expand.solve == 0 );
	assert( [ "6", "30 10 60 10 60 50" ].parse.expand.solve == 40 );
}



import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto hs = input.front.split.to!( long[] );
	return tuple( hs );
}

auto solve( long[] hs )
{
	auto dp = new long[ hs.length ];
	
	dp[ 0 ] = 0L;
	dp[ 1 ] = ( hs[ 0 ] - hs[ 1 ] ).abs;
	foreach( i; 2 .. dp.length )
	{
		auto p2 = dp[ i - 2 ] + ( hs[ i - 2 ] - hs[ i ] ).abs;		// 2つ前から跳んできたときの累積コスト
		auto p1 = dp[ i - 1 ] + ( hs[ i - 1 ] - hs[ i ] ).abs;		// 1つ前から跳んできたときの累積コスト
		dp[ i ] = min( p2, p1 );
	}
	
	return dp[ $ - 1 ];
}


Measured memory_bytes: 5020
N, A ,B = map(int,(input().split()))
ans = 0
for i in range(N):
    sum = 0
    temp = i + 1
    temp_str = str(temp)
    temp_list = list(temp_str)
    
    for j in temp_list:
        sum += int(j)
    
    if sum >= A:
        if sum <= B:
            ans += temp

print(ans)

Measured memory_bytes: 3060
a,b,c = map(int,input().split())
if a > b:
	A = a
	a = b
	b = A

yoru = 1    
if a < c and b > c:
	yoru = 1
else:
	yoru = 0
if yoru == 1:
	print("Yes")
else:
	print("No")

Measured memory_bytes: 2940
number_of_letter={'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,'j':0,'k':0,'l':0,'m':0,'n':0,'o':0,'p':0 \
,'q':0,'r':0,'s':0,'t':0,'u':0,'v':0,'w':0,'x':0,'y':0,'z':0}

while True:
    letters=''
    try:
        letters=input()
    except:
        break

    letters=letters.lower()
    number_of_letter['a']+=letters.count('a')
    number_of_letter['b']+=letters.count('b')
    number_of_letter['c']+=letters.count('c')
    number_of_letter['d']+=letters.count('d')
    number_of_letter['e']+=letters.count('e')
    number_of_letter['f']+=letters.count('f')
    number_of_letter['g']+=letters.count('g')
    number_of_letter['h']+=letters.count('h')
    number_of_letter['i']+=letters.count('i')
    number_of_letter['j']+=letters.count('j')
    number_of_letter['k']+=letters.count('k')
    number_of_letter['l']+=letters.count('l')
    number_of_letter['m']+=letters.count('m')
    number_of_letter['n']+=letters.count('n')
    number_of_letter['o']+=letters.count('o')
    number_of_letter['p']+=letters.count('p')
    number_of_letter['q']+=letters.count('q')
    number_of_letter['r']+=letters.count('r')
    number_of_letter['s']+=letters.count('s')
    number_of_letter['t']+=letters.count('t')
    number_of_letter['u']+=letters.count('u')
    number_of_letter['v']+=letters.count('v')
    number_of_letter['w']+=letters.count('w')
    number_of_letter['x']+=letters.count('x')
    number_of_letter['y']+=letters.count('y')
    number_of_letter['z']+=letters.count('z')

for i in range(97,123):
    print(chr(i),':',number_of_letter[chr(i)])

Measured memory_bytes: 7640