akhauriyash/Code-Regression huggingface dataset:
// header {{{
#include <bits/stdc++.h>
using namespace std;

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    string s;cin >> s;
    vector<bool> hoge(26, false);
    for(auto c : s){
        hoge[c-'a'] = true;
    }
    inc(i, 0, 26){
        if(!hoge[i]){
            cout << char(i+'a') << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;

#define sz(a) int((a).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ini(a, i) memset(a, i, sizeof(a))
#define inin(a, n, i) memset(a, i, sizeof(a[0])*(n))
#define contains(c, i) ((c).find(i) != (c).end())
#define present(i, c) (find(all(c), i) != (c).end())

#define trav(x, c) for(auto& x : c)
#define rep(i, n) for(int i = 0; i < n; i++)
#define repa(i, b, e) for(int i = (b)-((b)>(e)); i != (e)-((b)>(e)); i += 1-2*((b)>(e)))
	
template<class T> bool chkmax(T &x, T y) { return x < y ? x = y, true : false; }
template<class T> bool chkmin(T &x, T y) { return x > y ? x = y, true : false; }
template<class A, class B> A cvt(B x) { stringstream s; s << x; A r; s >> r; return r; }

void read() {}
void print() {}
template<class T, class... Args> void read(T& a, Args&... args) { cin >> a; read(args...); }
template<class T, class... Args> void print(T a, Args... args) { cout << a << ' '; print(args...); }
template<class... Args> void println(Args... args) { print(args...); cout << '\n'; }

#define debug(args...) { string s_(#args); replace(all(s_), ',', ' '); stringstream ss_(s_); istream_iterator<string> it_(ss_); cerr_(it_, args); }
void cerr_(istream_iterator<string> it) { (void) it; }
template<class T, class... Args> void cerr_(istream_iterator<string> it, T a, Args... args) { cerr << *it << " = " << a << endl; cerr_(++it, args...); }

template<class T, class S>  ostream& operator<<(ostream& os, const pair<T, S>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<class T> ostream& operator<<(ostream &os, const set<T> &s) { os << '{'; string sep; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<class T, class S> ostream& operator<<(ostream &os, const map<T, S> &m) { os << '{'; string sep; for (const auto &x : m) os << sep << x, sep = ", "; return os << '}'; }
template<class T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }

const int INF = 0x3F3F3F3F;
const int MAXN = (int) 1e6;
const int MOD = (int) 1e9+7;

//=========================

void run_test() {
	string s, t;
    read(s, t);

    int ans = INF;

    int n = sz(s), k = sz(t);
    rep(i, n - k + 1) {
        int c = 0;
        rep(j, k) if(s[i + j] != t[j]) c++;
        chkmin(ans, c);
    }

    println(ans);
}

//=========================

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//int t_ = 1, t__; cin >> t__; while(t_ <= t__) { cout << "Case #" << t_++ << ": "; run_test(); }
	// int t_; cin >> t_; while(t_--) run_test();
	run_test();
	return 0;	
}


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

int main() {
    int K, X;
    cin >> K >> X;
    cout << (K * 500 >= X ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 764
n,m=map(int,input().split())
sc=sorted([list(map(int,input().split())) for i in range(m)])
ans=[0 for i in range(n)]
res=True
for i in range(m):
    if (i>0 and sc[i][0]==sc[i-1][0] and sc[i][1]!=sc[i-1][1]) or (n>1 and sc[i][0]==1 and sc[i][1]==0):
        res=False
        break
    else:
        ans[sc[i][0]-1]=sc[i][1]

if n>1 and ans[0]==0:
    ans[0]=1

ans2=int("".join([str(i) for i in ans])) if res else -1
print(ans2)


Measured memory_bytes: 9180
/* Hardwork allways pays off */
//You never know how close to the solution you are ,so keep practicing
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define endl '\n'
#define mod 1000000007
#define REP(i,n) for(ll i=1;i<=n;i++)
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x) (x).begin(), (x).end()
void make_unique(vector<ll> vec)
{
sort(all(vec));
vec.resize(unique(all(vec)) - vec.begin());
}

int main() 
 {   ios;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    // cin>>t; 
    while(t--)
      {ll l,k,p,a,b,c,n,m,i,j,flag=0,count=0,move=0;
      ll d;
      cin>>a>>b>>c>>d;
      ll ans1=a*d;
      ll ans2=a*c;
      ll ans3=b*c;
      ll ans4=b*d;
      cout<<max({ans1,ans2,ans4,ans3})<<endl;
      
      

        
     }
	return 0;
}


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k, x;
  cin>>k>>x;
  for (int i = x-k+1; i < k+x; i++) {
    cout<<i;
    if (i!=k+x-1) cout<<" ";
  }
  cout<<endl;
}


Measured memory_bytes: 256
n = int(input())
s = [list(input()) for i in range(2)]
mod = 1000000007


if s[0][0] == s[1][0]:
    now = 1
    ans = 3
    v = True
else:
    now = 2
    ans = 6
    v = False

while now < n:
    if s[0][now] == s[1][now] and v:
        # タテ　タテ
        ans = (ans*2)%mod
        now+=1
        v = True
    elif s[0][now] == s[1][now]:
        # ヨコ　タテ
        ans = (ans*1)%mod
        now+=1
        v = True
    elif s[0][now] != s[1][now] and v:
        # タテ ヨコ
        ans = (ans*2)%mod
        now+=2
        v = False
    else:
        # ヨコ　ヨコ
        ans = (ans*3)%mod
        now+=2
        v = False
print(ans)

Measured memory_bytes: 9204
s = input()
import collections
ans=10**9
for cand in set(s):
    cnt=0
    a=0
    for tmp in s:
        if tmp!=cand:
            cnt+=1
        else:
            if a<cnt:
                a=cnt
            cnt=0
    if a<cnt:
        a=cnt
    if ans>a:
        ans=a

print(ans)

Measured memory_bytes: 38512
a, b = map(str, input().split())
a_arr, b_arr = [], []
a_str, b_str, = "", ""
for _ in range(int(a)):
  b_arr.append(b)
b_str = "".join(b_arr)
for _ in range(int(b)):
  a_arr.append(a)
a_str = "".join(a_arr)
if a_str > b_str:
  print(b_str)
elif b_str < a_str:
  print(a_str)
else:
  print(a_str)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
struct edge{int to,cost;};
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=MOD;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    int memo=modpow(a,b/2);
    return memo*memo%MOD;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int inv(int x){
    x=modpow(x,MOD-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
double dist(double ax,double ay,double bx,double by){
    return sqrt((bx-ax)*(bx-ax)+(ay-by)*(ay-by));
}
int n,a[15],x[15][15],y[15][15];
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a[i];
		rep(j,a[i]){
			cin>>x[i][j]>>y[i][j];
			x[i][j]--;
		}
	}
	int ans=0;
	rep(i,(1<<n)){
		int sum=0;
		rep(j,n){
			if((i>>j)&1){
				sum++;
				rep(k,a[j]){
					if(((i>>x[j][k])&1)!=y[j][k])goto ng;
				}
			}
		}
		ans=max(ans,sum);
		ng:;
	}
	cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();
        while (line.equals("")) {
            line = scanner.nextLine();
        }
        String[] lines = line.split(" ");
        int N = Integer.parseInt(lines[0]);
        int M = Integer.parseInt(lines[1]);
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < M; i++) {
            stringBuilder.append(N);
        }
        TreeSet<String> treeSet = new TreeSet<>();
        treeSet.add(stringBuilder.toString());
        StringBuilder stringBuilder1 = new StringBuilder();
        for (int i = 0; i < N; i++) {
            stringBuilder1.append(M);
        }
        treeSet.add(stringBuilder1.toString());
        System.out.println(treeSet.first());
    }

}

Measured memory_bytes: 22740
import math
N=int(input())
f=[0]*(10050)
for j in range(int(math.sqrt(N))):
    for k in range(int(math.sqrt(N))):
        for l in range(int(math.sqrt(N))):
            i=(j+1)*(j+1)+(k+1)*(k+1)+(l+1)*(l+1)+(j+1)*(k+1)+(k+1)*(l+1)+(l+1)*(j+1)
            if i<10050:
                f[i]=f[i]+1

for i in range(1, N+1):
    print(f[i])


Measured memory_bytes: 9312
import sys
from math import ceil
a, b, c = [int(i) for i in sys.stdin.readline().split()]
INF = 10 ** 18
best = INF
for i in range(min(a, b, c), max(a, b, c) + 2):
    score = 0
    for j in [a, b, c]:
        if j < i:
            score += ceil((i - j) / 2)
            score += (i - j) % 2
        else:
            score += j - i
    best = min(best, score)
print(best)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define uint unsigned
#define ld long double
#define PI pair<int,int>
inline char gc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x = 0; char ch = gc(); bool positive = 1;
	for (; !isdigit(ch); ch = gc())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = gc())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(ll a){
    if(a<0){
    	a=-a; putchar('-');
	}
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(ll a){write(a); puts("");}
inline void wri(ll a){write(a); putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=1000005,mod=998244353;
ll n,m,fac[N],ni[N],ans;
inline int ksm(ll a,int b){
	int ans=1;
	for(;b;b>>=1){
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
	}
	return ans;
}
ll c(int a,int b){
	return fac[a]*ni[a-b]%mod*ni[b]%mod;
}
signed main(){
	for(int i=fac[0]=1;i<N;i++)fac[i]=fac[i-1]*i%mod; ni[N-1]=ksm(fac[N-1],mod-2); for(int i=N-1;i;i--)ni[i-1]=ni[i]*i%mod;
	n=read(); m=read();
	for(int i=1;i<=n&&i<=m;i++)ans=(ans+c(2*i,i)*c(m+n-2*i,n-i))%mod; 
	ans=(ans*ksm(2*c(n+m,n)%mod,mod-2)%mod+max(n,m))%mod;
	cout<<ans<<endl;
}

Measured memory_bytes: 15872
#include <cmath> 
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define debug(...) fprintf(stderr,__VA_ARGS__)
using namespace std;
template<class T> void rd(T &x) {
	x=0; int f=1,ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=getchar();}
	x*=f;
}
typedef long long ll;
const int mod=998244353;
const int maxn=1500+5;
int n; char A[maxn][maxn];
int head[maxn];
int adj[maxn][maxn],deg[maxn];
int vis[maxn],E,P,C;
struct edge {
	int to,nex;
	edge(int to=0,int nex=0):to(to),nex(nex){}
};
vector<edge> G;
inline int add(int x) {return x>=mod?x-mod:x;}
ll power(ll x,ll y) {
	ll re=1;
	while(y) {
		if(y&1) re=re*x%mod;
		x=x*x%mod;
		y>>=1;
	}
	return re;
}
inline void addedge(int u,int v) {
	G.push_back(edge(v,head[u])),head[u]=G.size()-1;
	G.push_back(edge(u,head[v])),head[v]=G.size()-1;
}
inline int idx0(int x,int y) {return x+y;}
inline int idx1(int x,int y) {return x<y?idx0(0,y-x):idx0(x-y,0);}
inline bool upd(int x,int y,char c) {
	if(c=='?') return 1;
	int a=x+y,b=x-y;
	if(a>n) a=2*n-a;
	if(b<0) b=-b;
	x=(a+b)/2,y=a-x;
	a=idx0(x,y),b=idx1(x,y);
	if(a>b) swap(a,b);
	if(adj[a][b]==-1) {
		adj[a][b]=c=='x'; 
		deg[a]^=adj[a][b];
		deg[b]^=adj[a][b];
	}
	else return adj[a][b]==(c=='x');
	return 1;
}
void travel(int u) {
	if(vis[u]) return; vis[u]=1;
	++P; if(deg[u]) ++C;
	for(int i=head[u];~i;i=G[i].nex) {
		int v=G[i].to;
		++E;
		travel(v);
	}
}
int sol(int k) {
	for(int i=1;i<n;++i) for(int j=1;j<n;++j) if(((i+j)&1)==k) {
		if(!upd(i,j,A[i][j])) return 0;
	}
	int cnt=0;
	for(int i=k;i<=n;i+=2) ++cnt;
	if(~cnt&1) {
		int an=1;
		for(int i=k;i<=n;i+=2) for(int j=i+2;j<=n;j+=2) {
			if(adj[i][j]==-1) an=add(an<<1);
		}
		return an;
	}
	for(int i=k;i<=n;i+=2) for(int j=i+2;j<=n;j+=2) {
		if(adj[i][j]==-1) addedge(i,j);
	}
	int an=1;
	for(int i=k;i<=n;i+=2) if(!vis[i]) {
		E=0,P=0,C=0,travel(i),E>>=1;
		if(C&1) return 0;
		an=an*power(2,E-(P-1))%mod;
	}
	return an;
}
int main() {
	rd(n);
	for(int i=1;i<n;++i) scanf("%s",A[i]+1);
	memset(adj,-1,sizeof(adj));
	memset(head,-1,sizeof(head));
	printf("%lld\n",(ll)sol(0)*sol(1)%mod);
	return 0;
}

Measured memory_bytes: 22608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10;
int n,go[N][2],top;
char s[N];
ll L,sg;
void dfs(int x,ll dep){
	int cnt=0;
	if (go[x][0]) dfs(go[x][0],dep-1),cnt++;
	if (go[x][1]) dfs(go[x][1],dep-1),cnt++;
	if (cnt==1) sg^=dep&-dep;
}
int main()
{
	scanf("%d%lld",&n,&L);
	top=1;
	for (int i=1;i<=n;i++){
		scanf("%s",s);
		int l=strlen(s);
		for (int i=0,p=1;i<l;i++){
			int w=s[i]-'0';
			if (!go[p][w]) go[p][w]=++top;
			p=go[p][w];
		}
	}
	dfs(1,L);
	puts(sg?"Alice":"Bob");
	return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))


int main(){
	int N;
	cin >> N;
	vector<int> A(N),P(N),Q(N);
	FOR(i,0,N) cin >> P[i];
	FOR(i,0,N) cin >> Q[i];
	FOR(i,0,N) A[i] = i+1;

	int p,q;

	int cnt = 0;
	vector< vector<int> > AS;
	do{
		AS.push_back(A);
	}while(NEXTP(A));

	p = POSL(AS,P);
	q = POSL(AS,Q);

	cout << abs(p-q) << endl;

}



Measured memory_bytes: 3256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
template<class T, class Compare = less<T> >
using MaxHeap = priority_queue<T, vector<T>, Compare>;
template<class T, class Compare = greater<T> >
using MinHeap = priority_queue<T, vector<T>, Compare>;
using llong = long long;

llong n, a, b;
llong h[100005];

bool check(llong k) {
    llong t = k;
    for (int i = 0; i < n; i++) {
        llong valid = k;
        llong invalid = -1;

        while (valid - invalid > 1) {
            llong mid = (valid + invalid) / 2;
            
            if (mid * a + (t - mid) * b >= h[i]) {
                valid = mid;
            }
            else {
                invalid = mid;
            }
        }

        if (valid * a + (t - valid) * b < h[i]) return false;

        k -= valid;
    }

    return true;
}

int main() {

    cin >> n >> a >> b;
    for (int i = 0; i < n; i++) {
        cin >> h[i];
    }

    llong valid = 1ll << 31ll;
    llong invalid = -1;
    while (valid - invalid > 1) {
        llong mid = (valid + invalid) / 2;
        if (check(mid)) {
            valid = mid;
        }
        else {
            invalid = mid;
        }
    }

    cout << valid << endl;

    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
int main(void){
    int X,Y;
    scanf("%d%d",&X,&Y);
    int shokin[3]={300000,200000,100000};
    int total = 0;
    if(X<=3) total += shokin[X-1];
    if(Y<=3) total += shokin[Y-1];
    if(X==1&&Y==1) total += 400000;
    printf("%d\n",total);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
string s; long long br, n, ans, mod, MOD, BR[2][200005], val[2];
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> s;
for (int i=0; i<n; i++)
	if (s[i]=='1') MOD++;
if (MOD<2){
	for (int i=0; i<n; i++)
		{val[1]*=2; val[1]+=s[i]-'0'; val[1]%=(MOD+1);}
	long long pot2=1;
	for (int i=n-1; i>=0; i--){
		BR[1][i]=pot2;
		pot2*=2; pot2%=(MOD+1);
	}	
}
else {
	for (int i=0; i<n; i++)
		{val[1]*=2; val[1]+=s[i]-'0'; val[1]%=(MOD+1);}	
	for (int i=0; i<n; i++)
		{val[0]*=2; val[0]+=s[i]-'0'; val[0]%=(MOD-1);}	
	long long pot2=1;
	for (int i=n-1; i>=0; i--){
		BR[1][i]=pot2;
		pot2*=2; pot2%=(MOD+1);
	} pot2=1;
	for (int i=n-1; i>=0; i--){
		BR[0][i]=pot2;
		pot2*=2; pot2%=(MOD-1);
	}
}
for (int i=0; i<n; i++){
	if (s[i]=='0') mod=1; else mod=-1;
	if (mod==1) br = val[1] + BR[1][i];
	else br = val[0] - BR[0][i];
	mod+=MOD; 
	if (mod==0){cout << 0 << endl; continue;}
	br = (br+3*mod)%mod; ans=1;
//	cout << "br: " << br << "  mod: " << mod << endl;
	while (br){br = br % __builtin_popcount(br); ans++;}
	cout << ans << endl;
}
return 0;
}


Measured memory_bytes: 6900
x, y = map(int, input().split())
if (x >= 0) & (y >= 0):
    if (x <= y):
        ans = y - x
    elif (x > y):
        if y == 0:
            ans = 1 + x - y
        else:
            ans = 2 + x - y
elif (x >= 0) & (y < 0):
    if (x <= abs(y)):
        ans = abs(y) - x + 1
    elif (x > abs(y)):
        ans = x - abs(y) + 1
elif (x < 0) & (y >= 0):
    if (abs(x) > y):
        ans = min((y - x), 1 + abs(x) - y)
    elif (abs(x) <= y):
        ans = min((y - x), 1 - abs(x) + y)
elif (x < 0) & (y < 0):
    if (x < y):
        ans = y - x
    elif (x > y):
        ans = 2 + abs(y) - abs(x)
print(ans)

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


int main(){
	int n,m,x,a[110],tmp=0,tmp1=0,ans;

	cin>>n>>m>>x;
	for(int i=0;i<m;i++)cin>>a[i];

	for(int i=0;i<m;i++){
		if(a[i]<x)tmp++;
		if(a[i]>x)tmp1++;
	}
	ans=min(tmp1,tmp);
	cout<<ans<<endl;
}

Measured memory_bytes: 256
// Code for B - Magic 2
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define FOR(i,x,y) for(ll i=x;i<(ll)(y);i++)

#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

int main() {
  int A, B, C, K;
  cin >> A >> B >> C >> K;

  REP(i, K) {
    if (A >= B) {
      B *= 2;
      continue;
    }
    if (B >= C) {
      C *= 2;
      continue;
    }
  }

  if (A < B && B < C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


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

int main() 
{
    long long A,B,K;
    cin >> A >> B >> K;
    
    if (K <= A) {
        cout << A - K << " " << B << endl;
    }else if (K <= A+B) {
        cout << 0 << " " << B - (K-A) << endl;
    }else{
        cout << 0 << " " << 0 << endl;
    }
    
}

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

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

#define MOD 1000000007

using namespace std;

typedef long long ll;

ll gcd(ll a, ll b)
{
    if (b == 0)
    {
        return a;
    }

    return gcd(b, a % b);
}

int main()
{
    ll K;
    cin >> K;
    ll gcdV[K + 1][K + 1];
    REP(i, K + 1) REP(j, K + 1) gcdV[i][j] = gcd(i, j);
    ll ans = 0;
    for (int i = 1; i <= K; ++i)
    {
        for (int j = 1; j <= K; ++j)
        {
            for (int k = 1; k <= K; ++k)
            {
                ans += gcd(gcdV[i][j], k);
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3944
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

long long factorial(int a)
{
    if (a)
    {
        return 1;
    }else
    {
        return factorial(a - 1);
    }
    
}

int main(int argc, char const *argv[])
{
    int N, P;
    cin >> N >> P;
    vector<int> A;
    A.resize(N);
    int cntodd = 0, cnteven = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        (A[i] % 2 ? cntodd++ : cnteven++);
    }

    long long ans;
    if (cnteven == N)
    {
        if (P)
        {
            ans = 0;
        }else
        {
            ans = (long long)pow(2.0, N);
        }
        
    }else
    {
        ans = (long long)pow(2.0, N - 1);
    }

    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.h>
#include <cmath>
#include <limits>
#include <iostream>
#include <assert.h>

#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=10000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct pos{
	int x,y,cost;
};
ll d[1025][11]={};
ll d2[1025][11]={};
int a[11]={};
int main(){

	string s;
	cin>>s;
	rep(i,s.size()){
		if(s[i]=='1')a[i+1]=1;
		if(s[i]=='2')a[i+1]=2;
		if(s[i]=='3')a[i+1]=3;
		if(s[i]=='4')a[i+1]=4;
		if(s[i]=='5')a[i+1]=5;
		if(s[i]=='6')a[i+1]=6;
		if(s[i]=='7')a[i+1]=7;
		if(s[i]=='8')a[i+1]=8;
		if(s[i]=='9')a[i+1]=9;
	}
	d[1][1]=a[1];
	d2[1][1]=a[1];
	int t2=1;
	for(int i=2; i<s.size()+1; i++){
		int t=1;
		for(int j=1; j<=t2; j++){
			d[t][i]=d[j][i-1]-d2[j][i-1]+d2[j][i-1]*10+a[i];
			d[t+1][i]=d[j][i-1]+a[i];
			d2[t][i]=d2[j][i-1]*10+a[i];
			d2[t+1][i]=a[i];
			t+=2;
		}
		t2=t-1;
	}
	ll total=0;
	for(int i=1; i<=t2; i++){
		total+=d[i][s.size()];
	}
	cout<<total<<endl;
	return 0;

}



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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

template<class T>bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;
constexpr double EPS = 1e-10;
#pragma endregion

void solve() {
    int h, w, n;
    cin >> h >> w >> n;
    cout << n/max(h, w) + (n%max(h, w) != 0) << "\n";
}

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

    solve();

    return 0;
}


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

using namespace std;

typedef long long ll;

int main(int, char**)
{
	ll n, ans = 10000000;
	cin >> n;
	vector<ll> w(n+1, 0);
	for (int i = 0; i < n; ++i) {
		ll x;
		cin >> x;
		w[i+1] = w[i] + x;
	}

	for (int i = 1; i < n; ++i) {
		ans = min(ans, abs(w[i] - (w[n] - w[i])));
		cerr << w[i+1] << "," << ans << endl;
	}

	cout << ans << endl;
	return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))

#define DEBUG(x) cout << #x << ": " << (x) << endl
#define PRINT(x) cout << x << endl
int main() {
  int N;
  cin >> N;

  int A, B;

  if (N == 2) {
    cin >> A >> B;
    PRINT(A + B);
  } else {
    PRINT("Hello World");
  }
}

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

ll a, b, n;

ll func(ll x) {
    ll num1 = a * x ;
    ll num2 = x / b;
    ll num3 = num1 /b;
    ll num4 = num2 * a;
    return num3 - num4;
}

int main(){
    cin >> a >> b >> n;
    cout << func(min(b-1, n)) << endl;
}

Measured memory_bytes: 3452
#include <iostream>

using namespace std;

void compute(int n) 
{
  int num = 0;
  for (int a=0; a <= 9; a++)
    for (int b=0; b <= 9; b++)
      for (int c=0; c <= 9; c++)
        for (int d=0; d <= 9; d++)
          if (a+b+c+d==n)
            num++;
  cout << num << endl;
}


int main(void) 
{
  int n;
  while (cin >> n) {
    compute(n);
  }
  
  return 0;
}

Measured memory_bytes: 3080
count = gets.to_i
nums = readline.chomp.split(" ").map(&:to_i)
result = []

for i in 0...count
  a = nums[i]
  for j in 0...count
    b = nums[j]
    if i < j
      for k in 0...count
        c = nums[k]
        if j < k && i < k 
          if a + b > c && a + c > b && b + c > a && [a, b, c].uniq.count == 3
            result << [i, j, k]
          end
        end
      end
    end
  end
end

puts result.count

Measured memory_bytes: 27256
import 'dart:io';

void main(List<String> arguments) {
  final nk = stdin.readLineSync().split(' ');
  final k = int.parse(nk[1]);
  final result =
      (stdin.readLineSync().split(' ').map((p) => int.parse(p)).toList()
            ..sort())
          .take(k)
          .fold(0, (previousValue, element) => previousValue + element);
  print(result);
}


Measured memory_bytes: 13204
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
const ll INF = 1LL << 60;

int main(){
	int a, b, c; cin >> a >> b >> c;
	if(a == b) cout << c;
	else if (a == c) cout << b;
	else if (b == c) cout << a;


}


Measured memory_bytes: 256
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = map(int,input().split())
A = prime_factorize(A)
B = prime_factorize(B)
C = []
for i in A:
    if i in B:
        C += i,
print(1+len(set(C)))

Measured memory_bytes: 9124
#include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/detail/standard_policies.hpp>
    using namespace std;
    using namespace __gnu_pbds;
    #define ll long long
    #define int long long
    #define pb push_back
    #define For(i,n) for(ll  i=0;i<n;i++)
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) ;clock_t clk = clock();
    #define f(a,b,c) for(ll a=b;a<c;a++)
    #define mod   998244353
    #define ld long double
    #define read(t) ll t;cin>>t;
    #define all(x) x.begin(),x.end()
    #define fi first
    #define se second
    #define endl "\n"
    #define pii pair<ll,ll>
    #define what_is(x) cerr << #x << " is " << x << endl;
    #define time cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';
    const double pi=3.14159265358979323846264;
    typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
    typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;

/**********************************************************************************************************************/

signed main()/*Check flow...question galat mat padhna */
{
    fast;   
    string s[3]={"Sunny","Cloudy", "Rainy"};
    string x;
    cin>>x;
    For(i,3)
    {
        if(x==s[i])cout<<s[(i+1)%3]<<endl;
    }
}      

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <vector>
#define rep(i, x, n) for(int i = x; i < n; i++)
using namespace std;
const long long INF = 1LL << 60;
bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first) {
        return a.first < b.first;
    } else {
        return a.second < b.second;
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    priority_queue<int> que;
    rep(i, 0, N) {
        int p;
        cin >> p;
        que.push(p);
    }
    rep(i, 0, M) {
        int tmp = que.top();
        que.pop();
        que.push(tmp / 2);
    }
    long long res = 0;
    while(!que.empty()) {
        res += que.top();
        que.pop();
    }
    cout << res << endl;
}

Measured memory_bytes: 892
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>

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

using namespace std;
using ll = long long;
using P = pair<int, int>;
using TP = tuple<ll, ll, ll>;
ll MOD = 1e9+7;
//ll INF = 1LL<<40;
int INF = 1LL<<15;

int H, W;

int xv[4] = {-1, 1, 0, 0};
int yv[4] = {0, 0, -1, 1};

queue<TP> q;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    cin >> H >> W;
    vector<vector<char>> c(H, vector<char>(W,'.'));
    int white = 0;
    REP(i, H){
        REP(j, W){
            cin >> c[i][j];
            if(c[i][j] == '.'){
                white++;
            }else{
                q.push(make_tuple(j,i,1));
            }
        }
    }
    if(white == 0){
        cout << 0 << endl;
        return 0;
    }
    int step = 0;
    while(!q.empty()){
        int x, y, nx, ny;
        tie(x, y, step) = q.front(); q.pop();
        REP(i, 4){
            nx = x + xv[i];
            ny = y + yv[i];
            if(0 <= nx && nx < W && 0 <= ny && ny < H && c[ny][nx] == '.'){
                c[ny][nx] = '#';
                q.push(make_tuple(nx,ny,step+1));
                white--;
            }
        }
//        REP(i, H){
//            REP(j, W){
//                cout << c[i][j];
//            }
//            cout << endl;
//        }

        if(white <= 0){
            break;
        }
    }
//    REP(i, H){
//        REP(j, W){
//            cout << c[i][j];
//        }
//        cout << endl;
//    }
    cout << step << endl;
    return 0;
}


Measured memory_bytes: 25524
class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
        return self.root[x]

    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if (x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        #rnkが大きい方に結合
        elif (self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
        # rnkが同じ（深さに差がない場合）は1増やす
        if(self.rnk[x] == self.rnk[y]):
            self.rnk[y] += 1

    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]

N,M=map(int, input().split())
uni=UnionFind(N)
for i in range(M):
    a,b=map(int, input().split())
    uni.Unite(a-1,b-1)

L=[]

for i in range(N):
    root = uni.Find_Root(i)
    L.append(root)

print(len(set(L))-1)



Measured memory_bytes: 83404
#include <iostream>

using namespace std;

int main(void)
{
    int A, B;
    int Answer;
    int count = 0;
    
    cin >> A >> B;
    
    for (int i = 1; i < 4; i++) {
        Answer = A*B*i;
        Answer = Answer % 2;        //割り切れたら0
        if (Answer != 0) {
            count += 1;
        }
    }
    
    if (count > 0) {
        cout << "Yes";
    }
    else {
        cout << "No";
    }
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<double> a(n);
    vector<double> b(n);
    int sum=0;
    rep(i,n){
        cin >> a[i];
     sum+=a[i];
    }
    double ave=(double)sum/n;
    int ans=0;
    rep(j,n){  
     b[j]=abs(ave-a[j]);
    }
    sort(b.begin(),b.end());
    rep(i,n){
        if(abs(ave-a[i])==b[0]){
            ans=i;
            break;
        }
    }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3680
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {
            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }


        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var  input = Reads();
            var a= input[0];
            var b = input[1];

            Console.WriteLine((b-a+1)*(b-a)/2 - b);
           

            
           
            Console.Out.Flush();
        }
    }
}

Measured memory_bytes: 13396
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <math.h>
#include <numeric>
#define rep(i,s,n) for (int i = s; i < n; ++i)
#define drep(i,s,n) for (int i = n; i >= s; --i)
#define all(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define print(x) cout<<(x)<<endl
using namespace std;
typedef long long ll;

int gcd(int a, int b)
{
   if (a%b == 0) return(b);
   else          return(gcd(b, a%b));
}
int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
void printvv(vector<vector<auto>> vv, int n)
{
  cout << '[' << endl;
  rep(q, 0, n)
  {
    cout << '[';
    rep(p, 0, n)
    {
      cout << vv.at(q).at(p) << ',';
    }
    cout << ']' << endl;
  }
  cout << ']' << endl;
}

void solve();
int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}

//------------------------------------------------------------
void solve() {
  int n,sum=0,i=0;
  cin>>n;

  vector<vector<int>> v(2, vector<int>(n));
  rep(i,0,2) rep(j,0,n) cin>>v.at(i).at(j);

  vector<int> ans(n);

  while (i<n)
  {
    sum=0;
    rep(j,0,i+1) sum+=v.at(0).at(j);
    rep(j,i,n) sum+=v.at(1).at(j);
    ans.at(i)=sum;
    ++i;
  }

  print(*max_element(all(ans)));

  return;
}


Measured memory_bytes: 256
<?php
$W=trim(fgets(STDIN));
$w=strtolower($W);
$C=0;
while(1){
  $T=trim(fgets(STDIN));
  if($T=='END_OF_TEXT') break;
  $t=strtolower($T);
  foreach(explode(' ',$t) as $u) if($u==$w) ++$C;
}
echo $C;
?>

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

int main(){
  int n;
  std::cin >> n;
  std::vector<int> v(n);
  string s;
  for (int i = 0; i < n; i++) {
    std::cin >> v.at(i);
  }
  sort(v.begin(), v.end());
  
  for (int i = 0; i < n - 1; i++) {
    if (v.at(i) == v.at(i+1)) {
      s = "NO";
      break;
    }
    else{
      s = "YES";
    }
  }
  std::cout << s << '\n';
  return 0;
}



Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(a) begin(a),end(a)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1e+9;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll gcd(ll a, ll b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


int fac(int num) {
  if(num==1) return 1;
  else return num*fac(num-1);
}



int main() {
  ll N; cin >> N;
  ll a[N+1];
  ll b[N];
  rep(i,N+1) cin >> a[i];
  rep(i,N) cin >> b[i];
  ll ans = 0;
  rep(i,N) {
    int x = a[i],y=a[i+1];
    if(a[i] > b[i]) a[i] -= b[i];
    else {
      b[i] -= a[i];
      a[i] = 0;
      a[i+1] = max(0LL,a[i+1]-b[i]);
    }
    
    ans += x - a[i] + y - a[i+1];
   
  }
  cout << ans << endl;
 
  return 0;
}


Measured memory_bytes: 1792
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque> 
#include <algorithm>
 
using namespace std;
 
#define     lli                 long long int
#define     ulli                unsigned long long int

#define     ifor(st,lim)        for(int i=st;i<lim;i++)
#define     jfor(stt,llim)      for(int j=stt;j<llim;j++)
#define		Test(tt)			for(int test=1;test<=tt;test++)
#define		For(var,srt,nnd)	for(var=srt;var<nnd;var++)
#define		Rfor(var,srt,nnd)	for(var=srt;var>=nnd;var--)
 
#define     pb                  push_back
#define     mkp                 make_pair
 
#define     pi                  acos(-1)
#define     mod                 100000007
 
#define     Clear(var,val)      memset(var,val,sizeof(var));
#define     len(var)            var.length()
#define     vlen(vect)          (int)vect.size()
#define     line(ss)            getline(cin,ss);

#define		FIO					ios_base::sync_with_stdio(false);cin.tie(NULL)

#define		sclock				int start_s=clock()
#define		eclock				int end_s=clock()
#define		pclock				printf("\nRuntime :: %.2lf\n", (double)(end_s-start_s)/CLOCKS_PER_SEC)
 
/****************************** IO ************************************/
#define		ina(a)				scanf("%d",&a)
#define		inb(a,b)			scanf("%d %d",&a,&b)
#define		inc(a,b,c)			scanf("%d %d %d",&a,&b,&c)
#define		ins(chr)			scanf("%s",s)
#define		inlla(a)			scanf("%lld",&a)
#define		inllb(a,b)			scanf("%lld %lld",&a,&b)
#define		inllc(a,b,c)		scanf("%lld %lld %lld",&a,&b,&c)
 
#define		outa(a)				printf("%d",a)
#define		outlla(a)			printf("%lld",a)

#define		yn(b)				puts(b ? "YES" : "NO") 

#define		outar(ar,ln,c)		for(int i=0;i<ln;i++){printf("%d%c",ar[i],c);}

#define		outCase()			printf("Case %d:",test)
 
#define		blank				printf("\n")
/**********************************************************************/

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


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

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

  /* */
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  cout << s1[0] << s2[0] << s3[0] << endl;
  /* */

  return EXIT_SUCCESS;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        System.out.println(GCD(Math.max(x,y),Math.min(x,y)));
    }
    public static int GCD(int a,int b){
        if(b==0) return a;
        else return GCD(b,a%b);
    }
}


Measured memory_bytes: 26292
use std::io::Read;

mod segment_tree {
    pub struct SegmentTree<T, F> {
        size: usize,
        data: Vec<T>,
        identity: T,
        operation: F,
    }

    impl<T: Clone + Copy, F: Fn(T, T) -> T> SegmentTree<T, F> {
        pub fn new(n: usize, id: T, op: F) -> SegmentTree<T, F> {
            let mut size = 1;
            while size < n {
                size <<= 1;
            }
            SegmentTree {
                size: size,
                data: vec![id; size * 2 - 1],
                identity: id,
                operation: op,
            }
        }

        pub fn update(&mut self, mut i: usize, x: T) {
            i += self.size - 1;
            self.data[i] = x;
            while i > 0 {
                i = (i - 1) / 2;
                self.data[i] = (self.operation)(self.data[i * 2 + 1], self.data[i * 2 + 2]);
            }
        }

        pub fn query(&self, a: usize, b: usize) -> T {
            return self._query(a, b, 0, 0, self.size);
        }

        fn _query(&self, a: usize, b: usize, i: usize, l: usize, r: usize) -> T {
            if b <= l || r <= a {
                return self.identity;
            }
            if a <= l && r <= b {
                return self.data[i];
            }
            let v1 = self._query(a, b, i * 2 + 1, l, (l + r) / 2);
            let v2 = self._query(a, b, i * 2 + 2, (l + r) / 2, r);
            return (self.operation)(v1, v2);
        }
    }
}

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let q: usize = itr.next().unwrap().parse().unwrap();
    let mut st = segment_tree::SegmentTree::new(n, (1u64 << 31) - 1, std::cmp::min);
    for _ in 0..q {
        let t: usize = itr.next().unwrap().parse().unwrap();
        let l: usize = itr.next().unwrap().parse().unwrap();
        let r: usize = itr.next().unwrap().parse().unwrap();
        if t == 0 {
            st.update(l, r as u64);
        } else {
            println!("{}", st.query(l, r + 1));
        }
    }
}


Measured memory_bytes: 9016
/*
* @Author: Arextre
* @Date:   2020-05-02 20:49:40
* @Last Modified by:   Arextre
* @Last Modified time: 2020-05-02 20:50:38
*/
#include<cstdio>

#define rep(i,__l,__r) for(signed i=(__l),i##_end_=(__r);i<=i##_end_;++i)
#define fep(i,__l,__r) for(signed i=(__l),i##_end_=(__r);i>=i##_end_;--i)
#define writc(a,b) fwrit(a),putchar(b)
#define mp(a,b) make_pair(a,b)
#define ft first
#define sd second
#define LL long long
#define ull unsigned long long
#define uint unsigned int
#define pii pair< int,int >
#define Endl putchar('\n')
// #define FILEOI
// #define int long long
// #define int unsigned
// #define int unsigned long long

#ifdef FILEOI
# define MAXBUFFERSIZE 500000
inline char fgetc(){
    static char buf[MAXBUFFERSIZE+5],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,MAXBUFFERSIZE,stdin),p1==p2)?EOF:*p1++;
}
# undef MAXBUFFERSIZE
# define cg (c=fgetc())
#else
# define cg (c=getchar())
#endif
template<class T>inline void qread(T& x){
    char c;bool f=0;
    while(cg<'0'||'9'<c)f|=(c=='-');
    for(x=(c^48);'0'<=cg&&c<='9';x=(x<<1)+(x<<3)+(c^48));
    if(f)x=-x;
}
inline int qread(){
    int x=0;char c;bool f=0;
    while(cg<'0'||'9'<c)f|=(c=='-');
    for(x=(c^48);'0'<=cg&&c<='9';x=(x<<1)+(x<<3)+(c^48));
    return f?-x:x;
}
template<class T,class... Args>inline void qread(T& x,Args&... args){qread(x),qread(args...);}
template<class T>inline T Max(const T x,const T y){return x>y?x:y;}
template<class T>inline T Min(const T x,const T y){return x<y?x:y;}
template<class T>inline T fab(const T x){return x>0?x:-x;}
inline int gcd(const int a,const int b){return b?gcd(b,a%b):a;}
inline void getInv(int inv[],const int lim,const int MOD){
    inv[0]=inv[1]=1;for(int i=2;i<=lim;++i)inv[i]=1ll*inv[MOD%i]*(MOD-MOD/i)%MOD;
}
template<class T>void fwrit(const T x){
    if(x<0)return (void)(putchar('-'),fwrit(-x));
    if(x>9)fwrit(x/10);
    putchar(x%10^48);
}
inline LL mulMod(const LL a,const LL b,const LL mod){//long long multiplie_mod
    return ((a*b-(LL)((long double)a/mod*b+1e-8)*mod)%mod+mod)%mod;
}

LL a,b,n;

signed main(){
#ifdef FILEOI
    freopen("file.in","r",stdin);
    freopen("file.out","w",stdout);
#endif
    qread(a,b,n);
    printf("%lld\n",a*Min(b-1,n)/b);
    return 0;
}

Measured memory_bytes: 3164
#include "bits/stdc++.h"
using namespace std;

int main() {
    long long N;
    cin >> N;

    long long res = 0;
    for (long long i = 1; i <= sqrt(N); i++) {
        long long j = N / i;
        if (i * j == N) {
            for (long long k = 0; k < 11; k++) {
                if (j / pow(10, k) < 1) {
                    res = k;
                    break;
                }
            }
        }
        else {
            continue;
        }
    }

    cout << res << endl;
}

Measured memory_bytes: 256
class UnionFind:
    __slots__ = ["_data_size", "_roots"]

    def __init__(self, data_size: int) -> None:
        self._data_size = data_size
        self._roots = [-1] * data_size

    def __getitem__(self, x: int) -> int:
        while self._roots[x] >= 0:
            x = self._roots[x]
        return x

    def is_connected(self, x: int, y: int) -> bool:
        return self[x] == self[y]

    def unite(self, x: int, y: int) -> None:
        x, y = self[x], self[y]
        if x == y:
            return
        if self._roots[x] > self._roots[y]:
            x, y = y, x
        self._roots[x] += self._roots[y]
        self._roots[y] = x


import sys

read = sys.stdin.buffer.read

N, Q, *TUV = map(int, read().split())
tree = UnionFind(N)
res = []
for t, u, v in zip(*[iter(TUV)] * 3):
    if t:
        res.append(int(tree.is_connected(u, v)))
    else:
        tree.unite(u, v)
print("\n".join(map(str, res)))


Measured memory_bytes: 144916