akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair 
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) <<"\n"
#define PI 3.1415926535
using namespace std;
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
const ll mod = 1e9+7;
const ll MAX = 1e5+10;
const ll inf = 1e18+7;
ll parents[MAX];
void makes(ll u){
	parents[u] = u;
}
ll finds(ll v){
	if(parents[v]==v) return v;
	return parents[v] = finds(parents[v]);
}
void uni(ll a,ll b){
	a = finds(a);
	b = finds(b);
	if(a!=b){
		parents[b]=a;
	}
}


int main(){
	fastio;
	ll n,m;
	cin>>n>>m;
	f(i,1,n+1){
		makes(i);
	}
	f(i,0,m){
		ll a,b;
		cin>>a>>b;
		uni(a,b);
	}
	ll comp=0;
	f(i,1,n+1){
		if(finds(i)==i) comp++;
	}
	cout<<comp-1<<"\n";
	return 0; 
}

Measured memory_bytes: 4424
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

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

typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define intv(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, _begin, _end) for (__typeof(_end) end = _end, begin = _begin,  i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0, _len = (end); i < (_len); i += 1)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define readint ({int t;cin >> t;t;})
const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
void _mod(ll &x){x = mod(x, MOD);}
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}


#define int ll
    int N, A[500], S[555];
    ll memo[444][444];

int dp(int l, int r){
    if(~memo[l][r])return memo[l][r];
    int mi = 1e18;
    if(r == l+1)return 0;
    rep(i,1,r-l)mi = min(mi,dp(l,l+i) + dp(l+i, r)+S[r] - S[l]);
    return memo[l][r] = mi;
}

class NSlimes {
public:
void solve(std::istream& cin, std::ostream& cout) {
    cin >> N;
    Fill(memo, -1);
    _for(i,N)cin >> A[i];
    _for(i,N)S[i+1]  = A[i] + S[i];
    cout << dp(0,N) << endl;

}


};


#undef int
int main() {
	NSlimes solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	in.tie(0); ios::sync_with_stdio(0); out<<fixed<<setprecision(20);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  int a[4];
  for(int i=0;i<4;i++){
    a[i]=n%10;
    n/=10;
  }
  if((a[0]==a[1]&&a[1]==a[2])||(a[1]==a[2]&&a[2]==a[3]))cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

int pow_two(int n){
  int p = 0;
  while(true){
    if(n % 2 != 0) break;
    p++;
    n /= 2;
  }
  return p;
}

int main(){
  int N;
  cin >> N;
  int a[N];
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  int ans = 0;
  for(int i = 0; i < N; i++){
    ans += pow_two(a[i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
fn get_input() -> String {
    let mut word = String::new();
    std::io::stdin().read_line(&mut word).unwrap();
    word.trim().to_owned()
}

fn main() {
    let n:usize = {
      let line = get_input();
      let mut split = line.split_whitespace();
      split.next().unwrap().parse().unwrap()
    };

    let mut a: Vec<i32> = Vec::new();


    let line = get_input();
    let mut split = line.split_whitespace();
    for _i in 0..n {
      a.push(split.next().unwrap().parse().unwrap());

    }

    let mut ans = 0;
    let mut cnt = 0;
    loop {
        for i in 0..n {
            if a[i] % 2 == 0 {
                a[i] = a[i] / 2;
                cnt = cnt + 1;
            }
        }
        if cnt != n {
            break;
        }
        cnt = 0;
        ans = ans + 1;
    }

    println!("{}", ans);
}

Measured memory_bytes: 4352
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();
        int min=1000001;
        int max=-1000001;
        long sum = 0;
        for(int i = 0;i<n;i++){
            int t = sc.nextInt();
            if(t<=min)min=t;
            if(t>=max)max=t;
            sum += t;
        }
        System.out.println(min+" "+max+" "+(long)sum);
        sc.close();
    }
}



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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll N = 1e6 + 10;

ll ans = INF, n, a[N];

int main(){
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = -100; i <= 100; i++){
		ll sum = 0;
		for (int j = 0; j < n; j++){
			sum += (i - a[j]) * (i - a[j]);
		}
		ans = min(ans, sum);
	}
	cout << ans;


	return 0;
}


Measured memory_bytes: 256
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N = input()
    ninesum = 0
    for i in N:
        ninesum += int(i)
    if ninesum % 9 == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    solve()

Measured memory_bytes: 73404
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	ll n,m;
	cin>>n>>m;
	if(n>m) swap(n,m);
	if(n==1){
		cout<<(m>1?m-2:1)<<'\n';
		return 0;
	}
	if(n==2) return cout<<"0\n",0;
	cout<<(n-2LL)*(m-2LL)<<'\n';
}



Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
const int INF=(int)2e9;
const double EPS=(double)1e-9;
const double PI=(double)acos(-1.0);
const ll MOD=(ll)1e9+7;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define FOR(i,n) for(int i=0;i<n;i++)
#define REPP(i,l,r,c) for(int i=l;i<=r;i+=c)
#define REP(i,l,r) REPP(i,l,r,1)
#define FORD(i,n) for(int i=n-1;i>=0;i--)
#define REVV(i,l,r,c) for(int i=max(l,r),_m=min(l,r);i>=_m;i-=c)
#define REV(i,l,r) REVV(i,l,r,1)
#define MAX 200005
#define wa cout<<"wa"<<endl;
int irand(int lo, int hi){
	return (((double)rand())/(RAND_MAX+1.0)) * (hi-lo+1) + lo;
}

string toString(ll x) {
	stringstream ss;
	ss << x;
	return ss.str();
}

ll toNumber(string S) {
	ll ret;
	sscanf(S.c_str(),"%lld",&ret);
	return ret;
}

void base(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

int n,m;
vector<int> g[MAX];
bool vis[MAX];

int main(){
	cin>>n>>m;
	int a,b;
	bool flag = false;
	for(int i=0;i<m;i++){
		cin>>a>>b;
		g[a].pb(b);
		g[b].pb(a);
	}
	queue<ii> q;
	q.push(ii(1,2));
	while(!q.empty()){
		ii u = q.front();
		q.pop();
		int now = u.fi;
		int service = u.se;
		if (now==n){
			flag = true;
			break;
		}
		
		for(int i=0;i<g[now].size();i++){
			int to = g[now][i];
			if (vis[to]) continue;
			if (service==0) continue;
			q.push(ii(to,service-1));
			vis[to] = true;
		}
	}
	if (flag) cout<<"POSSIBLE"<<endl;
	else cout<<"IMPOSSIBLE"<<endl;
	return 0;
}



Measured memory_bytes: 13040
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End

/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cins(S);
    cout << char(S[0] + 1) << nn;
    return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  int n,m,i;
  cin >> n >> m;
  int p;
  int ss[n] = {};
  int pp[n] = {};
  int ppp = 0;
  int sss = 0;
  string s;
  for(i = 0; i < m; i++){
    cin >> p >> s;
    if(ss[p - 1] == 0){
      if(s == "AC"){
        ss[p - 1] = 1;
        sss += 1;
        ppp += pp[p - 1];
      }else{
        pp[p - 1] += 1;
      }
    }
  }
  cout << sss << " " << ppp;
  }


Measured memory_bytes: 1024
/*######################################################
#########~~~~~####~~~~###~~##~~##~~##~~##~~##~~#########
#########~~##~~##~~##~~##~~~#~~##~~~#~~##~~##~~#########
#~~~~~~##~~~~~###~~~~~~##~~#~~~##~~#~~~##~~##~~##~~~~~~#
#########~~######~~##~~##~~##~~##~~##~~##~~##~~#########
#########~~######~~##~~##~~##~~##~~##~~###~~~~##########
######################################################*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("O3")
#define rtn return
#define endl '\n'
#define F first
#define S second
#define mt make_tuple
#define pb push_back
#define int long long
#define sz(x) (int) x.size()
#define value_at find_by_order
#define index_of order_of_key
#define fill(a, v) memset(a,v,sizeof(a))
#define copy(a, b) memcpy(b,a,sizeof(a))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i, n) for(int i=0;i<(int)n;++i)
#define per(i, n) for(int i=(int)n-1;i>=0;--i)
#define rep1(i, n) for(int i=1;i<=(int)n;++i)
#define per1(i, n) for(int i=(int)n;i>=1;--i)
#define loop(i, begin, end) for(int i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " = " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " = " << arg1 << " |";
  __f(comma + 1, args...);
}
#else
#define trace(...)
#endif

typedef string str;
typedef long double db;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<str> vstr;
typedef vector<db> vdb;

template<class T, class V> void remin(T &a, V b) { a > b ? a = b : a = a; }
template<class T, class V> void remax(T &a, V b) { a < b ? a = b : a = a; }
template<class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const db EPS = 1e-15;
const int MOD = 1e9 + 7;
const int N = 1e6 + 7;

int n, m;

int32_t main() {
  FAST_IO;
  cin >> n >> m;
  int sm = 0;
  rep(i, m) {
    int x;
    cin >> x;
    sm += x;
  }
  if (sm > n) {
    cout << -1 << '\n';
  } else {
    cout << n - sm << '\n';
  }
  rtn 0;
}


Measured memory_bytes: 3632
N,K,*H = $<.read.split.map &:to_i
A = Array.new(N+K,0)
H.fill H[0],N,K

A.map!.with_index {|_,i|
  h = H[i]
  m = 1<<60
  1.upto(K) { |j|
    c = A[i-j] + d=(h-H[i-j]).abs
    m = c  if m > c
    break  if d == 0
  }
  m
}
p A[N-1]

Measured memory_bytes: 12284
import numpy as np
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=np.zeros(N)
for i in A:
  B[i-1]+=1
C=sorted([i for i in B if i != 0])
ans=0
for i in range(len(C)-K):
  ans+=C[i]
print(int(ans))

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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

template<typename T>
void print1(T begin, T end) {
	while (begin != end) {
		cerr << (*begin) << " ";
		*begin++;
	}
	cerr << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
	for (int i = 0; i < height; i++) {
		for (int j = 0; j < width; j++) {
			cerr << " " << Array[i][j];
		}
		cerr << endl;
	}
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
	std::cerr << head << " ";
	print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

// ------------------------------------------------------------------------------------------

struct P {
	int idx;
	string s;
	int val;
};

signed main() {
	int N;
	cin >> N;
	vec<P> v(N);
	rep (i, N) {
		cin >> v[i].s >> v[i].val;
		v[i].idx = i;
	}

	sort(v.begin(), v.end(), [&](P i, P j) {
		if (i.s == j.s) {
			return i.val > j.val;
		} else {
			return i.s < j.s;
		}
	});

	rep (i, N) {
		cout << v[i].idx + 1 << endl;
	}

	return 0;
}

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

#pragma optimize("O3")

int V[5+(1<<18)];
int W[5+(1<<18)];

int dp[5+(1<<10)][100005];

const int INF = 1012345678;

int S, K;

int rec(int v, int L_rem, int bonus_value){
    if(L_rem < 0){
        return -INF;
    }else if(v < (1<<K)){
        return bonus_value + dp[v][L_rem];
    }

    return max(rec(v>>1, L_rem, bonus_value), rec(v>>1, L_rem-W[v], bonus_value+V[v]));
}


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

    for(int i = 1; i <= N; i ++){
        scanf("%d%d", &V[i], &W[i]);
    }

    int Q;
    scanf("%d", &Q);
    K = log2(N*8)/2;

    //printf("1<<K=%d\n", 1<<K);

    memset(dp, 0, sizeof(dp));
    for(int i = 1; i <= (1<<K); i ++){
        for(int j = 0; j <= 100000; j ++){
            int temp = dp[i>>1][j];
            if(j >= W[i]){
                temp = max(temp, V[i]+dp[i>>1][j-W[i]]);
            }
            dp[i][j] = temp;
        }
    }

    while(Q --){
        int v, L;
        scanf("%d%d", &v, &L);
        printf("%d\n", rec(v, L, 0));
    }

    return 0;
}


Measured memory_bytes: 407944
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
#include <map>
#include <set>
#include <iomanip>
#include <math.h>
#include <stdlib.h>
using namespace std;
int a[300004];
int main(){
  int n,ans=300000;
  string s;
  cin>>n>>s;
  for (int i=0;i<n;i++){
  	if (s[i]=='E') a[i]=2;
  	if (s[i]=='W') a[i]=1;
  	if (i>0) a[i]+=a[i-1];
  }
  for (int i=0;i<n;i++){
    int lef=i*2,tlef,trig;
    int rig=(n-i-1)*1;
    if (a[i]>0) tlef=a[i-1];
    else tlef=0;
    trig=a[n-1]-a[i];
    ans=min(ans,abs(lef-tlef)+abs(rig-trig));
  }
  cout<<ans;
  return 0;
}

Measured memory_bytes: 1796
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i < (int)(n); i++)
using ull = unsigned long long;
using ll = long long;
using pii = pair<int, int>;

ull Len[60] = {};

ull all_eat(ull L) {
    ull num_p;
    if (L == 0) num_p = 1ULL;
    else num_p = 2*all_eat(L-1) + 1;
    return num_p;
}

ull eat_p(ull X, ull L) {
    ull num_p;
    if (L==0){
       if (X==0) num_p = 0ULL;
       else num_p = 1ULL; 
    } else {
        if (X<=1) {
            num_p = 0ULL;
        } else if (X<=Len[L-1]+1) {
            num_p = eat_p(X-1, L-1);
        } else if (X==Len[L-1]+2) {
            num_p = all_eat(L-1) + 1;
        } else {
            num_p = all_eat(L-1) + 1;
            num_p += eat_p(X-(Len[L-1]+2), L-1);
        }
    }
    return num_p;
}

int main() {
    ull N, X;
    cin >> N >> X;

    Len[0] = 1;
    for (int i=1; i<=(N+2); i++) Len[i] = 2*Len[i-1] + 3;

    cout << eat_p(X, N) << endl;

    return 0;
}

 

Measured memory_bytes: 256
n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

d = Array.new(n,0)
n.times{|i| d[i] = a[i] - b[i]}
d.sort!

i = 0
j = n - 1
c = 0

while d[i] < 0
    if d[i] + c >= 0
        c += d[i]
        i += 1
    elsif d[j] < 0
        puts -1
        exit
    else
        c += d[j]
        j -= 1
    end
end

puts i + n - j - 1

Measured memory_bytes: 16776
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define MAX 10000
#define vmax 10000
#define sentinel 2000000000
constexpr long long int inf = 1000000000000;
constexpr long long int rinf = -(INT64_MAX);
//cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);

struct node{
    int key;
    node *parent,*left,*right;
};

node *root,*NIL;

void insert(int k){
    node *y=NIL;
    node *x=root;
    node *z;

    z=(node*)malloc(sizeof(node));
    z->key=k;
    z->left=NIL;
    z->right=NIL;

    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 preorder(node *u){
    if(u==NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

void inorder(node *u){
    if(u==NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}

int main() {
    int n,x;
    string s;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        cin>>s;
        if(s=="insert"){
            scanf("%d",&x);
            insert(x);
        }else if(s=="print"){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}






Measured memory_bytes: 26712
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define cst first
#define dur second
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 1e7 + 5, M = 2 * N + 5;

vector<int> res;
void KMP(const string &s, const string &k){
    res.clear();
    if (k.empty())
        return ;
    vector<int> tmp(k.size(), 0);
    for (int i = 1, j = 0; i < k.size(); ++i){
        while (j && k[j] != k[i])
            j = tmp[j - 1];
        if (k[j] == k[i])
            ++j;
        tmp[i] = j;
    }
    for (int i = 0, j = 0; i < s.size(); ++i){
        while (j && k[j] != s[i])
            j = tmp[j - 1];
        if (k[j] == s[i])
            ++j;
        if (j == k.size())
            res.push_back(i - j + 1);
    }
}

int n, m;

string a, b;

int f(){
    n = res.size();
    int mx = 0;
    int len = a.size();
    vector<int> sum(len, 0);
    for(auto i : res){
        if(i - m >= 0)
            sum[i] = sum[i - m] + 1;
        else sum[i] = 1;
        mx = max(mx, sum[i]);        
    }
    return mx;
}


int main(){
    IO;
    cin >> a >> b;
    m = b.size();
    while(a.size() <= m)
        a += a;
    a += a;
    a += a;
    KMP(a, b);
    int hna = f();
    a += a;
    a += a;
    KMP(a, b);
    if(f() > hna)return cout << -1 << endl, 0;
    if(n == 0)return cout << n << endl, 0;
    cout << hna << endl;
}

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

#define int long long

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

int N, a[100];

signed main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    sort(a, a + N, greater<int>());
    int A = 0, B = 0;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            A += a[i];
        } else {
            B += a[i];
        }
    }
    cout << A - B << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define pll pair <ll, ll>
#define mp make_pair
#define pyshnapyshnakaa ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define x first
#define y second
#pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
#define plll pair <pair <ll, ll>, ll>
#define pllll pair <pair <ll, ll>, pair <ll, ll> >
#define psl pair <string, ll>
#define pld pair <ld, ld>
#define all(a) a.begin(), a.end()
#define vvl vector <vector <ll> >
#define cld complex <double>

typedef long long ll;

typedef long double ld;

using namespace std;

const ll maxn = 1e6 + 100;
const ll inf = 1e9;

ll n, m, k, t;

ll x, y;

int main() {
    pyshnapyshnakaa
    ll q, w, e, a, b, c;
    cin >> n >> m >> k;
    string s1, s2;
    cin >> x >> y;
    x--; y--;
    cin >> s1 >> s2;
    ll mn = m, mx = -1;
    for (q = s1.size() - 1; q >= 0; q--) {
        ll d1 = 0, d2 = 0;
        if (s1[q] == 'L') {
            d1 = -1;
        }
        if (s1[q] == 'R') {
            d1 = 1;
        }
        if (s2[q] == 'L') {
            d2 = -1;
        }
        if (s2[q] == 'R') {
            d2 = 1;
        }
        if (d2 == -1) {
            mn++;
            mn = min(m, mn);
        }
        if (d2 == 1) {
            mx--;
            mx = max(-1LL, mx);
        }
        if (d1 == 1) {
            mn--;
        }
        if (d1 == -1) {
            mx++;
        }
        // cout << "D " << d1 << " " << d2 << endl;
        // cout << q << " " << mn << " " << mx << endl;
        // if (d1 == 1) {
        //     mn = min(mn, n - 1);
        // }
        // if (d1 == -1) {
        //     mx = max(mx, 0LL);
        // }
        if (mx >= mn - 1) {
            cout << "NO";
            return 0;
        }
    }
    if (mn <= y || mx >= y) {
        cout << "NO";
        return 0;
    }
    // cout << "FIRST PASSED" << endl;
    mn = n, mx = -1;
    for (q = s1.size() - 1; q >= 0; q--) {
        ll d1 = 0, d2 = 0;
        if (s1[q] == 'U') {
            d1 = -1;
        }
        if (s1[q] == 'D') {
            d1 = 1;
        }
        if (s2[q] == 'U') {
            d2 = -1;
        }
        if (s2[q] == 'D') {
            d2 = 1;
        }
        if (d2 == -1) {
            mn++;
            mn = min(mn, n);
        }
        if (d2 == 1) {
            mx--;
            mx = max(mx, -1LL);
        }
        if (d1 == 1) {
            mn--;
        }
        if (d1 == -1) {
            mx++;
        }
                // cout << q << " " << mn << " " << mx << endl;

        if (mx >= mn - 1) {
            cout << "NO";
            return 0;
        }
    }
    if (mn <= x || mx >= x) {
        cout << "NO";
        return 0;
    }
    cout << "YES";
    return 0;
}

Measured memory_bytes: 4036
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;

signed main(){
	int n, C;
	scanf("%d %d", &n, &C);
	vector<int> s(n), t(n), c(n);
	vector<vector<P> > data(C);
	for(int i = 0; i < n; i++){
		scanf("%d %d %d", &s[i], &t[i], &c[i]);
		data[c[i] - 1].push_back(P(s[i], t[i]));
	}
	
	for(int i = 0; i < C; i++){
		sort(data[i].begin(), data[i].end());
		for(int j = 1; j < data[i].size(); j++){
			if(data[i][j - 1].second == data[i][j].first) data[i][j].first++;
		}
	}

	vector<int> num(100010, 0);
	for(int i = 0; i < C; i++){
		for(int j = 0; j < data[i].size(); j++){
			num[data[i][j].first]++;
			num[data[i][j].second + 1]--;
		}
	}

	for(int i = 1; i < num.size(); i++){
		num[i] += num[i - 1];
	}

	int ans = *max_element(num.begin(), num.end());
	cout << ans << endl;
}

Measured memory_bytes: 5940
#include <bits/stdc++.h>
#define eps 1e-9
#define nmax 200
#define f(c,a,b) for(int c=a; c<=b; c++)
#define pi acos(-1)

using namespace std;
typedef double db;
struct P{
    db x, y;
    P(){}
    P(db x, db y) : x(x) , y(y) {}
    P operator - (P a){ return P(x-a.x, y-a.y); }
    db dot(P a){ return a.x*x + a.y*y; }
    P operator * (db a) { return P(a*x, a*y); }
    P operator + (P a){ return P(x+a.x, y+a.y); }
    db times(P a){ return x*a.y-y*a.x; }
    db clen() { return sqrt( x*x+y*y ); }
    db l2() { return x*x+y*y; }
    P rot90(){
        db tx = x, ty = y;
        x = -ty;
        y = tx;
        return P(x,y);   
    }
    void swap(P& a){
        db tx = x, ty = y;
        x = a.x;  y = a.y;
        a.x = tx; a.y = ty;
    }
}po[nmax];

int sign(db x) { return (x<-eps) ? -1 : x>eps; }

void isCC(P c1, db r1, P c2, db r2){
    if( (c2-c1).y>0 ) { c1.swap(c2); swap(r1,r2); } 
    db tl = (c1-c2).l2();
    db xk = ( (r1*r1-r2*r2)/tl + 1)/2;
    //cout<<"xk== "<<xk<<endl;
    db yk = r1*r1/tl-xk*xk;
    if(yk<0) yk=0;
    //cout<<yk<<endl;
    P tp = c1+(c2-c1)*xk;
    P lp = (c2-c1).rot90()*sqrt(yk);
    //cout<<"quq   "<<lp.x<<' '<<lp.y<<endl;
    printf("%.8lf %.8lf %.8lf %.8lf\n", (tp-lp).x, (tp-lp).y, (tp+lp).x, (tp+lp).y );
}

int main(){
    //freopen("owo.in","r",stdin);
    P c1, c2;
    db r1, r2;
    cin >> c1.x >> c1.y >> r1;
    cin >> c2.x >> c2.y >> r2;
    isCC(c1, r1, c2, r2);
    return 0;
}


Measured memory_bytes: 3284
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n);
	std::vector<std::vector<int>> a(n), b(n);
	for(int i = 0; i < n; i++) {
		int k; scanf("%d", &k);

		while(k--) {
			int x, y; scanf("%d%d", &x, &y);

			a[i].push_back(x - 1);
			b[i].push_back(y);
		}
	}

	int ans = 0;
	for(int i = 0; i < (1 << n); i++) {
		bool f = true;
		for(int j = 0; j < n; j++) {
			if(!(i >> j & 1)) continue;
			
			for(int k = 0; k < a[j].size(); k++) {
				if((i >> a[j][k] & 1) == b[j][k]) continue;
				f = false;
			}
		}
		if(!f) continue;

		int tmp = 0;
		for(int j = 0; j < n; j++) tmp += (i >> j & 1);
		ans = std::max(ans, tmp);
	}
	
	printf("%d\n", ans);
	return 0;
}


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

const ll LINF = 1e17;
const int INF = 1e9;

int main()
{
	int N, M, L;
	cin >> N >> M >> L;
	vector<vector<ll>> dist(N, vector<ll>(N, LINF));
	for (int i = 0; i < N; i++) dist[i][i] = 0;
	for (int i = 0; i < M; i++) {
		int A, B;
		ll C;
		cin >> A >> B >> C; --A, --B;
		dist[A][B] = dist[B][A] = min(dist[A][B], C);
	}
	for (int k = 0; k < N; k++) {
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}
	vector<vector<int>> e(N, vector<int>(N, INF));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) if (dist[i][j] <= L) {
			e[i][j] = 1;
		}
	}
	for (int i = 0; i < N; i++) e[i][i] = 0;
	for (int k = 0; k < N; k++) {
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				e[i][j] = min(e[i][j], e[i][k] + e[k][j]);
			}
		}
	}
	int Q;
	cin >> Q;
	while (Q--) {
		int s, t;
		cin >> s >> t; --s, --t;
		printf("%d\n", e[s][t] == INF ? -1 : max(0, e[s][t] - 1));
	}
	return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s, t;
    cin >> s;
    cin >> t;
    int ns = s.size();
    int nt = t.size();
    int ans = nt, k;
    for (int i = 0; i <= ns - nt; i++) {
        k = 0;
        for (int j = 0; j < nt; j++) {
            if (s[j + i] != t[j]) {
                k++;
            }
        }
        ans = min(ans, k);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3644
import string
s = input()
n = len(s)

min_cnt = float('inf')

for c in string.ascii_lowercase:
    if c not in s:
        continue
    cnt = 0
    s_ = s[:]
    while s_:
        m = len(s_) - 1
        is_same = True
        for d in s_:
            if d != c:
                is_same = False
                break
        if is_same:
            min_cnt = min(min_cnt, n - m-1)
        s_next = [''] * m
        for i in range(m):
            if s_[i] == c or s_[i + 1] == c:
                s_next[i] = c
            else:
                s_next[i] = s_[i]
        s_ = s_next

print(min_cnt)


Measured memory_bytes: 9876
#include <bits/stdc++.h>
using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
//const int mod=998244353;
using P = pair<int,int>;
using Pll = pair<ll,ll>;
using ld=long double;
using V=vector<int>;
using Vl=vector<ll>;
using VV=vector<vector<int>>;
using VVl=vector<vector<ll>>;

int main(){
    ll n,k;cin >>n>>k;
    string s;cin >>s;
    int key=1;
    V run;
    int now=0;
    for (int i = 0; i < n; ++i) {
        int tmp=(s[i]-'0');
        if(tmp==key){
            now++;
        }
        else {
            run.push_back(now);
            now=1;
            key=1-key;
        }
    }
    run.push_back(now);
    if(run.size()%2==0){
        run.push_back(0);
    }
    int m=run.size();
    Vl sum(m+1,0);
    for (int i = 0; i < m; ++i) {
        sum[i+1]=sum[i]+run[i];
    }
    ll ans=-1;
    for (int i =1; i <=m;i+=2) {
        ll res=sum[min(i+2*k,(ll)m)]-sum[i-1];
        ans=max(ans,res);
//        cout <<i<<" "<<res<<" ";
    }
//    cout <<endl;
    cout <<ans <<endl;
}



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

void solve(int TestCase) {
    long long a, b, c;
    cin >> a >> b >> c;

    long long k = max(a, b);
    long long ret = (c + k - 1) / k;
    cout << ret << endl;
}
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
    int t = 1;
    //cin >> t;
    for(auto i = 1; i <= t; ++i)
        solve(i);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[105];
int main(){
    int n,ans=1e9;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=0;i<=200;i++){
        int num=0;
        for(int j=1;j<=n;j++){
            num+=(a[j]-i)*(a[j]-i);
        }
        ans=min(ans,num);
    }
    cout<<ans<<endl;
}

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

#define LOCAL 0

#define lli long long int
#define llu unsigned long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define si(n) scanf("%d",&n)
#define slli(n) scanf("%lld",&n);
#define ss(n) scanf("%s",n);

const long double EPS = 1e-10;
const int MOD = 1000000007ll;
const int mod1 = 1000000009ll;
const int mod2 = 1100000009ll;
int INF = (int)1e9;
lli INFINF = (lli)1e18;
long double PI = acos(-1.0);

using namespace std;

int bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
int bit(lli _mask,int _i){return (_mask&(1ll<<_i))==0?0:1;}
int add(int a,int b,int m=MOD){int x=a+b;while(x>=m)x-=m;while(x<0)x+=m;return x;}
int sub(int a,int b,int m=MOD){int x=a-b;while(x<0)x+=m;while(x>=m)x-=m;return x;}
int mul(int a,int b,int m=MOD){lli x=a*1ll*b;x%=m;while(x<0)x+=m;return (int)x;}
int ldtoint(ld x){return (int)(x+0.5);}lli ldtolli(ld x){return (lli)(x+0.5);}
int powermod(lli _a,lli _b,int _m=MOD){lli _r=1;while(_b){if(_b%2==1)_r=mul(_r,_a,_m);_b>>=1;_a=mul(_a,_a,_m);}return _r;}

template<class T1,class T2>ostream&operator<<(ostream& os,const pair<T1,T2>&p){os<<"["<<p.first<<","<<p.second<<"]";return os;}
template<class T>ostream&operator<<(ostream& os,const vector<T>&v){os << "[";bool first=true;for (T it:v){if (!first)os<<", ";first = false;os<<it;}os<<"]";return os;}
template<class T>ostream&operator<<(ostream& os,set<T>&v){os<<"[";bool first=true;for (T it:v){if(!first)os<<", ";first=false;os<<it;}os<<"]";return os;}
template<class T1,class T2>ostream&operator<<(ostream& os,map<T1,T2>&v){os<<"[";bool first=true;for(pair<T1,T2> it:v){if(!first)os<<", ";first=false;os<<"("<<it.F<<","<<it.S<<")";}os<<"]";return os;}
template<class T>void debug(T a[],int s,int e){if(!LOCAL)return;cout<<"[";for(int i=s;i<e;i++)cout<<a[i]<<", ";cout<<a[e]<<"]\n";}
template<class T>void debug(T x){if(!LOCAL)return;cout<<x<<"\n";}

lli Q,H,S,D;lli N;

int main()
{
if(LOCAL){
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
}
    srand (time(NULL));
    //ios::sync_with_stdio(0);cin.tie(0);

    cin>>Q>>H>>S>>D>>N;
    lli one,two;
    one = two = INFINF;
    one = min(one, 4*Q);
    one = min(one, 2*H);
    one = min(one, S);
    two = min(two, 2*one);
    two = min(two, D);

    lli ans = ((N - (N%2))/2)*two;
    ans += (N%2)*one;
    cout<<ans;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int D = scan.nextInt();
		int[][] B = new int[N][D];
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < D; j++) {
				B[i][j] = scan.nextInt();
			}
		}
		
		int ans = 0;
		for(int i = 0; i < N; i++) {
			for(int j = i + 1; j < N; j++) {
				double sum = 0;
				for(int k = 0; k < D; k++) {
					double tmp = Math.abs((double)(B[i][k] - B[j][k]));
					sum += Math.pow(tmp, 2);
				}
				double num = Math.sqrt(sum);
				if(num - (int)num == 0) {
					ans++;
				}
			}
		}
		
		System.out.println(ans);
		scan.close();
	}

}

Measured memory_bytes: 20936
n = int(input())
t, a = map(int,input().split())
li = list(map(int,input().split()))
n_temp = li[0]
answer = 0
for idx, temp in enumerate(li):
    i_temp = t - temp * 0.006
    if (abs(a - n_temp) >= abs(a -i_temp)):
        n_temp = i_temp
        answer = idx

print(answer+1)


Measured memory_bytes: 3060
#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;

int main()
{
    char s[100], p[100];
    scanf("%s", s);
    scanf("%s", p);
  
  	char ss[200];
  	strcpy(ss, s);
  	strcat(ss, s);
  
  	if (strstr(ss, p) != NULL) {
      	cout << "Yes" << endl;
    } else {
      	cout << "No"  << endl;
    }
}


Measured memory_bytes: 3216
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;
import std.numeric;


void main() {
    int n, m;
    scan(n, m);

    auto adj = new int[][](m, 0);
    auto ex = new bool[](m);

    foreach (i ; 0 .. n) {
        auto line = readln.split.to!(int[]);
        int u = line[1] - 1;
        ex[u] = 1;

        if (line.length < 3) continue;

        foreach (v ; line[2 .. $]) {
            v--;
            ex[v] = 1;
            adj[u] ~= v;
            adj[v] ~= u;
        }
    }

    debug {
        writeln(adj);
    }

    auto visited = new bool[](m);

    void dfs(int u) {
        visited[u] = 1;

        foreach (v ; adj[u]) {
            if (!visited[v]) {
                dfs(v);
            }
        }
    }

    foreach (i ; 0 .. m) {
        if (ex[i]) {
            dfs(i);
            break;
        }
    }

    foreach (i ; 0 .. m) {
        if (ex[i] && !visited[i]) {
            writeln("NO");
            return;
        }
    }

    writeln("YES");
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    string s; cin >> s;
    int n = s.size();
    ll sum = 0;
    for(int bit = 0; bit < (1 << (n - 1)); bit++){
        ll cur = 0;
        for(int i = 0; i < n; i++){
            cur = cur * 10 + (s[i] - '0');
            if(bit & (1 << i)){
                sum += cur;
                cur = 0;
            }
        }
        sum += cur;
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const long long mod = 1e9 + 7;

ll gcd(ll a, ll b) {
	return b ? gcd(b, a % b) : a;
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

ll powMod(ll n, ll k, ll m) {
	if (k == 0) {
		return 1;
	} else if (k % 2 == 1) {
		return powMod(n, k - 1, m) * n % m;
	} else {
		ll t = powMod(n, k / 2, m);
		return t * t % m;
	}
}

int main() {
	ll x;
	cin >> x;

	ll ans=0;
	ll now=100;

	while (now < x) {
		now = now*1.01;
		ans++;
	}

	cout << ans << endl;
}


Measured memory_bytes: 3624
using System;
using CompLib.Util;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        string s = sc.Next();
        string t = sc.Next();
        int cnt = 0;
        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] != t[i]) cnt++;
        }

        Console.WriteLine(cnt);
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 27524
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <map>
#include <set>
#define ull unsigned long long
#define ll long long
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int w,h,n,x,y,a;
    cin >> w >> h >> n;
    int b[h][w];
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            b[i][j]=0;
        }
    }
    for(int i=0;i<n;i++){
        cin >> x >> y >> a;
        if(a==1){
            for(int j=0;j<h;j++){
                for(int k=0;k<w;k++){
                  if(k<x){
                      b[j][k]=1;
                  }
                }
            }
        }
        else if(a==2){
            for(int j=0;j<h;j++){
                for(int k=0;k<w;k++){
                    if(k>=x){
                        b[j][k]=1;
                    }
                }
            }
        }
        else if(a==3){
            for(int j=0;j<h;j++){
                for(int k=0;k<w;k++){
                    if(j<y){
                        b[j][k]=1;
                    }
                }
            }
        }
        else if(a==4){
            for(int j=0;j<h;j++){
                for(int k=0;k<w;k++){
                    if(j>=y){
                        b[j][k]=1;
                    }
                }
            }
        }
    }
    int ans=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++) {
            if (b[i][j] == 0) {
                ans++;
            }
        }
    }
    cout << ans << endl;


    return 0;
}

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

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

    int a, b;
    std::cin >> a >> b;

    int outlets = 1;
    int ans = 0;

    while (outlets < b) {
        outlets = outlets - 1 + a;
        ++ans;
    }

    std::cout << ans;

    return 0;
}


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

int main() {
	string S; long long K;
	cin >> S >> K;
	for (int i = 0; i < min((long long)S.size(), K); i++) {
		if (S[i] >= '2') { cout << S[i] << endl; return 0; }
	}
	cout << '1' << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  ll n;
  cin >> n;
  vl a(n);
  rep(i, n) cin >> a[i];
  rep(i, n-1) a[i+1]=gcd(a[i],a[i+1]);
  cout << a[n-1] << newl;
  return 0;
}

Measured memory_bytes: 3984
#include<stdio.h>
int main()
{
  int i,a[100],j;
  double sum,rev;
  sum=0.0;
  scanf("%d",&j);
  for(i=1;i<=j;i++){

    scanf("%d",&a[i]);

    sum=sum+1.0/(double)a[i];
  }
  rev=1.0/sum;
  printf("%f\n",rev);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
template<typename T> inline bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> inline bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline T mid(T a, T b, T c) { return a+b+c-max({a,b,c})-min({a,b,c}); }
const long long INF = 1e18;
const long long mod = 1e9+7;

vector<vector<long long>> nCr(long long n) {
    const long long MOD = 1e9 + 7;
    vector<vector<long long>> V(n + 1, vector<long long>(n + 1, 0));
    for (long long i = 0; i < V.size(); i++) { V[i][0] = 1; V[i][i] = 1; }
    for (long long i = 1; i < V.size(); i++) {
        for (long long j = 1; j < i; j++) {
            V[i][j] = V[i - 1][j] + V[i - 1][j - 1];
            if (V[i][j] > MOD) { V[i][j] %= MOD; }
        }
    }
    return V;
}

int main(){
    long long N, K;
    cin >> N >> K;
    vector<vector<long long>> C = nCr(N);
    for (long long i = 1; i <= K; i++) {
        long long ans = (C[N-K+1][i]%mod * C[K-1][i-1]%mod)%mod;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 31616