akhauriyash/Code-Regression huggingface dataset:
import math
a,b,h,m=map(int,input().split())
if(h==0 and m==0):
  print(abs(a-b))
else:  
  ah=(h*30)+(m*0.5)
  am=m*6
  an=abs(ah-am)
  f=abs(360-an)
  ang=min(an,f)
  d=math.cos(math.radians(ang))
  z=math.sqrt((a**2)+(b**2)-(2*b*a*d))
  print(z)

Measured memory_bytes: 9528
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, s, n)    for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...)  type __VA_ARGS__; read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream& operator>> (istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x): x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

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

    var(int, N);
    map<string, int> b;
    rep(i, 0, N) {
        var(string, s);
        b[s] += 1;
    }

    var(int, M);
    map<string, int> r;
    rep(i, 0, M) {
        var(string, s);
        r[s] += 1;
    }

    int ans = 0;

    for (const auto &e : b) {
        chmax(ans, e.second - r[e.first]);
    }

    print(ans);

    return 0;
}


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

#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< pii,vector<pii> ,greater< pii >>

using namespace std;


//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/*int power(int a,int n)
{
    if(n == 1)return a%mod;
    if(n == 0)return 1;
    if(n&1)return ((a%mod)*(power((a*a)%mod,n/2))%mod)%mod;
    return power((a*a)%mod,n/2)%mod;
}*/
//const int md = 998244353;

/*int inverse(int x){

    return power(x,mod-2)%mod;//little fermat....
}*/
const int inf = (int) 1e18;
const int md = (int) 1e9+21;


signed main()
{
    showoff;
    int n,m,l[maxn],r[maxn],mal = 0,mir = mod;
    cin >> n >> m;
    vector<pii>v;
    FOR(i,0,m){
        cin >> l[i] >> r[i];
        mal = max(mal,l[i]);
        mir = min(mir,r[i]);
    }
    int ans = 0;
    FOR(i,1,n+1)if(i >= mal && i <= mir)ans++;
    cout << ans;
    return 0;
}
//*->for large size of matrix take int not long long if possible......
//*->always take maximum as inf for safer side ...

Measured memory_bytes: 3072
#include <iostream>
using namespace std;
typedef long long ll;
static const ll Z = 1 << 21;
char s[Z], t[Z];
#define rep(i,s,n)for(ll i = s;i<n;i++)
int strcmp(const char *s, const char* t) {
	while (*s == *t) {
		if (*s == '\0') {
			return 0;
		}
		s++;
		t++;
	}

	return *s - *t;
}
void charsort(char *s, bool isasc) {
	char d;
	int i = 0, j;
	while (*(s + i)) {
		j = i + 1;
		while (*(s + j)) {
			bool change = isasc ? (*(s + i) > *(s + j)) : (*(s + i) < *(s + j));
			if (change) {
				d = *(s + j);
				*(s + j) = *(s + i);
				*(s + i) = d;
			}
			j++;
		}
		i++;
	}
}

int main() {
	cin >> s >> t;
	charsort(s, true);
	charsort(t, false);

	cout << ((strcmp(s, t) < 0) ? "Yes" : "No") << endl;
	return 0;
}

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

const int Maxn = 100005;

int n, k;
int a[Maxn];
int res = Maxn;

int main()
{
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i]);
	int pos = 0;
	while (a[pos] != 1) pos++;
	for (int i = 0; i < n; i++)
		if (i <= pos && i + k > pos) {
			int cand = 1;
			cand += i / (k - 1) + bool(i % (k - 1) > 0);
			if (i + k <= n) {
				int lft = n - (i + k);
				cand += lft / (k - 1) + bool(lft % (k - 1) > 0);
			}
			res = min(res, cand);
		}
	printf("%d\n", res);
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  int A,B,X;
  cin >> A >> B >> X;
  if(X>=A&&X<=A+B)
  {
    cout << "YES" << endl;
  }
  else
  {
    cout << "NO" << endl;
  }
  return 0;
}


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

int N, Q;
vector<int> graph[200200];
vector<ll> ans, cnt;

void dfs(int cur, int pre = -1, int now = 0) {
    now += cnt[cur];
    ans[cur] += now;
    for (auto &nxt : graph[cur]) {
        if (nxt != pre) dfs(nxt, cur, now);
    }
}

int main() {

    cin >> N >> Q;
    REP(i, N - 1) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    cnt.assign(N, 0);
    ans.assign(N, 0);

    REP(i, Q) {
        int p, x;
        cin >> p >> x;
        --p;
        cnt[p] += x;
    }

    dfs(0);
    for (auto &e : ans) {
        cout << e << endl;
    }

}


Measured memory_bytes: 27264
#include <iostream>

#define NIL nullptr

struct Node {
  int key;
  Node *parent, *left, *right;

  Node(int key) : key(key) { parent = left = right = NIL; }
  ~Node() {
    if (right != NIL)
      delete right;
    if (left != NIL)
      delete left;
  }
};

Node *getRoot(Node *t) {
  Node *n = t;
  while (t->parent != NIL) {
    n = n->parent;
  }
  return n;
}

void insert(Node *t, Node *z) {
  Node *root = getRoot(t);
  Node *y = NIL;
  Node *x = root;
  while (x != NIL) {
    y = x;
    if (z->key < x->key)
      x = x->left;
    else
      x = x->right;
  }
  z->parent = y;

  if (y == NIL)
    root = z;
  else if (z->key < y->key)
    y->left = z;
  else
    y->right = z;
}

void printInorder(Node *t) {
  if (t != NIL) {
    printInorder(t->left);
    std::cout << " " << t->key;
    printInorder(t->right);
  }
}

void printPreorder(Node *t) {
  if (t != NIL) {
    std::cout << " " << t->key;
    printPreorder(t->left);
    printPreorder(t->right);
  }
}

int main() {
  int n, k;
  std::cin >> n;
  std::string cmd;
  Node *t = NIL;

  for (int i = 0; i < n; ++i) {
    std::cin >> cmd;
    switch (cmd.at(0)) {
    case 'i':
      std::cin >> k;
      if (t == NIL)
        t = new Node(k);
      else
        insert(t, new Node(k));
      break;
    case 'p':
      printInorder(getRoot(t));
      std::cout << std::endl;
      printPreorder(getRoot(t));
      std::cout << std::endl;
      break;
    }
  }
}



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

#define Task "abc"
#define All(x) (x).begin(), (x).end()
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const ll mod = 1e9 + 7;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//  freopen(Task".inp", "r", stdin); freopen(Task".out", "w", stdout);
  int n, x; cin >> n >> x;
  vector<ll> a(n+1);
  ll ans = 0;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 2; i <= n; ++i){
    ll d = max(a[i] + a[i-1] - x, 0ll);
    ans += d;
    a[i] = max(a[i] - d, 0ll);
  }
  cout << ans;
}



Measured memory_bytes: 1024
import java.util.Scanner;

/**
 * 二分探索木：探索
 * @author nobu
 * @see <a href="http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_8_B&lang=ja">ALDS1_8_B</a>
 */
public class Main {

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

		String command;
		Tree tree = new Tree();
		for (int i = 0; i < n; i++) {
			command = sc.next();
			if ("insert".equals(command)) {
				int key = sc.nextInt();
				tree.insert(new Node(key));
			} else if ("find".equals(command)) {
				int key = sc.nextInt();
				System.out.println(tree.exists(key) ? "yes" : "no");
			} else if ("print".equals(command)) {
				tree.print(Tree.Order.InOrder);
				tree.print(Tree.Order.PreOrder);
			}
		}

		sc.close();
	}

}

class Node {
	int key;
	Node parent, left, right;

	Node(int key) {
		this.key = key;
	}
}

class Tree {
	enum Order {
		PreOrder,
		InOrder,
		PostOrder
	}

	Node root;

	protected Node insert(Node node) {
		Node parent = null;
		Node child = root;

		while (child != null) {
			parent = child;
			if (node.key < child.key) child =child.left;
			else child = child.right;
		}
		node.parent = child;

		if (parent == null) {
			root = node;
		} else if (node.key < parent.key) {
			parent.left = node;
		} else {
			parent.right = node;
		}

		return node;
	}

	protected boolean exists(int key) {
		Node child = root;
		while (child != null) {
			if (child.key == key) return true;
			if (key < child.key) child = child.left;
			else child = child.right;
		}
		return false;
	}

	protected void print(Order order) {
		switch (order) {
			case PreOrder:
				walkPreOrder(root);
				break;
			case InOrder:
				walkInOrder(root);
				break;
			case PostOrder:
				walkPostOrder(root);
				break;
		}
		System.out.println();
	}

	private void walkPreOrder(Node node) {
		if (node == null) return;
		System.out.print(" " + node.key);
		walkPreOrder(node.left);
		walkPreOrder(node.right);
	}

	private void walkInOrder(Node node) {
		if (node == null) return;
		walkInOrder(node.left);
		System.out.print(" " + node.key);
		walkInOrder(node.right);
	}

	private void walkPostOrder(Node node) {
		if (node == null) return;
		walkPostOrder(node.left);
		walkPostOrder(node.right);
		System.out.print(" " + node.key);
	}
}


Measured memory_bytes: 201676
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

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

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

const int MAXN 	= 100001;
const int BIG_NUM = 1000000007;

int N;
int x,y;
vector <int> graph[MAXN];
vector <long long> B,W,vis;

int solve(int root){
	
	if(vis[root])
		return (B[root]+W[root])%BIG_NUM;

	vis[root]=1;
	
	for(auto child : graph[root]){
		if(!vis[child]){
			solve(child);
			B[root] = (B[root]*W[child])%BIG_NUM ;
			W[root] = (W[root]*(W[child] + B[child]))%BIG_NUM ;
		}
	}

	return (B[root]+W[root])%BIG_NUM;
}

int main(){
	cin>>N;

	B.resize(N,1);
	W.resize(N,1);
	vis.resize(N,0);

	for(int i=1;i<N;i++){
		cin>>x>>y;
		graph[x-1].push_back(y-1);
		graph[y-1].push_back(x-1);
	}

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


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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define fi first
#define se second
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, VL, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18 + 1;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

string S;
ll dp[2][4];

signed main() {
    cin >> S;
    ll ans = 0, now = 0, next = 1;
    dp[0][0] = 1;
    REP(i, S.length()) {
        Fill(dp[next], 0);
        if(S[i] == '?') {
            REP(j, 4)(dp[next][j] += dp[now][j] * 3) %= MOD;
            REPR(j, 2) { (dp[next][j + 1] += dp[now][j]) %= MOD; }
        } else {
            REP(j, 4)(dp[next][j] += dp[now][j]) %= MOD;
            ll tgt = ll(S[i] - 'A') + 1;
            (dp[next][tgt] += dp[now][tgt - 1]) %= MOD;
        }
        swap(now, next);
    }
    cout << dp[now][3] << "\n";
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define dbg(x) cout<<#x<<": "<<(x)<<"\n"

using namespace std;

const int MAX_N = 114514;
const int MAX_E = 114514;
int n, m;

struct edge {
    int u, v, cost;
    edge() {}
    edge(int a, int b, int c) {
        u=a; v=b; cost=c;
    }
};

edge es[MAX_E];

bool comp(const edge& e1, const edge& e2) {
    return e1.cost < e2.cost;
}


//
// Union-Find
//
int par[MAX_N], _rank[MAX_N];

void init(int n) {
    for (int i = 0; i < n; i++) {
        par[i] = i; _rank[i] = 0;
    }
}

int find(int x) {
    if(par[x] == x) {
        return x;
    } else {
        return par[x] = find(par[x]);
    }
}

void unite(int x, int y) {
    x = find(x); y = find(y);
    if(x == y) return ;

    if(_rank[x] < _rank[y]) {
        par[x] = y;
    } else {
        par[y] = x;
        if(_rank[x] == _rank[y]) _rank[x]++;
    }
}

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


int kruskal() {
    sort(es, es+m, comp);
    init(n);
    int res = 0;
    rep(i,m) {
        edge e = es[i];
        if(!same(e.u, e.v)) {
            unite(e.u, e.v);
            res += e.cost;
        }
    }
    return res;
}

void solve() {
    cin>>m;
    rep(i,m) {
        int a,b,d;
        scanf("%d,%d,%d",&a,&b,&d);
        es[i] = edge(a, b, d/100 - 1);
    }
    int res = kruskal();
    cout << res << endl;
}

int main() {
    while(cin>>n, n) solve();
    return 0;
}

Measured memory_bytes: 3156
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b,c,d = LI()
    a += b
    c += d
    if a>c:
        return 'Left'
    if a<c:
        return 'Right'

    return 'Balanced'



print(main())




Measured memory_bytes: 5460
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u32,
        b: u32,
    }
    if a <= b {
        println!("{}", a);
    } else {
        println!("{}", a - 1);
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
 
int main(void){
	int n,max =0,ans =0;
	scanf("%d",&n);
	char s[n];
	int flag_a[26];
	int flag_b[26];
	scanf("%s",&s);
	
	int i,j;
	for(i=0;i<n;i++){
		//flagの初期化
		for(j=0;j<26;j++){
		flag_a[j]=0;
		flag_b[j]=0;
		}
		//0からiまでにa-zがあるかどうか判別する
		for(j=0;j<i;j++){
			int k;
			for(k=0;k<26;k++){
				if( s[j] ==97+k)flag_a[k] =1;
			}
		}
		//i+1からnまでにa-zがあるかどうか判別する
		for(j=i;j<n;j++){
			int k;
			for(k=0;k<26;k++){
				if( s[j] ==97+k)flag_b[k] =1;
			}
		}
		for(j=0;j<26;j++){
			if( flag_a[j] == flag_b[j] && flag_a[j]==1){
				ans++;
			}
		}
		if( max < ans) max = ans;
		ans =0;
	}
	printf("%d",max);
	return 0;
}

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

int main() {
    string s;
    cin >> s;
    int size = s.length() - 1;
    int half = s.length() / 2;
    int counter = 0;
    for (int i = 0; i < half; ++i) {
        if (s[i] != s[size - i]) ++counter;
    }
    cout << counter << endl;
}

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

#include <vector>

using namespace std;

int main()
{
    int b , r , f , v , n;
    char suit;
    cin >> n;

    int building[4][3][10] = {};
    
    for (int i = 0; i < n; i++) {
        cin >> b >> f >> r >> v;
        building[b - 1][f - 1][r - 1] = building[b - 1][f - 1][r - 1]+ v;
    }


    for (int i = 0; i < 4; i++) {
        for (int h = 0; h < 3; h++) {
           for (int j = 0; j < 10; j++) {
               cout << " "<< building[i][h][j];
        }
           cout << endl;
    }
        if (i != 3) {
            cout << "####################" << endl;
        }
}

    return 0;
}


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

int main(int argc, char const* argv[])
{
    int A,B,X;
    cin>>A>>B>>X;
    int zentai=A+B;
    int a;
    if(A>X){
        cout<<"NO"<<endl;
        return 0;
    }
    else{
        a=X-A;
    }
    if(a<=B){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <string>

using namespace std;

typedef long long LL;
typedef unsigned int UI;

#define rSort(a) 		sort(a.rbegin(),a.rend())
#define Sort(a) 		sort(a.begin(),a.end())
#define Reverse(a) 		reverse(a.begin(),a.end())
#define Sum(a)  		accumulate(a.begin(), a.end(), 0)
#define REP(i, n) 		for(UI i = 0;i < n;i++)
#define REPR(i, n) 		for(UI i = n;i >= 0;i--)
#define FOR(i, m, n) 	for(UI i = m;i < n;i++)
#define pb(i) 			push_back(i)

#define MOD  			(LL)1e9 + 7;
#define INF  			(LL)1 << 62;



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

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

	int A,B,C;
	int ans;

	cin >> A >> B >> C;

	ans= B / A;

	if (ans > C) {
		ans = C;
	}

	cout << ans << endl;

	return 0;

}


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

int main() {
    int n;
    cin >> n;
    vector<int> h(n);
    for (int i=0; i<n; i++) {
        cin >> h.at(i);
    }
    int max=0, s=0;
    for (int i=1; i<n; i++) {
        if (h[i-1] < h[i]) {
            if (max < (i-1)-s) {
                max = (i-1)-s;
            }
            s = i;
        }
    }
    if (max < n-1-s) {
        max = n-1-s;
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<n;i++)
#define REP1(i,n) for(long long i=1;i<=n;i++)
#define REP2D(i,j,h,w) for(long long i=0;i<h;i++) for(long long j=0;j<w;j++)
#define REP2D1(i,j,h,w) for(long long i=1;i<=h;i++) for(long long j=1;j<=w;j++)
#define PER(i,n) for(long long i=((n)-1);i>=0;i--)
#define PER1(i,n) for(long long i=(n);i>0;i--)
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define FORE(i,a,b) for(long long i=(a);i<=(b);i++)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();++ite)
#define ALL(a) (a.begin()),(a.end())
#define RANGE(a) (a),(a+sizeof(a))
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define YNPRT(b) cout<<((b)?"Yes":"No")<<endl
#define ENTER printf("\n")
#define REV(arr) reverse(ALL(arr))
#define PRT(a) cout<<a<<endl
#ifdef DEBUG
#define DBPRT(a) cout << "[Debug] - " << #a << " : " << a << endl
#define DBSTART if(1){
#define DBEND }
#else
#define DBPRT(a) do{}while(0)
#define DBSTART if(0){
#define DBEND }
#endif
#define PRTLST(arr,num) REP(_i,num) cout<<_i<<" - "<<arr[_i]<<endl;
#define PRTLST2(arr2,d1,d2) REP(_i,d1) REP(_j,d2) cout<<_i<<","<<_j<<" : "<<arr2[_i][_j]<<endl;
#define PRTLST2D(arr2,d1,d2) do{cout<<"L\t";REP(_i,d2) cout<<_i<<"\t"; cout<<endl; REP(_i,d1){cout<<_i<<"\t";REP(_j,d2){cout<<arr2[_i][_j]<<"\t";}cout<<endl;}}while(0);

#define TOSUM(arr,sum,n) {sum[0]=arr[0];REP1(i,n-1) sum[i]=sum[i-1]+arr[i];}

#define MIN(target,v1) (target)=min(target,v1)
#define MAX(target,v1) (target)=max(target,v1) 
#define P1 first
#define P2 second
#define PB push_back
#define UB upper_bound
#define LB lower_bound
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF_INT = 2147483647;
const ll INF_LL = 9223372036854775807LL;
const ull INF_ULL = 18446744073709551615Ull;
const ll P = 92540646808111039LL;
const int Move[4][2] = {-1,0,0,1,1,0,0,-1};
const int Move_[8][2] = {-1,0,-1,-1,0,1,1,1,1,0,1,-1,0,-1,-1,-1};
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p) {os<<"( "<<p.P1<<" , "<<p.P2<<" )";return os;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {ITE(v) os << (ite-v.begin()) << " : " << *ite <<endl;return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v) {os<<" { ";ITE(v) {os<<*ite;if(ite!=--v.end()){os<<" , ";}} os<<" } ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& m) {ITE(m) {os<<ite->P1<<"\t\t|->\t\t"<<ite->P2<<endl;} return os;}

//---------------------
#define MAXN 50005
//---------------------

ll c[MAXN];
ll n;

int main(){
	cin >> n;
	REP(i,MAXN) c[i] = floor( (double)i * 1.08 );
	int found = 0;
	REP(i,MAXN) if(c[i] == n) {PRT(i);found = 1;break;}
	if(!found) PRT(":(");
	return 0;
}










Measured memory_bytes: 640
from sys import stderr, setrecursionlimit
from math import ceil
setrecursionlimit(2147483647)
def getInt():
    return int(input())
def getInts():
    return [int(i) for i in input().split()]
def getIntLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInt())
    return res
def getIntsLines(n=1):
    res = []
    for _ in range(n):
        res.append(getInts())
    return res
def debug(*args, **kwargs):
    print(*args, file=stderr, **kwargs)

n = getInt()
ans = []
for i in range(n-1):
    c, s, f = getInts()
    ans.append(c + s)
    for j in range(i):
        # ans[j]にはj駅からi駅にたどり着くまでの最短時間が入っている
        if ans[j] <= s:
            # 最初の出発時間より速く到達できれば律速はi駅の最初の出発時間になる
            ans[j] = ans[i]
        else:
            # 最初の電車に乗れなかった場合，(ans[j]より大きい最小のfの倍数)時間まで待つ必要がある(さらに電車に乗る時間cを加える)
            # min({x | x % f == 0, x > ans[j]})
            ans[j] = ceil(ans[j]/f) * f + c
    debug(ans)

print(*ans, sep='\n')
print(0)


Measured memory_bytes: 3188
use strict;
use warnings;

main();

sub main{
	(my $nOB, my $total) =split" ", ,<stdin>;

	for(my $i = 0; $i <= $nOB; $i++){
		for(my $j = 0; $i+$j <= $nOB; $j++){
			my $k = $nOB - $i -$j;
			my $tmpVal = $i*10000 + $j*5000 + $k*1000;
			if($k >= 0 && $tmpVal == $total){ print "$i $j $k\n"; return;} 
		}	
	} 
	print "-1 -1 -1\n"

}
1;

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

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;


int main(){
  int n,m;
  cin >> n >> m;
  if(n==m)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string n;
	int i, ans;
	cin >> n;
	ans = 0;
	for (i = 0; i < n.length(); i++) {
		ans += (n[i] - '0');
	}
	if (ans % 9 == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 3732
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#else
#define MY_NAMESPACE(ns) 
#define MY_NAMESPACE_    
#endif

#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

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


MY_NAMESPACE(sandbox)
ll gcd(ll a, ll b)
{
	if (a < b)
		swap(a, b);
	if (a % b == 0)
		return b;
	return gcd(b, a % b);
}

ll modpow(ll base, ll exponent, ll mod)
{
	ll retval = 1;
	while (exponent > 0)
	{
		if (exponent % 2)
			retval = (retval * base) % mod;
		exponent /= 2;
		base = (base * base) % mod;
	}
	return retval;
}

class HashPair
{
public:
	static size_t m_hash_pair_random;

	template<class T1, class T2>
	size_t operator()(const pair<T1, T2>& p) const {

		auto hash1 = hash<T1>{}(p.first);
		auto hash2 = hash<T2>{}(p.second);

		size_t seed = 0;
		seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		seed ^= hash2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		seed ^= m_hash_pair_random + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		return seed;
	}
};

size_t HashPair::m_hash_pair_random = (size_t)random_device()();

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

	ll modval = 1000000007;

	int n;
	cin >> n;
	//map<pll, int> cnt;
	unordered_map<pll, int, HashPair> cnt;
	for (int i = 0; i < n; i++)
	{
		ll a, b;
		cin >> a >> b;
		if (a != 0 && b != 0)
		{
			if (a < 0)
			{
				a *= -1;
				b *= -1;
			}
			ll g = gcd(abs(a), abs(b));
			cnt[{a / g, b / g}]++;
		}
		else if (a == 0 && b == 0)
			cnt[{0, 0}]++;
		else if (a == 0)
			cnt[{0, 1}]++;
		else  // b == 0
			cnt[{1, 0}]++;
	}

	ll num00 = 1;
	if (cnt[{0, 0}] == 0)
		num00 = 0;
	else
		num00 = cnt[{0, 0}];
	cnt.erase(make_pair(0,0));

	ll num = 1;
	while (!cnt.empty())
	{
		//auto this_item = *cnt.begin();
		//cnt.erase(cnt.begin());
		//pll this_pair = this_item.first;
		//pll anti_pair = { this_pair.second, -this_pair.first };
		//if (anti_pair.first < 0)
		//	anti_pair = { -this_pair.second, this_pair.first };
		//else if (anti_pair.first == 0)
		//	anti_pair = { 0, 1 };
		//if (cnt.find(anti_pair) == cnt.end())
		//	cnt[anti_pair] = 0;
		//auto anti_item = cnt.find(anti_pair);

		auto this_item = cnt.begin();
		pll this_pair = this_item->first;
		pll anti_pair = { this_pair.second, -this_pair.first };
		if (anti_pair.first < 0)
			anti_pair = { -this_pair.second, this_pair.first };
		else if (anti_pair.first == 0)
			anti_pair = { 0, 1 };
		if (cnt.find(anti_pair) == cnt.end())
			cnt[anti_pair] = 0;
		auto anti_item = cnt.find(anti_pair);

		num = num * (modpow(2, this_item->second, modval) - 1 + modpow(2, anti_item->second, modval) - 1 + 1) % modval;
		cnt.erase(this_item);
		cnt.erase(anti_item);
	}
	ll retval = (num + modval - 1) % modval;
	cout << (retval + num00) % modval << "\n";
		
	return 0;
}
MY_NAMESPACE_

Measured memory_bytes: 14656
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
print(rs()[::2])

Measured memory_bytes: 65644
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cctype>

using namespace std;

#define ll long long

void solve() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max(max(max(a * c, a * d), b * c), b * d) << endl;
    return ;
}

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

Measured memory_bytes: 3188
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n,k = map(int,input().split())
a = list(map(int,input().split()))

bit_sum = [0]*40
keta = [0]*40

for i in a:
    for j in range(40):
        if i&2**j == 2**j:
            bit_sum[j] += 1

k_bit = [0]*40
flag = False

for i in range(40):
    if k&2**i == 2**i:
        k_bit[i] = 1

def count(ke,flag):
    if ke == -1:
        return 0
    if k_bit[ke] == 1:
        if flag:
            return max(2**ke*bit_sum[ke],2**ke*(n-bit_sum[ke]))+count(ke-1,flag)
        else:
            if 2**ke*(n-bit_sum[ke]) > 2**ke*bit_sum[ke]:
                return 2**ke*(n-bit_sum[ke])+count(ke-1,flag)
            else:
                flag = True
                return 2**ke*bit_sum[ke]+count(ke-1,flag)
    else:
        if flag:
            return max(2**ke*bit_sum[ke],2**ke*(n-bit_sum[ke]))+count(ke-1,flag)
        else:
            return 2**ke*bit_sum[ke]+count(ke-1,flag)

print(count(39,False))

Measured memory_bytes: 68696
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC omodtimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<long long,long long> ii; 	
typedef complex<long double> com;

const ll mod = 1e9+7;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin >> n;
	vector <ll> arr(n+1);
	for (int z=1;z<=n;z++){
		cin >> arr[z];
	}
	ll dp[n+1][3][2];
	for (int z=0;z<=n;z++){
		for (int x=0;x<3;x++){
			for (int y=0;y<2;y++){
				dp[z][x][y] = -(ll(1) << 50);
			}
		}
	}
	dp[0][0][0] = 0;
	dp[0][0][1] = 0;
	for (int z=1;z<=n;z++){
		dp[z][0][1] = max(dp[z][0][1],dp[z-1][0][0]+arr[z]);
		dp[z][0][0] = max(dp[z][0][0],dp[z-1][0][1]);

		dp[z][1][1] = max(dp[z][1][1],dp[z-1][1][0]+arr[z]);
		dp[z][1][0] = max(dp[z][1][0],dp[z-1][1][1]);

		dp[z][2][1] = max(dp[z][2][1],dp[z-1][2][0]+arr[z]);
		dp[z][2][0] = max(dp[z][2][0],dp[z-1][2][1]);

		if (z >= 3){
			dp[z][1][1] = max(dp[z][1][1],dp[z-3][0][1]+arr[z]);
			dp[z][2][1] = max(dp[z][2][1],dp[z-3][1][1]+arr[z]);
		}

		if (z >= 4){
			dp[z][2][1] = max(dp[z][2][1],dp[z-4][0][1]+arr[z]);
		}
		
	}
	ll ans = -LLONG_MAX;
	if (n & 1){
		for (int x=0;x<3;x++){
			for (int y=0;y<2;y++){
				if (x == 2 && y == 0) continue;
				ans = max(ans,dp[n][x][y]);
			}
		}
	} else {
		for (int x=0;x<2;x++){
			for (int y=0;y<2;y++){
				if (x == 1 && y == 0) continue;
				ans = max(ans,dp[n][x][y]);
			}
		}
	}
	
	cout << ans << endl;
}


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

#define ll long long
#define ull unsigned long long
#define LL long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define sch(n) scanf(" %c", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <ll, ll>
#define plp pair <int, pll >
#define pb push_back
#define fr first
#define sc second
#define all(a)  a.begin(),a.end()
#define Unique(a)  sort(all(a)),a.erase(unique(all(a)),a.end())

#define inf (1LL<<50)
#define eps 1e-9

ll Set(ll n, ll pos)
{
    return n|(1LL<<pos);
}

bool Check(ll n, ll pos)
{
    return (bool) (n&(1LL<<pos));
}

ll a[3050];
ll dp[3050][3050][2];

ll solve(ll b, ll e, bool p)
{
    if (b == e)
        return (p==0?a[b]:-a[b]);

    ll &ret = dp[b][e][p];
    if (ret != -1)
        return ret;

    if (p == 0)
    {
        ret = max(solve(b+1, e, 1) + a[b], solve(b, e-1, 1) + a[e]);
    }
    else
    {
        ret = min(solve(b+1, e, 0) - a[b], solve(b, e-1, 0) - a[e]);
    }

 //   cout << p << " " << b << " " << e << " " << ret << endl;

    return ret;
}

int main ()
{
    //  freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
    //  ios_base::sync_with_stdio(0); // no printf/scanf must be present
    ll cs, ts, i, j, k, x, y, z, q, m, n, cap;

    while(sl(n) != EOF)
    {
        for (i = 1; i <= n; i++)
        {
            sl(a[i]);
            //a[i] *= 2;
        }

        memset(dp, -1, sizeof(dp));

        printf("%lld\n", solve(1, n, 0));
    }
    return 0;
}


Measured memory_bytes: 145792
import sys
import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]

n, q = readIntN()
s = input()
lrs = [readIntN() for i in range(q)]

acc = [0] * n
for i, (b, e) in enumerate(zip(s, s[1:]), 1):
    acc[i] = acc[i-1]
    if b == 'A' and e == 'C':
        acc[i] += 1

for b, e in lrs:
    print(acc[e-1] - acc[b-1])

Measured memory_bytes: 33424
#include<cstdio>
#include<cstring>
using namespace std;
#define MAXN 100005
char s[MAXN];
int main()
{
	scanf("%s",s+1);
	int len=strlen(s+1);
	for(int i=1;i<=len-1;i++)
	{
		if(s[i]==s[i+2])
		{
			printf("%d %d\n",i,i+2);
			return 0;
		}
		if(s[i]==s[i+1])
		{
			printf("%d %d\n",i,i+1);
			return 0;
		}
	}
	printf("-1 -1\n");
	return 0;
}

Measured memory_bytes: 256
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0
#初めから、どこに挿入されるのかを考えておく
Bcount = [0 for i in range(n+1)]
for i in range(1,n+1):
    Bcount[i] = bisect.bisect_left(a, b[i-1]) + Bcount[i - 1]

for i in range(n):
    index = bisect.bisect_left(b,c[i])

    ans += Bcount[index]
print(ans)


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

int main(){
int a,n,c;
cin>>a>>c>>n;

if(a==c && c==n)
    cout<<"No"<<endl;
else if(a==c || c==n ||a==n)
    cout<<"Yes"<<endl;
else
    cout<<"No"<<endl;



}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int num1,num2,num3,num4;
    cin >>num1>>num2>>num4;
    num3 = num1 * num2;
    if (num3 >= num4)
        cout << num4;
    else cout << num3;

    return 0;
}


Measured memory_bytes: 3564
import math
def facts(n):
    ans = []
    for  i in range(1, int(math.sqrt(n)+1)):
        if(n%i==0):
            ans.append(i)
            ans.append(n//i)
    ans = sorted(list(dict.fromkeys(ans)))
    if(ans[-1]==n):
        ans = ans[:-1]
    return ans


n, m,k  = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
pa  = [0]
pb = [0]
ans = 0
for i in range(n):
    pa.append(a[i]+pa[i])
for i in range(m):
    pb.append(b[i]+pb[i])
for c in range(n+1):
    if(pa[c] > k):
        break
    else:
        while(pb[m] > k-pa[c]):
            m-=1
        ans = max(ans, c+m)
            
print(ans)

Measured memory_bytes: 135992
#include <stdio.h>

#define MAX 101


int main(){
  int n, Y[MAX], M[MAX], D[MAX], day[MAX], i, j;
  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d %d %d", &Y[i], &M[i], &D[i] );
    day[i] = 0;
  }

  for(i = 0; i < n; i++){

    if(Y[i] % 3 == 0){
      day[i] += 20 - D[i];
      day[i] += (10 - M[i]) * 20;
      day[i] += ( 1000 - (Y[i] + 1) ) / 3 * 590;
      day[i] += 1;
    }else if(Y[i] % 3 == 1){
      if(M[i] % 2 == 1){
        day[i] += 20 - D[i];
        for(j = M[i]+1; j <= 10; j++){
          if(j % 2 == 0){
            day[i] += 19;
          }else{
            day[i] += 20;
          }
        }
      }else{
        day[i] += 19 - D[i];
        for(j = M[i]+1; j <= 10; j++){
          if(j % 2 == 0){
            day[i] += 19;
          }else{
            day[i] += 20;
          }
        }
      }
      day[i] += 195 + 200;
      day[i] += ( 1000 - (Y[i] + 3) ) / 3 * 590;
      day[i] += 1;
    }else{
      if(M[i] % 2 == 1){
        day[i] += 20 - D[i];
        for(j = M[i]+1; j <= 10; j++){
          if(j % 2 == 0){
            day[i] += 19;
          }else{
            day[i] += 20;
          }
        }
      }else{
        day[i] += 19 - D[i];
        for(j = M[i]+1; j <= 10; j++){
          if(j % 2 == 0){
            day[i] += 19;
          }else{
            day[i] += 20;
          }
        }
      }
      day[i] += 200;
      day[i] += ( 1000 - (Y[i] + 2) ) / 3 * 590;
      day[i] += 1;
    }

  }

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

  return 0;
}



Measured memory_bytes: 2144
#pragma GCC optimize("O3")
#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;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

#define all(a) (a).begin(), (a).end()

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

vector<ll> len(60, 1), p(60, 1);

ll solve(int n, ll x){
    if(n == 0) return x;

    if(x == 1) return 0;
    else if(x <= 1 + len[n-1]) return solve(n - 1, x - 1);
    else if(x == 2 + len[n-1]) return p[n-1] + 1;
    else if(x <= 2 * (1 + len[n-1])) return p[n-1] + 1 + solve(n - 1, x - 2 - len[n-1]);
    else return p[n];
}

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

    int n; cin>>n;
    ll x; cin>>x;
    for(int i=0; i<n; i++){
        len[i+1] = len[i] * 2 + 3;
        p[i+1] = p[i] * 2 + 1;
    }

    cout << solve(n, x) << endl;

    return 0;
}

Measured memory_bytes: 256