akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define mset(x, y) memset(x, y, sizeof x)
#define mcpy(x, y) memcpy(x, y, sizeof x)
using namespace std;

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

inline LL Read()
{
	LL x = 0, f = 1, c = getchar();
	for (; !isdigit(c); c = getchar())
		if (c == '-')
			f = -1;
	for (;  isdigit(c); c = getchar())
		x = x * 10 + c - '0';
	return x * f;
}

const int MAXN = 1005;
const int mod = 1e9 + 7;

int n, m, a, b, c, typ;
char s[MAXN][MAXN];

inline int Qow(int x, LL y)
{
	int r = 1;
	for (; y; y >>= 1, x = 1LL * x * x % mod)
		if (y & 1)
			r = 1LL * r * x % mod;
	return r;
}

struct Matrix
{
	int a[2][2];

	Matrix() { mset(a, 0); }

	inline void Init()
	{
		a[0][0] = a[1][1] = 1;
	}

	Matrix operator * (const Matrix &b) const
	{
		Matrix c;
		for (int k = 0; k < 2; k ++)
			for (int i = 0; i < 2; i ++)
				for (int j = 0; j < 2; j ++)
					c.a[i][j] = (1LL * a[i][k] * b.a[k][j] + c.a[i][j]) % mod;
		return c;
	}
} mat, ret;

int main()
{
#ifdef wxh010910
	freopen("data.in", "r", stdin);
#endif
	n = Read(), m = Read();
	LL k = Read();
	if (!k)
		return puts("1"), 0;
	for (int i = 1; i <= n; i ++)
		scanf("%s", s[i] + 1);
	for (int i = 1; i <= n; i ++)
		for (int j = 1; j <= m; j ++)
			a += s[i][j] == '#';
	for (int i = 1; i <= n; i ++)
		if (s[i][1] == '#' && s[i][m] == '#')
			c ++, typ |= 1;
	for (int i = 1; i <= m; i ++)
		if (s[1][i] == '#' && s[n][i] == '#')
			c ++, typ |= 2;
	if (!typ)
		return printf("%d\n", Qow(a, k - 1)), 0;
	if (typ == 3)
		return puts("1"), 0;
	if (typ == 1)
		for (int i = 1; i <= n; i ++)
			for (int j = 1; j < m; j ++)
				b += s[i][j] == '#' && s[i][j + 1] == '#';
	else
		for (int i = 1; i < n; i ++)
			for (int j = 1; j <= m; j ++)
				b += s[i][j] == '#' && s[i + 1][j] == '#';
	mat.a[0][0] = a; mat.a[0][1] = mod - b; mat.a[1][1] = c; ret.Init();
	for (k --; k; k >>= 1, mat = mat * mat)
		if (k & 1)
			ret = ret * mat;
	return printf("%d\n", (ret.a[0][0] + ret.a[0][1]) % mod), 0;
}


Measured memory_bytes: 1280
// from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut 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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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")
    };
}

#[allow(unused_macros)]
macro_rules! debug { ($x: expr) => { println!("[line({})] {}: {:?}", line!(), stringify!($x), $x) };}
// macro_rules! debug { ($x: expr) => () }

#[allow(dead_code)]
fn show<T>(iter: T) -> String
where
    T: Iterator,
    T::Item: std::fmt::Display
{
    let mut res = iter.fold(String::new(), |sum, e| sum + &format!("{} ", e));
    res.pop();
    res
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::collections::btree_map::Entry::{Occupied, Vacant};
#[allow(unused_imports)]
use std::mem::swap;

fn main() {
    use std::io::Write;
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    #[allow(unused_macros)]
    macro_rules! printf { ($($arg:tt)*) => (write!(out, $($arg)*).unwrap()); }
    #[allow(unused_macros)]
    macro_rules! printfln { () => (writeln!(out).unwrap()); ($($arg:tt)*) => (writeln!(out, $($arg)*).unwrap()); }
    
    input! {
        n: usize,
        a: [i64; n],
    }

    let mut ans: usize = 0;
    let mut map = HashMap::new();
    map.insert(0, 1);
    let mut sum = 0;
    for &e in &a {
        sum += e;
        let r = map.entry(sum).or_insert(0);
        ans += *r;
        *r += 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 20632
#include<bits/stdc++.h>
#define maxn 1e9+5
#define ll long long int
using namespace std;
int main(){
ll n;
cin>>n;
vector<ll>h(n),dp(n+1,maxn);
for(int i=0;i<n;i++) cin>>h[i];
dp[0]=0;
for(int i=1;i<=n;i++){
    for(auto j:{i-1,i-2}){

        if(j>=0){

            dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));   //here we take the minimum of the two moves from the past and adding the their diffrence from current position.
        }
    }

}
cout<<dp[n-1]<<"\n";







return 0;}

Measured memory_bytes: 1792
def ck(a,b,c,len)
    f = false
    if len.include?(a) &&
       len.include?(b) &&
       len.include?(c) then f = true end
end
#-----------入力-------------------------
ary = Array.new(3).map{Array.new(3,0)}
3.times{ |i|
    a,b,c = gets.split.map(&:to_i)
    ary[i][0] = a
    ary[i][1] = b
    ary[i][2] = c
}
n   = gets.to_i     #入力数
num = Array.new
n.times { num << gets.chomp.to_i}
#------------------------------------
#横3列
#縦3列
#左上から右下
#右上から左下
#------------------------------------
bingo = false 

3.times{ |i|
    if ck(ary[i][0],ary[i][1],ary[i][2],num ) == true then bingo = true end
}
3.times{ |i|
    if ck(ary[0][i],ary[1][i],ary[2][i],num ) == true then bingo = true end
}
    if ck(ary[0][0],ary[1][1],ary[2][2],num ) == true then bingo = true end
    if ck(ary[0][2],ary[1][1],ary[2][0],num ) == true then bingo = true end

    if bingo == true then
         puts("Yes")
    else 
        puts("No")
    end


Measured memory_bytes: 1788
Var  n,i,x:longint;
       a:array[0..1000000000] of boolean;
Begin{main}
  read(n);
  for i:=1 to n do
    begin
      read(x);
      if a[x] then begin write('NO');exit;end;
      a[x]:=true;
    end; 
    write('YES');
End.

Measured memory_bytes: 975104
#include<bits/stdc++.h>
using namespace std;
long long a[9999],n;
int main()
{
	cin>>n;
	a[0]=2;a[1]=1;
	for(int i=2;i<=n;i++)
	a[i]=a[i-1]+a[i-2];
	cout<<a[n]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back

using namespace std;
int main() {
    IOS;
    int n;
    cin>>n;
    vector<int> v;
    for(int y=0;y<n;y++)
    {
        int j;cin>>j;
        v.pb(j);
    }
    int dp[n];
    dp[0]=0;
    dp[1]=abs(v[1]-v[0]);
    for(int y=2;y<n;y++)
    {
        dp[y]=min(dp[y-1]+abs(v[y-1]-v[y]),dp[y-2]+abs(v[y-2]-v[y]));
    }
    cout<<dp[n-1]<<"\n";

    return 0;
}


Measured memory_bytes: 1144
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7

N, A = MI()
X = LMI()

# dp[i][j][s] := i番目までのカードからj枚を選んで合計がsになる組み合わせの数
dp = [[[0] * 2502 for _ in range(N + 2)] for _ in range(N + 1)]
for i in range(N):
    dp[i][0][0] = 1
dp[0][1][X[0]] = 1
for i in range(1, N):
    for j in range(1, i + 2):
        for s in range(A * N + 1):
            if s - X[i] < 0:
                dp[i][j][s] = dp[i - 1][j][s]
            else:
                dp[i][j][s] = dp[i - 1][j][s] + dp[i - 1][j - 1][s - X[i]]

ans = 0
for i in range(1, N + 1):
    ans += dp[N - 1][i][A * i]
print(ans)


Measured memory_bytes: 93148
import math

def hersCode(N):
  ng = -1
  ok = N
  while ok -  ng > 1:
    mid = (ok + ng) // 2
    if judge(mid):
      ok = mid
    else:
      ng = mid
  return ok

def judge(x):
  cnt = 0
  for i in h:
    cnt += max(0, math.ceil((i - x * B) / (A - B)))
  return cnt <= x


N, A, B = list(map(int, input().split()))
h = [int(input()) for _ in range(N)]

print(hersCode(10 ** 9))





Measured memory_bytes: 7088
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pc __builtin_popcountll

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    int k;
    cin >> k;
    int ans = -1;
    ll val = 0;
    for(int i = 1; i <= k; ++i){
        val *= 10;
        val += 7;
        val %= k;
        if(val == 0){
            ans = i;
            break;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3560
<?php
  list($n, $m) = explode(" ", trim(fgets(STDIN)));

  $tree = [];
  $bk = [];
  for($i=0; $i<$m; $i++){
    list($a, $b) = explode(" ", trim(fgets(STDIN)));
    $bk[] = [$a, $b];
    if(!isset($tree[$a])) $tree[$a] = [];
    if(!isset($tree[$b])) $tree[$b] = [];
    $tree[$a][$b] = true;
    $tree[$b][$a] = true;
  }

  $count = 0;
  for($i=0; $i<$m; $i++){
    $tree[$bk[$i][0]][$bk[$i][1]] = false;
    $tree[$bk[$i][1]][$bk[$i][0]] = false;
    $q = new SplQueue();
    $q->enqueue($bk[$i][0]);
    $done = [];
    $flg = false;
    while($q->count() > 0){
      $n = $q->dequeue();
//      echo "n:".$n.PHP_EOL;
      $done[$n] = true;
      $nn = $tree[$n];
      foreach($nn as $k => $v){
        if(!$tree[$k][$n]){
          continue;
        }
//        echo $k.":k".PHP_EOL;
        if($k == $bk[$i][1]){
//          echo $bk[$i][1].PHP_EOL;
          $flg = true;
          break;
        }
        if(isset($done[$k])) continue;
//        echo "enqueue:".$k.PHP_EOL;
        $q->enqueue($k);
      }
      if($flg) break;
    }
    if(!$flg) $count++;
    $tree[$bk[$i][0]][$bk[$i][1]] = true;
    $tree[$bk[$i][1]][$bk[$i][0]] = true;
  }

  echo $count;

  



Measured memory_bytes: 16200
import sys
import math
def input(): return sys.stdin.readline().strip()

mi = lambda: map(int, input().split())

N, K = mi()

ans = 0
for i in range(1,N+1):
  if i >= K:
    ans += 1
  else:
    ans += pow(1/2, math.ceil(math.log2(K/i)))

print(ans/N)

Measured memory_bytes: 3060
#include <stdio.h>

int	main(void)
{
	int n, x, t;
	int cnt;

	scanf("%d%d%d", &n, &x, &t);

	cnt = n / x + 1;
	if (n % x == 0)
		cnt--;
	printf("%d\n", cnt * t);

	return (0);
}


Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vc vector
#define a first
#define b second
#define pb push_back
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (100000)

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

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;
}

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

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

void Main(){
  int N; cin >> N;
  vc<int> A(N);
  rep(i, 0, N) cin >> A[i];
  string res = "APPROVED";
  rep(i, 0, N){
    if(A[i] % 2 == 0){
      if((A[i] % 3 != 0) && (A[i] % 5 != 0)){
        res = "DENIED";
      }
    }
  }
  cout << res << endl;
}

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

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

  Main();

  return 0;
}


Measured memory_bytes: 256
/**
 *    author:  FromDihPout
 *    created: 2020-08-13
**/

#include <bits/stdc++.h>
using namespace std;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    
    vector<vector<int>> cnt(10, vector<int> (10));
    for (int i = 1; i <= n; i++) {
        int first = i, last = i % 10;
        if (last == 0) continue;
        while (first >= 10) {
            first /= 10;
        }
        cnt[first][last]++;
    }
    
    int ans = 0;
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= 9; j++) {
            ans += cnt[i][j] * cnt[j][i];
        }
    }
    cout << ans << '\n';
    
    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
using ll = long long;
template <class T> using vec = vector<T>;
using vi   = vector<int>;
using vvi  = vector<vi>;
using vvvi = vector<vvi>;
using pii  = pair<int, int>;


// Constants
#define INF 1e9

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval<newval) { minval=newval; return 1; } return 0; }

// Utilities
// Moving in a grid world (NESW)
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin


// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

bool check(const vi &A, const vi &B, int C)
{
  int h = 0;
  rep(i,A.size()){
    h += A[i]*B[i];
  }
  //dump(h);
  return h+C>0;
}

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin

  int N=in();
  int M=in();
  int C=in();

  vi A(M);
  vi B(M);

  rep(i,M){
    B[i] = in();
  }

  int r=0;
  rep(j,N){
    rep(i,M){
      A[i] = in();
    }
    if(check(A,B,C)) r++;
  }

  cout << r << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner

fun main() {
	val scn = Scanner(System.`in`)
	val n = scn.nextInt()
	val m = scn.nextInt()
	val k = scn.nextInt()
	val frac = Array(n){ModInt.ONE}
	for (i in 2 until n){frac[i] = frac[i-1]*i}
	var sum = ModInt(0)
	for (g in n-k..n){
		sum += ModInt.pow(m-1, g-1)*m*frac[n-1]/(frac[g-1]*frac[n-g])
	}
	println(sum)
}

class ModInt {
	var v: Long
		private set
	constructor(v: Int){
		this.v = when {
			v>=0 -> v.toLong() % MOD
			v==Int.MIN_VALUE -> 852516373
			else -> MOD.toLong() - (-v%MOD)
		}
	}
	constructor(v: Long){
		this.v = when {
			v>=0 -> v % MOD
			v==Long.MIN_VALUE -> 708828003
			else -> MOD - (-v%MOD)
		}
	}

	override fun toString() = v.toString()
	fun toInt() = v.toInt()
	fun toLong() = v
	override fun equals(other: Any?): Boolean {
		return if (other is ModInt) v == other.v else false
	}
	override fun hashCode() = 31*17 + v.hashCode()

	operator fun unaryPlus() = this
	operator fun unaryMinus() = ModInt(MOD-this.v)

	private operator fun plus(o: Long) = ModInt(this.v + o)
	operator fun plus(o: ModInt) = this.plus(o.v)
	operator fun plus(o: Int) = this.plus(o.toLong())
	private operator fun minus(o: Long) = this.plus(-o)
	operator fun minus(o: ModInt) = this.minus(o.v)
	operator fun minus(o: Int) = this.minus(o.toLong())
	private operator fun times(o: Long) = ModInt(this.v*o)
	operator fun times(o: ModInt) = this.times(o.v)
	operator fun times(o: Int) = this.times(o.toLong())
	private operator fun div(o: Long) = this.times(pow(o, MOD-2))
	operator fun div(o: ModInt) = this.div(o.v)
	operator fun div(o: Int) = this.div(o.toLong())

	operator fun inc() = this.plus(1)
	operator fun dec() = this.minus(1)

	companion object{
		const val MOD = 998244353
		val ONE = ModInt(1)

		private fun pow(b:Long, e: Int): ModInt{
			if (b==1L) return ModInt(1)
			var ans = 1L
			var b = b; var e = e
			while (e!=0){
				if (e%2==1) ans = (ans*b)%MOD
				b = (b*b)%MOD
				e /= 2
			}
			return ModInt(ans)
		}
		fun pow(b: Int, e: Int): ModInt = pow(b.toLong(), e)
		fun pow(b: ModInt, e: Int): ModInt = pow(b.v, e)
	}
}

Measured memory_bytes: 58676
n = int(input())
a = list(map(int,input().split()))
b = [1 if a[i] == i+1 else 0 for i in range(n)]
ans = 0
for i in range(n-1):
    if b[i] and b[i+1]:
        b[i] = 0
        b[i+1] = 0
        ans += 1
print(ans+sum(b))

Measured memory_bytes: 13880
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s = read::<String>();
    let mut ans = 10000;
    for i in 0..s.len() - 2 {
        ans = std::cmp::min(ans, (753 - s[i..i + 3].parse::<i64>().unwrap()).abs());
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
/******************************************
* AUTHOR : cf/villazer *
******************************************/
#include <iostream>
#include<iomanip>
using namespace std;
#define N 100005
#define mod 1000000007
#define dd double
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i,a,b) for(int i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define debug(x) cout<<(#x)<<" is "<<(x)<<endl
#define lb(arr,n,x) lower_bound(arr,arr+n,x)-arr
#define ub(arr,n,x) upper_bound(arr,arr+n,x)-arr
#define endl "\n"
#define PI 3.14159265358979323846  /* pi */
#define sqr(x) (x)*(x)
#define all(v)  ((v).begin()),((v).end())
#define degreesToRadians(angleDegrees) (angleDegrees * PI / 180.0) // Converts degrees to radians.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / PI) // Converts radians to degrees.

typedef long long ll;
typedef long double ld;
//Calculation of (x^y)%mm
ll mod_exp(ll x,ll y,ll mm)
{
    if(y==0)
        return(1);
    else if(y%2==0)
        return(mod_exp((x*x)%mm,y/2,mm));
    else
        return((x*mod_exp((x*x)%mm,(y-1)/2,mm))%mm);
}


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

#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif

ll r;
cin>>r;
ld x = 2*PI*r;
cout<<setprecision(18)<<x<<endl;

return 0;
}

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

#include<cstdio>
#define r(i,n) for(int i=0;i<n;i++)

int main(void){
 int a,b;
 cin>>a>>b;
 int cnt=0;
 while(a<=b){
   if(a/10000==a%10 && (a%10000)/1000==(a%100)/10)cnt++;
   a++;
 }
 cout<<cnt<<endl;


return 0;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define endl "\n"
const int N=5+1e5;
using namespace std;
int w[105],n,W;
ll  v[105],memo[N][105];
ll solve(int idx,int tw)
{
    ll &ret=memo[tw][idx],x=0,y=0;
    if(ret!=-1)
        return ret;
     if(idx==n)
            return ret=0;
    if(tw+w[idx]<=W)
          x= solve(idx+1,tw+w[idx])+v[idx];
          y= solve(idx+1,tw);
    return ret=max(x,y);

}
int main()
{
    ios::sync_with_stdio(0);
    cin>>n>>W;
    for(int i=0;i<n;++i)
    cin>>w[i]>>v[i];
    memset(memo,-1,sizeof memo);
    cout<<solve(0,0);


}


Measured memory_bytes: 82304
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>

int main(){
  int H, W;
  scanf("%d", &H);
  scanf("%d", &W);
  std::map<char, int > mp;
  for (int i=0; i<H; i++){
    std::string s;
    std::cin >> s;
    for (int j=0; j<W; j++){
      mp[s[j]]++;
    }
  }
  int require4 = int(H/2)*int(W/2);
  int require2 = 0;
  int require1 = 0; 
  if (H%2==1) require2+=int(W/2);
  if (W%2==1) require2+=int(H/2);
  if (H%2==1 && W%2==1) require1++;
  int enable4count = 0;
  int enable2count = 0;
  for (auto &entry: mp){
    if (enable4count>=require4) break;
    enable4count += entry.second/4;
    mp[entry.first] = entry.second%4;
  }
  for (auto &entry: mp){
    if (enable2count>=require2) break;
    enable2count += entry.second/2;
    mp[entry.first] = entry.second%2;
  }
  if (enable4count>=require4 && enable2count>=require2){
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int mod = 1000000007;
const int inf = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


ll f(ll n){
    return (n*(n+1)/2)%mod;
}


int main(){
    ll n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> d = a;
    vector<ll> b(n, 0);
    for(int i = 0; i < n-1; i++){
        for(int j = i+1; j < n; j++){
            if(a[i] > a[j]) b[i]++;
        }
    }
    vector<ll> c(n, 0);
    sort(a.begin(), a.end());
    for(int i = 0; i < n; i++){
        c[i] = lower_bound(a.begin(), a.end(), d[i])-a.begin();
    }
    ll ans = 0;
    for(int i = 0; i < n; i++){
        ans += (b[i]*k)%mod+c[i]*f(k-1);
        ans %= mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	n,m = readline() |> split |> parseMap
	s = chomp(readline())
	g = [Int[] for i in 1:n]
	ac = zeros(Int,n)
	bc = zeros(Int,n)
	@inbounds for i in 1:m
		a,b = readline() |> split |> parseMap
		if s[a] == 'A'
			ac[b] += 1
		else
			bc[b] += 1
		end
		if s[b] == 'A'
			ac[a] += 1
		else
			bc[a] += 1
		end
		push!(g[a],b)
		push!(g[b],a)
	end
	stack = Int[]
	for i in 1:n
		if ac[i]==0||bc[i]==0
			push!(stack,i)
		end
	end
	l = Int[]
	vst = zeros(Int,n)
	while !isempty(stack)
		x = pop!(stack)
		if vst[x] == 0
	    	vst[x] = 1
		    push!(l,x)
    		@inbounds for i in 1:length(g[x])
	    		if s[x] == 'A'
		    		ac[g[x][i]] -= 1
			    else
    				bc[g[x][i]] -= 1
    			end
	    		if (ac[g[x][i]] == 0 || bc[g[x][i]] == 0)
		    		push!(stack,g[x][i])
    			end
	    	end
		end
	end
	println(length(l)==n?"No":"Yes")
end
main()

Measured memory_bytes: 172048
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
//入力
int n;
//DPテーブル
int dp[100100]; //dp[i]: 足場iでの最小コスト
int h[100100]; //足場の高さ


int main() {
  //input
  cin >> n;
  for(int i = 1; i <= n; ++i) cin >> h[i];

  //DPの初期化
  dp[1] = 0;
  dp[2] = abs(h[2]-h[1]);

  //DPループ
  for(int i = 3; i <= n; ++i){
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
  }

  cout << dp[n] << endl;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<functional>
#include<vector>
#include<set>
#include<queue>
using namespace std;
#define f(i,n) for(int i=0;i<(int)n;i++)
#define MOD 1000000009

int main(void){
	set<int> a;
	int k, s;
	int n, m;
	int x, y, z;
	int ans = 0;

	scanf("%d", &n);
	scanf("%d", &k);
	ans = 1;
	f(i, n){
		if (ans < k)ans = ans << 1;
		else ans += k;
	}

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

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

void AGC005C()
{
	string X;
	cin >> X;
	int ct = 0;
	int tct = 0;
	int N = X.size();
	for (int i = 0; i < N; ++i)
	{
		if (ct == 0 && X[i] == 'T')
			++tct;
		if (X[i] == 'S')
			++ct;
		else if (ct > 0)
			--ct;
	}
	tct += ct;
	cout << tct << endl;
}
int main()
{
	AGC005C();
	return 0;
}

Measured memory_bytes: 644
#include <stdio.h>
#include <vector>
using namespace std;

int main() {
  int N,M,X,min1,min2;
  scanf("%d %d %d",&N,&M,&X);
  vector<int> a(101,0);
  for (int i = 1; i <= M; i++) scanf("%d",&a[i]);
  min1 = 0;
  min2 = 0;
  for (int i = 1; i <= M; i++) {
    if (a[i] < X) min1++;
    else min2++;
  }
  if (min1 <= min2) printf("%d\n",min1);
  else printf("%d\n",min2);
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)


int main(){
    int w,h;
    while(cin>>w>>h&&(w||h)){
        vector<string> l(h),r(h);
        rep(i,h){
            cin>>l[i]>>r[i];
        }
        bool res = false;
        pii ls,rs,lg,rg;
        rep(i,h) rep(j,w){
            if(l[i][j]=='L')ls = pii(i,j);
            if(l[i][j]=='%')lg = pii(i,j);
            if(r[i][j]=='R')rs = pii(i,j);
            if(r[i][j]=='%')rg = pii(i,j);
        }

        bool used[50][50][50][50]={};
        queue<pair<pii,pii>> que;
        que.push(make_pair(ls,rs));
        
        while(que.size()){
            pair<pii,pii> q = que.front();
            
            int dy1[]={1,-1,0,0};
            int dx1[]={0,0,1,-1};
            int dy2[]={1,-1,0,0};
            int dx2[]={0,0,-1,1};
            int ly = q.first .first, lx = q.first .second;
            int ry = q.second.first, rx = q.second.second;
            que.pop();
            rep(i,4){
                int ddly = ly+dy1[i], ddlx = lx+dx1[i];
                int ddry = ry+dy2[i], ddrx = rx+dx2[i];
                pii left,right;
                if( ddlx>=0 && ddly>=0 && ddlx<w && ddly<h && l[ddly][ddlx]!='#') left = pii(ddly,ddlx);
                else left = pii(ly,lx);

                if( ddrx>=0 && ddry>=0 && ddrx<w && ddry<h && r[ddry][ddrx]!='#') right = pii(ddry,ddrx);
                else right = pii(ry,rx);
                if(left==lg&&right==rg)res = true;
                if(left==lg||right==rg)continue;
                if( used[left.first][left.second][right.first][right.second] )continue;
                used[left.first][left.second][right.first][right.second]=true;
                que.push(make_pair(left,right));
            }
        }
        if(res)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}

Measured memory_bytes: 10056
N = int(input())
S = input()

num_R = S.count('R')
num_G = S.count('G')
num_B = S.count('B')
S = '_' + S

count = 0
for i in range(1, N+1):
    for j in range(i, N+1):
        k = 2*j - i
        if j <= k and k <= N:
            if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
                count += 1
#                 print(i, j, k)
print(num_R*num_G*num_B - count)

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

int main()
{
    int n;
    int c[4] = {0};
    cin >> n;
    string s;
    while(n--)
    {
        cin >> s;
        switch(s[0])
        {
            case 'A':
                c[0]++;
                break;
            case 'W':
                c[1]++;
                break;
            case 'T':
                c[2]++;
                break;
            case 'R':
                c[3]++;
                break;
        }
    }
    printf("AC x %d\n", c[0]);
    printf("WA x %d\n", c[1]);
    printf("TLE x %d\n", c[2]);
    printf("RE x %d\n", c[3]);
    return 0;
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define int long long
const int INF = 1e18, MOD = 1e9 + 7;
int n, x, y;

signed main() {
    cin>>n>>x>>y;
    int ans[2222] = {};
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            ans[min(abs(i - j), min(abs(i - x) + 1 + abs(j - y), abs(i - y) + 1 + abs(j - x)))]++;
        }
    }
    for (int i = 1; i < n; i++) {
        cout<<ans[i]<<endl;
    }
}

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

int main() {
  int N ;
  cin >> N ;
  vector<int> vec(N) ;
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i) ;
  }
  sort(vec.begin(), vec.end()) ;
  int A = vec.at(0) ;
  int count = 1 ;
  for (int i =0; i <N; i++) {
    if (vec.at(i) != A)
      count ++ ;
      A = vec.at(i) ;
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
template <class T> void chmin(T& x, T y) { if (x > y) x = y; }
const int INF = 1e9;
int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    int H, N; cin >> H >> N;
    vector<int> A(N), B(N);
    for (int i = 0; i < N; i++) cin >> A[i] >> B[i];
    vector<int> dp(H + 1, INF);
    dp[0] = 0;
    for (int h = 1; h <= H; h++) {
        for (int i = 0; i < N; i++) {
            chmin(dp[h], dp[max(0, h - A[i])] + B[i]);
        }
    }
    cout << dp[H] << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define N 100010
int a[N],dp[N];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    dp[1]=a[1];
    int len=1;
    for(int i=2;i<=n;i++)
    {
        if(dp[len]>=a[i])
            dp[++len]=a[i];
        else
        {
            int p,l=1,r=len;
            while(l<r)
            {
                int m=l+r>>1;
                if(dp[m]>=a[i])
                    l=m+1;
                else
                    r=m;
            }
            dp[l]=a[i];
        }
    }
    cout<<len<<endl;
    return 0;
}


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

using ll = long long;

template<typename T>
T gcd(T a, T b)
{
	if (a < b)	return gcd(b, a);
	T r;
	while ((r = a % b))
	{
		a = b;
		b = r;
	}
	return b;
}

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}

int main(int, char**)
{
	int H, W;
	cin >> H >> W;
	cin.ignore();
	vector<vector<bool>> S(H, vector<bool>(W));
	for (int i = 0; i < H; ++i)
	{
		for (int j = 0; j < W; ++j)
		{
			char tmp;
			cin >> tmp;
			S[i][j] = (tmp == '.');
		}
		cin.ignore();
	}

	int max_cost = 0;
	for (int sy = 0; sy < H; ++sy)
	{
		for (int sx = 0; sx < W; ++sx)
		{
			if (!S[sy][sx])		continue;

			vector<int> costs(H * W, -1);
			deque<pair<int, int>> q;
			q.push_back(make_pair(sy * W + sx, 0));
			while (!q.empty())
			{
				auto p = q.front();
				q.pop_front();
				if (!S[p.first / W][p.first % W] || (costs[p.first] >= 0 && costs[p.first] <= p.second))	continue;
				costs[p.first] = p.second;
				if (p.first % W != 0)		q.push_back(make_pair(p.first - 1, p.second + 1));
				if (p.first % W != W - 1)	q.push_back(make_pair(p.first + 1, p.second + 1));
				if (p.first / W != 0)		q.push_back(make_pair(p.first - W, p.second + 1));
				if (p.first / W != H - 1)	q.push_back(make_pair(p.first + W, p.second + 1));
			}
			max_cost = max(max_cost, *max_element(costs.begin(), costs.end()));
		}
	}

	cout << max_cost << endl;

	return 0;
}


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

int main()
{
    int a,b;
    cin>>a>>b;
    if(a>=0 && a<=9 && b>=0 && b<=9)
    {
        if(a>=b)
            cout<< "10"<<endl;
        else
            cout<< "0"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define max2(x, y) (x > y ? x : y)
#define max3(x, y, z) max2(max2(x, y),z)
#define mid3(x, y, z) (x > y && y > z ? y : y > z && z > x ? z : x)
#define min2(x, y) (x > y ? y : x)
#define min3(x, y, z) min2(min2(x, y), z)
int main() {
  char c0, c1, c2;
  scanf("%c %c %c", &c0, &c1, &c2);
  
  int i0 = c0 - '0';
  int i1 = c1 - '0';
  int i2 = c2 - '0';
  
  int max = max3(
    10 * i0 + i1 + i2,
    10 * i1 + i2 + i0,
    10 * i2 + i0 + i1
  );
  
  printf("%d\n", max);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <map>
#include "string.h"
using namespace std;

int main(){
    int N;
    cin >>N;
    map<string,int> memo;
    for(int i=0;i<N;i++){
        string s;
        cin >> s;
        memo[s]+=1;
    }
    int max=0;
    for(const auto& x:memo){
        int k=x.second;
        if(max<k){
            max=k;
        }
    }
    for(const auto& x:memo){
        if(x.second==max){
            cout << x.first<<'\n';
        }
    }
    return 0;
}

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

int main(){
int a,b,c;
  cin>>a>>b;
  if(b/10==0)
     c=a*10+b;
  else if(b/10<10)
    c=a*100+b;
  else
    c=a*1000+b;
  for(int i=1;i<c;i++){
   if(c/i==i&&c%i==0){
     cout<<"Yes"<<endl;
     break;
   }
    if(c==i+1)
      cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <iomanip>

#define DEBUG 0
#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;



int main(){

    string S;
    cin >> S;

    int a = S.size();
    int z = -1;

    for(int i = 0; i < S.size(); ++i)
    {
        if(S[i] == 'A')
        {
            a = i;
            break;
        }
    }
    for(int i = S.size()-1; i >=0; --i)
    {
        if(S[i] == 'Z')
        {
            z = i;
            break;
        }
    }

    int res;
    res = z - a + 1;


    cout << res << endl;
    return 0;
}



Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
int main(){
  int n;
  cin>>n;
  vector<pair<int,int>> v(n);
  for(int i=0;i<n;++i)cin>>v[i].f>>v[i].s;
  sort(v.begin(),v.end());
  cout<<v[n-1].f+v[n-1].s<<"\n";
  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,s,n) for(int i = s; i < (int)(n); i++)

int main() {
  int n;
  cin >> n;
  vector<P>data(n);
  rep(i,0,n) cin >> data[i].second >> data[i].first;
  sort(data.begin(),data.end());
  int ans = data[0].first+data[0].second;
  cout << ans << endl;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define int long long

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

signed main()
{ // #define int long long ?????????????????§scanf???????????¨???????????????????????\?????????????????????
    int N, M, A, B; cin >> N >> M >> A >> B;

    vi D(N);

    rep(i, N) {
        cin >> D[i];
    }

    vi kouho;

    rep(i, N) {
        if (D[i] >= A) {
            kouho.PB(D[i]);
        } else {
            break;
        }
    }

    if (N - kouho.size() >= M) {
        cout << kouho.size() << endl;
        return 0;
    }

    int ans = kouho.size();

    for (int i = (int)kouho.size() - 1; i >= 0; --i) {
        if (kouho[i] <= B) {
            ans--;
        } else {
            break;
        }
    }
    
    cout << ans << endl;
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n,k;cin>>n>>k;
  if(n%k==0){
    cout<<0<<endl;
  }else{
    cout<<1<<endl;
  }

  return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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

	ll x, y;
	cin >> x >> y;

	ll ans = 1;
	while(x <= y){
		x *= 2;
		ans++;
	}
	ans--;

	cout << ans << endl;
}


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

int main() {
  int abc;
  int five_count = 0, seven_count = 0;
  int i;
  for (i = 0; i < 3; i++) {
    cin >> abc;
    if (abc == 5) {
      five_count++;
    } else {
      seven_count++;
    }
  }
  if (five_count == 2 && seven_count == 1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


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

int main(){
    int N;
    cin >> N;
    long long int A[N];
    long long int S = 1;
    for(int i = 0; i < N; i++){
        cin >> A[i];
        if(A[i] == 0){
            cout << 0 << endl;
            return 0;
        }

    }
    for(int i = 0; i < N; i++){
        if(1000000000000000000/S < A[i]){
            cout << -1 << endl;
            return 0;
        }else{
            S *= A[i];
        }
    }
    cout << S << endl;
    return 0;
}

Measured memory_bytes: 4372
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<" "<<b<<" "<<c<<endl;
    return 0;
}


Measured memory_bytes: 256
use bigint;
($n,$m)=glob<>;$M=0;
for(1..$n){
    my($x,$y,$z)=glob<>;
    $L{$_}->{0}=+$x+$y+$z;
    $L{$_}->{1}=+$x+$y-$z;
    $L{$_}->{2}=+$x-$y+$z;
    $L{$_}->{3}=+$x-$y-$z;
    $L{$_}->{4}=-$x+$y+$z;
    $L{$_}->{5}=-$x+$y-$z;
    $L{$_}->{6}=-$x-$y+$z;
    $L{$_}->{7}=-$x-$y-$z;
    $L{$_}->{x}=$x;
    $L{$_}->{y}=$y;
    $L{$_}->{z}=$z;
}
for my$i(0..7){
    $xx=0;
    $yy=0;
    $zz=0;
    $c=0;
    for my$j(sort{ $L{$b}->{$i}<=>$L{$a}->{$i} }keys %L ){
        last if($c==$m);
        $c++;
        $xx+=$L{$j}->{x};
        $yy+=$L{$j}->{y};
        $zz+=$L{$j}->{z};
        
    }
    $t=abs($xx)+abs($yy)+abs($zz);
    $M=($M>$t)?$M:$t;
}
print $M

Measured memory_bytes: 6144
N = int(input())
a = list(map(int, input().split()))

S = [0] * (N+1)
for i in range(N):
    S[i+1] = S[i] + a[i]

dp = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N):
    dp[i][i] = a[i]
for d in range(1, N):
    for i in range(N-d):
        dp[i][i+d] = max(a[i] + S[i+d+1] - S[i+1] - dp[i+1][i+d], a[i+d] + S[i+d] - S[i] - dp[i][i+d-1])
print(dp[0][N-1] * 2 - S[-1])


Measured memory_bytes: 120348
"""
 // Author : snape_here - Susanta Mukherjee

"""
from __future__ import division, print_function
import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()

    
#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
from math import ceil,floor,log,sqrt,factorial,pow,pi
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *,threading


# For getting input from input.txt file 
#sys.stdin = open('input.txt', 'r')  
  
# Printing the Output to output.txt file 
#sys.stdout = open('output.txt', 'w') 

def ii(): return int(input())
def fi(): return float(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())

def main():
    
    k,x=mi()
    a=x-k+1 
    b=x+k-1 
    l=[]
    for i in range(a,b+1):
        l.append(i)
    print(*l)
        
# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        if self.buffer.tell():
            return self.buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")

# endregion

if __name__ == "__main__":
    main()

Measured memory_bytes: 30316
#include <bits/stdc++.h>
using namespace std;
int main()
{ int N,m,sum=0,a,b;
  cin>>N;
  cin>>m;
  int arr[m];
  for(int i=0;i<m;i++)
  {
      cin>>arr[i];
      sum=sum+arr[i];
  }
  b=sum;
  if(N>b)
  {
    a=N-b;
    cout<<a;
  }
  else if(N<b)
  {
    cout<<-1;

  }else
  {
    cout<<0;
  }
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> vec(N);
	for (int i = 0; i < N; i++)
		cin >> vec.at(i);

	int n = 1, sum = 0;
	while(true) {
		sum++;
		int tmp = vec.at(n-1);
		vec.at(n-1) = 0;
		n = tmp;
		if (n == 2) {
			cout << sum << endl;
			break;
		}
		if (n == 0) {
			cout << -1 << endl;
			break;
		}
	}
	return 0;
}

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

using namespace std;

int main(void){
    
    int a, b, c;
    cin >> a >> b >> c;
    
    int ans = 0;
    for(int i = a;i <= b;i++){
        if(c % i == 0) ans++;
    }
    
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 3120
using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var H = input[0];
            var W = input[1];
            var grid = new int[H, W];
            var black = new bool[H, W];
            var que = new Queue<int[]>();
            for (int i = 0; i < H; i++)
            {
                var line = Read();
                for (int j = 0; j < W; j++)
                {
                    if (line[j] == '#')
                    {
                        grid[i, j] = 0;
                        black[i, j] = true;
                        que.Enqueue(new int[] { i, j, 0 });
                    }
                }
            }
            var X = new int[] { 1, 0, -1, 0 };
            var Y = new int[] { 0, 1, 0, -1 };
            var ans = 0;
            while (que.Any())
            {
                var chk = que.Dequeue();
                var y = chk[0];
                var x = chk[1];
                var time = chk[2] + 1;
                for (int i = 0; i < 4; i++)
                {
                    var nextY = y + Y[i];
                    var nextX = x + X[i];
                    if (nextX < 0 || nextX >= W || nextY < 0 || nextY >= H) continue;
                    else if (black[nextY, nextX]) continue;
                    else
                    {
                        grid[nextY, nextX] = time;
                        black[nextY, nextX] = true;
                        que.Enqueue(new int[] { nextY, nextX, time });
                        if (time > ans) ans = time;
                    }
                }
            }

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 75808
#include<bits/stdc++.h>
#define INFTY 1<<20
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const int MOD=1000000007;
int main() {

    int n;cin>>n;
    int a[n];rep(i,n)cin>>a[i];
    int r=0,sum=0;
    ll ans=0;
    for(int l=0;l<n;l++){
        while(r<n && (sum^a[r])==(sum+a[r])){
            //cout<<r<<sum<<endl;
            sum+=a[r];
            r++;
        }
        //cout<<l<<r<<endl;
        ans += r-l;
        if(l==r)r++;
        sum -= a[l];
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024