akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll H, W; cin >> H >> W;
    ll bw[H][W];
    ll ids[H][W]; rep(i, H){rep(j, W){ids[i][j] = INF;}}

    rep(i, H){
        string s; cin >> s;
        rep(j, W){if (s[j] == '#'){bw[i][j] = 1;}else{bw[i][j] = 0;}}
    }

    ll id = 0;
    rep(i, H){rep(j, W){
        if (ids[i][j] != INF){continue;}
        stack<P> q; q.push(make_pair(i, j)); // DO DFS

        while (q.size() > 0){
            P p = q.top();
            q.pop();
            ll cur_i = p.first;
            ll cur_j = p.second;

            ids[cur_i][cur_j] = id;

            rep(k, 4){
                ll next_i = cur_i + dy[k];
                ll next_j = cur_j + dx[k];
                if (0 <= next_i && next_i < H && 0 <= next_j && next_j < W){
                    if (bw[cur_i][cur_j] == 1 - bw[next_i][next_j] && ids[next_i][next_j] == INF){
                        // cout << i << " " << j << " " << next_i << " " << next_j << endl;
                        q.push(make_pair(next_i, next_j));
                    }
                }
            }
        }
        id++;
    }}

    map<ll, P> counter; rep(i, id){counter[i] = make_pair(0, 0);}
    rep(i, H){
        rep(j, W){
            // cout << ids[i][j] << " ";
            if (bw[i][j]){
                counter[ids[i][j]].first++;
            } else {
                counter[ids[i][j]].second++;
            }
        }
    }
    ll ans = 0;
    rep(i, id){ans += counter[i].first * counter[i].second;}
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 14488
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//const ll mod=1000000007;
int GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
struct Data{
    ll a,b,c,d;
};
V<Data> dat;
int n,m,q;
ll ans=0;
void dfs(V<int> v,int now){
    if(v.size()==n){
        ll res=0;
        for(int i=0;i<q;i++){
            if(v[dat[i].b-1]-v[dat[i].a-1]==dat[i].c)res+=dat[i].d;
        }
        chmax(ans,res);
        return;
    }
    for(int i=now;i<=m;i++){
        v.emplace_back(i);
        dfs(v,i);
        v.pop_back();
    }
}
int main(){
    cin>>n>>m>>q;
    dat.resize(q);
    for(int i=0;i<q;i++)cin>>dat[i].a>>dat[i].b>>dat[i].c>>dat[i].d;
    V<int> s;
    dfs(s,1);
    cout<<ans<<"\n";
}

Measured memory_bytes: 3664
def resolve():
    N, M, X = map(int, input().split())
    C = []
    A = []
    for _ in range(N):
        l = list(map(int, input().split()))
        C.append(l[0])
        A.append(l[1:])

    def _judge(pick_pattern: str) -> int:
        price = 0
        level = [0] * M
        # 金額と理解度の合計をそれぞれ求める
        for i in range(N):
            if pick_pattern[i] == "0":
                continue
            price += C[i]
            for j in range(M):
                level[j] += A[i][j]
        # 理解度の目標を達成しているかどうかを判定
        for j in range(M):
            if level[j] < X:
                return -1
        return price

    ans = 1001001001
    for i in range(2**N):
        pick = f"{i:b}".zfill(N)
        price = _judge(pick)
        if price > 0:
            ans = min(price, ans)

    print(ans if (ans < 1001001000) else -1)


if __name__ == "__main__":
    resolve()

Measured memory_bytes: 9260
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,c,b,i,co=0;
    cin>>a>>b>>c;
    for(i=a;i<=b;i++)
    {
        if(c%i==0)
            co++;
    }
    cout<<co<<endl;
}



Measured memory_bytes: 3060
import math

l = input().split()
N = int(l[0])
K = int(l[1])

AB = []

for i in range(N):
    l = input().split()
    a = int(l[0])
    b = int(l[1])
    AB.append((a, b))

AB.sort(key=lambda x: x[0])
#print(N, K, AB)

sum = 0
ans = 0
for ab in AB:
    sum += ab[1]
    if sum >= K:
        ans = ab[0]
        break

print(ans)


Measured memory_bytes: 56664
import itertools
n=int(input())
size=1
for i in range(1,n+1):
  size*=i
#print(size)
x=[]
y=[]
dist=0
aved=0
seq=[i+1 for i in range(n)]
#print(seq)
p=list(itertools.permutations(seq))
#print(p)
for i in range(n):
  a,b=map(int,input().split())
  x.append(a)
  y.append(b)
for i in range(size):
  for j in range(n-1):
    dist+=((x[p[i][j]-1]-x[p[i][j+1]-1])**2+(y[p[i][j]-1]-y[p[i][j+1]-1])**2)**0.5
aved=dist/size
print(aved)

Measured memory_bytes: 45168
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
const int mod = 1000000007;

int main() {
  int H,W;
  cin>>H>>W;
  vector<string>s(H);
  for(int i=0;i<H;i++){
    cin>>s[i];
  }
  vector<vector<int>>dist(H,vector<int>(W,-1));
  queue<pair<int,int>>q;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(s[i][j]=='#'){q.push(make_pair(i,j));dist[i][j]=0;}
    }
  }
  vector<int>dx={0,0,-1,1};
  vector<int>dy={1,-1,0,0};
  while(!q.empty()){
    auto p=q.front();q.pop();
    int x=p.second,y=p.first;
    for(int k=0;k<4;k++){
      int ny=y+dy[k],nx=x+dx[k];
      if(ny<0||ny>=H||nx<0||nx>=W){continue;}
      if(dist[ny][nx]!=-1){continue;}
      dist[ny][nx]=dist[y][x]+1;
      q.push(make_pair(ny,nx));
    }  
  }
  int MAX=0;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      chmax(MAX,dist[i][j]);
    }
  }
  cout<<MAX<<endl;
  return 0;
}

Measured memory_bytes: 17120
#include <queue>
#include <bitset>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int n, m, a, b, col[709]; bool f[709][709]; vector<int> g[709];
int main() {
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		cin >> a >> b; --a, --b;
		f[a][b] = true;
		f[b][a] = true;
	}
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < n; ++j) {
			if (i != j && !f[i][j]) g[i].push_back(j);
		}
	}
	fill(col, col + n, -1);
	bitset<709> bit = 1;
	for (int i = 0; i < n; ++i) {
		if (col[i] != -1) continue;
		queue<int> que; que.push(i); col[i] = 0;
		int c0 = 1, c1 = 0;
		while (!que.empty()) {
			int u = que.front(); que.pop();
			for (int j : g[u]) {
				if (col[j] == -1) {
					col[j] = col[u] ^ 1;
					if (col[j] == 0) ++c0;
					else ++c1;
					que.push(j);
				}
			}
		}
		bit = (bit << c0) | (bit << c1);
	}
	bool ok = true;
	for (int i = 0; i < n; ++i) {
		for (int j : g[i]) {
			if (col[i] == col[j]) ok = false;
		}
	}
	if (!ok) {
		cout << -1 << '\n';
	}
	else {
		int ret = 1 << 30;
		for (int i = 0; i <= n; ++i) {
			if (bit[i]) ret = min(ret, i * (i - 1) / 2 + (n - i) * (n - i - 1) / 2);
		}
		cout << ret << '\n';
	}
	return 0;
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<double,double>P;

const int MAX_N = 100005;

template<class V> class BIT {
private:
	int n;
	vector<V> bit;

public:
	void add(int i,V x)
	{
		while(i < n){
			bit[i] += x;
			i += i & -i;
		}
	}
	V sum(int i)
	{
		V s = 0;
		while(i>0){
			s += bit[i];
			i -= i & -i;
		}
		return s;
	}
	//初期値がすべて0の場合
	BIT(int sz){
		n = sz + 1;
		bit.resize(n,0);
	}
	BIT(vector<V> v) {
		int sz = (int)v.size();
		n = sz + 1;
		bit.resize(n);
		rep(i,sz){
			 add(i+1,v[i]);
		}
	}
	void print()
	{
		cout << "0 ";
		for(int i=1;i<n;i++){
			cout << sum(i) - sum(i-1) << " ";
		}
		cout << endl;
	}
	void print_sum()
	{
		rep(i,n){
			cout << sum(i) << " ";
		}
		cout << endl;
	}
};

int n;

bool ok(vector<double>& s,vector<double>& t,double cri)
{
    vector<P> vec(n);
    rep(i,n){
        vec[i] = P(cri*s[i]+t[i],i);
    }
    sort(all(vec));
    BIT<int> bt(n+5);
    int num = 0;
    rep(i,n){
        int hoge = round(vec[i].se);
        num += bt.sum(hoge+1);
        bt.add(hoge+1,1);
    }
    if(n*(n-1)/2 % 2 == 0){
        return num < n*(n-1)/4;
    }else{
        return num <= n*(n-1)/4;
    }
}

double solve(vector<P>& vec)
{
    vector<double> tilt(n),tang(n);
    rep(i,n){
        tilt[i] = vec[i].fi,tang[i] = vec[i].se;
    }
    double l = -INF,h = INF;
    double mid;
    rep(i,100){
        mid = (l+h)/2;
        if(ok(tilt,tang,mid)){
            l = mid;
        }else{
            h = mid;
        }
    }
    return mid;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    vector<P> v1(n),v2(n);
    rep(i,n){
        int a,b,c;
        cin >> a >> b >> c;
        v1[i] = P((double)a/-b,(double)c/b);
        v2[i] = P((double)b/-a,(double)c/a);
    }
    sort(all(v1)),sort(all(v2));
    printf("%.12lf %.12lf\n",solve(v1),solve(v2));
    return 0;
}


Measured memory_bytes: 2944
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int num, ans, tmp;
  ans = 0;
  scanf("%d",&num);
  tmp = num;
  while(num > 0){
    num -= 1000;
    ans += 1000;
  }
  printf("%d\n",ans-tmp);
  return 0;
}

Measured memory_bytes: 3228
# https://atcoder.jp/contests/abc115/tasks/abc115_c

N, K = map(int, input().split())

h = [int(input()) for _ in range(N)]

h.sort()

ans = int(1e15)

# print(h)

for i in range(N - K + 1):
    ans = min(ans, h[i + K - 1]-h[i])

print(ans)


Measured memory_bytes: 7384
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = len(S)

S2 = S[:N//2]
S3 = S[N//2+1:]

if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1]:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 5196
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n, m;
    cin >> n >> m;
    
    vector<int> vec(m*2);
    vector<int> vec2(n);
    
    for (int i=0; i<m*2; i++){
        cin >> vec.at(i);
    }
    
    for (int i=0; i<m*2; i++){
        vec2.at(vec.at(i)-1) += 1;
    }
    
    for (int i=0; i<n; i++){
        cout << vec2.at(i) << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <stack>
#include <queue>
typedef long long ll;
using namespace std;

int main(){
  ll i,j,k,n,m,x;
  cin >> n >> x;
  ll L[n],cnt=1,now=0;
  for(i=0;i<n;i++){
    cin >> L[i];
    now+=L[i];
    if(now<=x)cnt++;
  }
  cout << cnt << endl;
  return 0;
}


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

int main(){
  int N;
  cin>>N;
  vector<int> d(N);
  
  for(int i=0;i<N;++i){
    cin>>d.at(i);
  }

  int sum=0;
  for(int i=0;i<N;++i){
    for(int j=0;j<N;++j){
      if(j==i){
        continue;
      }
      else{
        sum=sum+d.at(i)*d.at(j);
      }
    }
  }
  cout<<sum/2<<endl;
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

n = ini()
w = [ins() for _ in range(n)]


def solve():
    p = set()
    p.add(w[0])
    for i in range(1, n):
        if w[i] in p:
            return False
        if w[i - 1][-1] != w[i][0]:
            return False
        p.add(w[i])
    return True


print("Yes" if solve() else "No")


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	vector<int>a(n); for(auto&&i:a)cin>>i;
	int xorr=a.front();
	for(int i=1;i<n;++i){
		xorr^=a.at(i);
	}
	int ans=xorr^a.front();
	cout<<ans;
	for(int i=1;i<n;++i){
		ans=xorr^a.at(i);
		cout<<" "s<<ans;
	}
	cout<<"\n"s;
}

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

int arr[100005];
int INF=(1<<31);
int n;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
    }
    int dp[100005];
    dp[0]=0;
    dp[1]=abs(arr[1]-arr[0]);
    for(int i=2;i<n;i++){
        dp[i]=min(dp[i-1]+abs(arr[i]-arr[i-1]),dp[i-2]+abs(arr[i]-arr[i-2]));
    }
    cout<<dp[n-1]<<"\n";

    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int ans;
int len[10];
int cal(vector<int> A,vector<int> B,vector<int> C)
{
	if(!A.size()||!B.size()||!C.size()) return 0x3f3f3f3f;
	int cost=0;
	int cura=0;
	for(int i=0;i<A.size();i++) cura+=A[i];
	cost+=abs(cura-a)+(A.size()-1)*10;
	int curb=0;
	for(auto p:B) curb+=p;
	cost+=abs(curb-b)+(B.size()-1)*10;
	int curc=0;
	for(auto p:C) curc+=p;
	cost+=abs(curc-c)+(C.size()-1)*10;
	return cost;
}
int n;
void dfs(int cur,vector<int> A,vector<int> B,vector<int> C)
{
	if(cur==n+1)
	{
		ans=min(ans,cal(A,B,C));
		return;
	}
	for(int i=0;i<4;i++)
	{
		if(i==1) 
		{
			A.push_back(len[cur]);
			dfs(cur+1,A,B,C);
			A.pop_back();
		}
		else if(i==2)
		{
			B.push_back(len[cur]);
			dfs(cur+1,A,B,C);
			B.pop_back();
		}
		else if(i==3)
		{
			C.push_back(len[cur]);
			dfs(cur+1,A,B,C);
			C.pop_back();
		}
		else{
			dfs(cur+1,A,B,C);
		}
	}
}
int main()
{
	ans=0x3f3f3f3f;
	cin>>n;
	cin>>a>>b>>c;
	for(int i=1;i<=n;i++) cin>>len[i];
	vector<int> A,B,C;
	dfs(1,A,B,C);
	cout<<ans<<endl;
}


Measured memory_bytes: 256
/*
ID: wangjun30
LANG: C++11
TASK:
*/
#include<iostream>
#include<algorithm>
#include<array>
#include<unordered_map>
#include<map>
#include<set>
#include<list>
#include<stack>
#include<unordered_set>
#include<vector>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<climits>
//#include<fstream>
#define int long long
using namespace std;
//ifstream cin(".in");
//ofstream cout(".out");
signed main(){
	cin.tie(nullptr);
	cout.tie(nullptr);
	int a;
	int b,c;
	cin>>a;
	scanf("%lld.%lld",&b,&c);
	b=b*100+c;
	cout<<a*b/100;
	return 0;
}

Measured memory_bytes: 3760
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);
		int a = Integer.parseInt(str[2]);

		if ((a == k && k != n) || (a == n && k != a) || (n == k && k != a)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23124
// #pragma GCC target("avx2")
#pragma GCC optimize("O3", "unroll-loops")

// #include <bits/extc++.h>
// using namespace __gnu_pbds;

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

#define int long long
#define double long double
// template <typename T>
// using pbds_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using pii = pair<int, int>;
template<typename T>
using prior = priority_queue<T, vector<T>, greater<T>>;
template<typename T>
using Prior = priority_queue<T>;

#define X first
#define Y second
#define ALL(x) (x).begin(), (x).end()
#define eb emplace_back
#define pb push_back

#define fastIO() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define RANDOM() random_device __rd; \
                 mt19937 __gen = mt19937(__rd()); \
                 uniform_int_distribution<int> __dis(1, 1E8); \
                 auto rnd = bind(__dis, __gen)

const int INF = 1E18;
const int mod = 1E9 + 7;

int32_t main() {
    fastIO();
    
    int d, goal;
    cin >> d >> goal, goal /= 100;
    
    vector<pii> prob(d);
    for (auto &x : prob) cin >> x.X >> x.Y, x.Y /= 100;
    
    int ans = INF;
    for (int i = 0; i < (1<<d); ++i) {
        int probs = 0, score = 0;
        for (int j = 0; j < d; ++j) {
            if (i >> j & 1) {
                probs += prob[j].X;
                score += prob[j].X * (j + 1) + prob[j].Y;
            }
        }
        for (int j = d-1; j >= 0 and score < goal; --j) {
            if (~i >> j & 1) {
                probs += min(prob[j].X, (goal - score - 1) / (j + 1) + 1);
                score += min(prob[j].X, (goal - score - 1) / (j + 1) + 1) * (j + 1);
            }
        }
        ans = min(ans, probs);
    }
    
    cout << ans << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; --i)
#define INF 1000000000000
#define MOD 1000000007
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) \
    cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3)                                                 \
    cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
         << x3 << endl
#define debug_4(x1, x2, x3, x4)                                             \
    cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
         << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5)                                         \
    cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
         << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                        \
    CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
    (__VA_ARGS__)
#else
#define debug(...)
#endif

using namespace std;
using ll = long long;

int main() {
    string s, t;
    cin >> s >> t;
    int cnt = 0;
    int n = s.size();
    rep(i, n) {
        if (s[i] != t[i]) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3580
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	int N;
	cin >> N;
	ll ans = 0;
	for (int i = 1; i <= N; i++) {
		if (i % 3 != 0 && i % 5 != 0) {
			ans += i;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3636
n = int(input().rstrip())
cnt = 0
flg = False
d_list = [[0, 0] for i in range(n)]
for i in range(n):
  d_list[i] = list(map(int, input().rstrip().split(" ")))
for ds in d_list:
  if ds[0] == ds[1]:
    cnt += 1
  else:
    cnt = 0
  if cnt >= 3:
    flg = True
    break
if flg:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9204
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

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

    string S; cin >> S;
    rep(i,SZ(S)-2){
        if((SZ(S)-i-1)%2) continue;
        string T=S.substr(0,SZ(S)-i-1);
        bool can=true;
        rep(j,SZ(T)/2){
            if(T[j]!=T[SZ(T)/2+j]) can=false;
        }
        if(can){
            cout << SZ(T) << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,r,t;
int main(){
  cin>>n;
  while(n--){
    cin>>r>>t;
    int w=r/100-1;
    int h=t/30;
    int dw=(r%100?2:1);
    int dh=(t%30?2:1);
    for(int y=h;y<h+dh;y++){
      for(int x=w;x<w+dw;x++){
        if(y!=h||x!=w)cout<<' ';
        cout<< y * 5 + x + 1 ;
      }
    }
    cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>

using namespace std;

const int INF = 1000000;

struct node
{
	int num;
	int place;  
};

int partition(node *A,int p,int r)
{
	int j,temp;
	node x;

	x = A[r];
	j = p-1;

	for(int i = p; i < r; i++)
	{
		if (A[i].num <= x.num)
		{
			j++;
			temp = A[i].num;
			A[i].num = A[j].num;
			A[j].num = temp;
		}
	}

	temp = A[j+1].num;
	A[j+1].num = A[r].num;
	A[r].num = temp;

	return j+1;
}

void quicksort(node *A,int p,int r)
{
	int q;

	if (p < r)
	{
		q = partition(A,p,r);
		quicksort(A,p,q-1);
		quicksort(A,q+1,r);
	}
}


int main()
{
	int n,sum,minall,mini,sol,cnt,j;
	node a[1000] = {0},b[1000] = {0};

	sol = 0;
	minall = INF;

	scanf("%d", &n);

	for(int i = 0; i < n; i++)
	{
		scanf("%d", &a[i].num);
		a[i].place = i;
		b[i] = a[i];
		b[i].place = i;

		if (minall > a[i].num)
		{
			minall = a[i].num;
		}
	}

	//cout << "minall = " << minall << endl;

	quicksort(b,0,n-1);

	/*for(int i = 0; i < n; i++)
	{
		cout << b[i].num << " ";
	}

	cout << endl <<endl;
*/
	for(int i = 0; i < n; i++)
	{
		sum = 0;

		if (a[i].num >= 0)
		{
			sum += a[i].num;
			mini = a[i].num;
			cnt = 1;
			j = i;

			while(b[a[j].place].num != a[i].num)
			{
				for(int k = 0; k < n; k++)
				{
					if (a[k].num == b[a[j].place].num)
					{
						j = k;
						sum += a[k].num;
						//cout << " sum =" <<sum << endl;
						cnt++;

						if (mini > a[k].num)
						{
							mini = a[k].num;
						}

						a[k].num = -1;
						break;
					}
				}
			}


			a[i].num = -1;

			sol += min(sum + mini * (cnt -2), sum + mini + (cnt + 1) * minall);

			//cout << "sum1=" << sum + mini * (cnt -2)  << "  sum2=" << sum + mini + (cnt + 1) * minall << endl;

			/*for(int i = 0; i < n; i++)
			{
				cout << a[i].num << " ";
			}
			cout << "sol=" << sol << " " << "cnt=" <<cnt << " mini=" << mini;
			cout << endl <<endl;*/
		}
	}

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


	return 0;
}
	

Measured memory_bytes: 3244
#include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define e "\n"
#define MaRiaMa { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
#define fix(n) cout << fixed << setprecision(n);
using namespace std;
int main()
{
	MaRiaMa;
	int a, b, x;
	cin >> a >> b >> x;
	if (((a -x) <= 0)&&(x-a)-b<=0)
		cout << "YES";
	else
		cout << "NO";
}




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

#define ll long long
#define vi vector<int>
#define vc vector<char>
#define vt vector<string>
#define si set<int>
#define sc set<char>
#define st set<string>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back;

using namespace std;
int main()
{
    ll n;
    cin>>n;
    vector<ll> m(n+1),h(n);
    for(int i=0;i<=n;i++)
        cin>>m[i];
    for(int i=0;i<n;i++)
        cin>>h[i];
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        if(h[i]<=m[i])
            {ans+=h[i];m[i]-=h[i];}
        else
        {
            ans+=m[i];
            h[i]-=m[i];
            m[i]=0;
            if(h[i]>m[i+1])
            {
                ans+=m[i+1];
                m[i+1]=0;
            }
            else
            {
                ans+=h[i];
                m[i+1]-=h[i];
            }
        }
    }
    cout<<ans;
    return 0;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint N, M, S;
typedef pair<lint, lint> P;
using edge = pair<lint, P>;
vector<vector<edge> > G;
vector<lint> c, d;
const lint MAX_MONEY = 2500, INF = 1e18;

void solve(){
	if(S >= MAX_MONEY) S = MAX_MONEY;
	vector<vector<lint> > dist(N, vector<lint> (MAX_MONEY + 1, INF));
	priority_queue<pair<lint, P>, vector<pair<lint, P>>, greater<pair<lint, P>> > que;
	dist[0][S] = 0;
	que.push(make_pair(0, P(0, S)));
	while(que.size()){
		auto p = que.top(); que.pop();
		lint time = p.first, now = p.second.first, money = p.second.second;

		if(dist[now][money] < time) continue;

		if(money + c[now] <= MAX_MONEY){
			lint nmoney = money + c[now];
			lint ntime = time + d[now];
			if(dist[now][nmoney] > ntime){
				dist[now][nmoney] = ntime;
				que.push(make_pair(ntime, P(now, nmoney)));
			}
		} 

	  for(auto e : G[now]){
			if(money < e.second.first) continue;
			lint next = e.first;
			lint nmoney = money - e.second.first;
			lint ntime = time + e.second.second;
			if(dist[next][nmoney] > ntime){
				dist[next][nmoney] = ntime;
				que.push(make_pair(ntime, P(next, nmoney)));
			}
		}
	}

	for(lint x = 1; x < N; x++){
		lint ans = INF;
		for(lint s = 0; s <= MAX_MONEY; s++){
			ans = min(ans, dist[x][s]);
		}
		cout << ans << endl;
	}
}

signed main(){
	cin >> N >> M >> S;
	c.resize(N); d.resize(N); G.resize(N);
	for(lint i = 0; i < M; i++){
		lint u, v, a, b; cin >> u >> v >> a >> b; --u; --v;
		G[u].push_back(edge(v, P(a, b)));
		G[v].push_back(edge(u, P(a, b)));
	}
	for(lint i = 0; i < N; i++) cin >> c[i] >> d[i];
	solve();
}

Measured memory_bytes: 7308
#include <iostream>
using namespace std;
int main(void){
    int x,y,hantei=0;
    cin >> x >> y;
    for(int i=0;i<=x/2;i++){
        if(i*2 + (x-i)*4 == y || i*4 + (x-i)*2 == y) hantei = 1;
    }
    if(hantei == 1) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3624
// acdart
#include <iostream>
#include <cstring>
#include <algorithm>
#include <stdio.h>
#include <cstring>
#include <cmath>
#include <cctype>
#include <string>
#include <numeric>
#include <utility>
#include <queue>
#include <memory>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <cstdlib>
#include <list>
#include <limits.h>
#include <utility>
#include <functional>
#include <iterator>
#include <deque>
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define X first
#define Y second
#define F first
#define S second
#define MOD9 1000000009ll
#define MOD7 1000000007ll
#define MOD
#define INF  1023456789ll
#define INF16 10000000000000000ll
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define SZ(x) ((int)(x).size())
#define MAXN 10010
#define MAXM
#define ALL(x) ((x).begin()),((x).end())
#define RESET(a,b) memset(a,b, sizeof a)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define LEN(X) strlen(X)
#define FI(a,b,c) for(int a=b; a<c; a++)
#define FD(a,b,c) for(int a=b; a>c; a--)
using namespace std;
typedef long long ll;
typedef long long LL;
typedef double db;
typedef double D;
typedef long double ld;
typedef long double LD;
/*********default*********/
// #define ONLINE_JUDGE
ll d[100010];
int main()
{/*
	#ifdef ONLINE_JUDGE
    	freopen("aplusb.in", "r", stdin);
    	freopen("aplusb.out", "w", stdout);
	#endif*/
	int n, x, y;
	ll k;
	
	scanf("%d%lld", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x, &y);
		d[x] += y;
	}
	ll s = 0;
	int loc = 1;
	while (s + d[loc] < k) {
		s += d[loc];
		loc++;
	}
	printf("%d\n", loc);
}


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

ll fastpower (ll b , ll p){
    ll k= p%2 ? b : 1 ;
    return p==0 ? 1 : k*(fastpower(b*b,p/2));
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll h,w;
	cin>>h>>w;
	char a[h][w];
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			cin>>a[i][j];
	ll dp[h][w];
	memset(dp,0,sizeof(dp));
	dp[0][0]=1;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(a[i][j]=='#') continue;
			if(i==0 && j==0) continue;
			if(i==0) dp[i][j]=dp[i][j-1];
			else if(j==0) dp[i][j]=dp[i-1][j];
			else dp[i][j]=(dp[i-1][j]+dp[i][j-1])%1000000007;
		}
	}
	cout<<dp[h-1][w-1]<<"\n";
}

Measured memory_bytes: 12412
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <ctime>

#ifndef _USEFUL_MACROS_
#define _USEFUL_MACROS_
#define INF 99999999
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#endif 

using namespace std;

int main(void){
    
    int n;
    cin >> n;
    vector<int> a(n);
    
    REP(i,n)
        cin >> a[i];
    
    if( n == 1 ){
        cout << a[0] << endl;
        return 0;
    }
    

    for(int i = n-1; i >= 0 ; i-=2 ){
            cout << a[i] << " ";
        }
        
    for(int i = n%2 ; i < n-2 ; i+=2 ){
        cout << a[i] << " ";
    }
    cout << a[n-2] << endl;
    /*
    if( n % 2 == 0 ){
        for(int i = n-1; i >= 0 ; i-=2 ){
            cout << a[i] << " ";
        }
        
        for(int i = 0 ; i < N-2 ; i+=2 ){
            cout << a[i] << " ";
        }
        cout << a[N-2] << endl;
        
    }else{
        for(int i = n-1; i >= 0 ; i-=2 ){
            cout << a[i] << " ";
        }
        
        for(int i = 1 ; i < N-2 ; i+=2 ){
            cout << a[i] << " ";
        }
        cout << a[N-2] << endl;
    }
    */
    
    
    return 0;
}


Measured memory_bytes: 2944
#include<iostream>
using namespace std;
int main() {
	int a, b[] = { 500,100,50,10,5,1 }, ruio = 0;
	cin >> a;
	while (a != 0) {
		a = 1000 - a;
		for (int i = 0; i < 5; i++) {
			ruio += a / b[i];
			a = a%b[i];
		}
		cout << ruio+a << endl;
		cin >> a;
		ruio = 0;
	}
}

Measured memory_bytes: 3060
class Unionfind:
    
    def __init__(self,n):
        self.uf = [-1]*n

    def find(self,x):
        if self.uf[x] < 0:
            return x
        else:
            self.uf[x] = self.find(self.uf[x])
            return self.uf[x]

    def same(self,x,y):
        return self.find(x) == self.find(y)

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return 
        if self.uf[x] > self.uf[y]:
            x,y = y,x
        self.uf[x] += self.uf[y]
        self.uf[y] = x
        

    def size(self,x):
        x = self.find(x)
        return -self.uf[x]

n,m = map(int,input().split())
l = [list(map(int,input().split())) for i in range(m)]
ans = 0

for i in range(m):
    
    u = Unionfind(n)
    for j in range(m):
        if i == j:
            continue
        u.union(l[j][0]-1,l[j][1]-1)
    count = set()
    for j in range(n):
        count.add(u.find(j))
    
    if len(count) > 1:
        ans += 1
print(ans)




    

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	while(1){
		c-=b;
		if(c<=0){
			cout<<"Yes"<<endl;
			return 0;
		}
		a-=d;
		if(a<=0){
			cout<<"No"<<endl;
			return 0;
		}
	} 
}


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

int main(){
  
  // 定義：整数を「 M 」と置く
    int n;
    cin >> n;
    int ans=0;
     
    
    // 反復：整数「 N 」まで繰り返す
    for (int i=1; i<=n; i++){
        
        //判定・計算：対数を調べることで桁数が奇数か偶数か調べることができる。
        // log10(100) = log10(10^2) = 2 ，log10(1004) = log10(10^3 + 4) = 3.01とかになる
        if ((int)log10(i)%2==0) ans++;
    }
     
    cout << ans << endl;
     
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,n,m,ch[100000],s,t;
vector<ll> v[100000];
queue<ll> que;
int main(void){
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>a>>b;
        a--,b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    ch[0]=1;
    que.push(0);
    while(que.size()){
        ll q=que.front();
        que.pop();
        for(ll x:v[q]){
            if(ch[x]!=0){
                if(ch[q]==ch[x]){cout<<n*(n-1)/2-m<<endl;return 0;}
                continue;
            }
            que.push(x);
            if(ch[q]==1)ch[x]=2;
            else ch[x]=1;
        }
    }
    for(int i=0;i<n;i++){
        if(ch[i]==1)s++;
        else t++;
    }
    cout<<s*t-m<<endl;
}


Measured memory_bytes: 7424
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define INF         1e9
#define fastRead    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

const int MAX = 1e6 + 6;
int main()
{
    fastRead;
    int n;
    cin>>n;
    vector<int>vec(n);
    int xxor = 0;
    for(int i =0 ; i < n ; i++ ) {
        cin>>vec[i];
        xxor ^= vec[i];
    }
    
    for(auto x : vec) cout<<(xxor^x)<<" ";
    cout<<'\n';
    return 0;
}

Measured memory_bytes: 3936
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, m, q;
    cin >> n >> m >> q;
    int cnt[n][n] = {};
    rep(i, 0, m) {
        int l, r;
        cin >> l >> r;
        l--;
        r--;
        cnt[l][r]++;
    }

    int sum[n][n + 1] = {};
    rep(i, 0, n) {
        rep(j, 0, n) {
            sum[i][j + 1] = sum[i][j] + cnt[i][j];
        }
    }

    int L[q], R[q];
    rep(i, 0, q) {
        cin >> L[i] >> R[i];
        L[i]--;
        R[i]--;
    }

    rep(i, 0, q) {
        int ans = 0;
        rep(j, L[i], R[i] + 1) {
            ans += sum[j][R[i] + 1] - sum[j][L[i]];
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <fstream>
#include <set>
#include <stack>
#include <queue>
#include <list>
using namespace std;
typedef long long int64;
typedef vector<int> vec;
typedef vector<int64> vec64;
#define db(x) cout << "> " << #x << ": " << x << "\n";
#define ss cout << " ";
#define ct(x) cout << x;
#define nn cout << "\n";
#define cts(x) cout << x << " ";
#define ctn(x) cout << x << "\n";
#define qr queries();
void solve();
void YN(bool b){if (b){ctn("YES");}else{ctn ("NO");}};
void yn(bool b){if (b){ctn("Yes");}else{ctn ("No");}};
void queries(){int n;cin >> n;while (n--)solve();}
// // // // // // // // // // // // // // // // // // // // // // 
/*                  TEMPLATE - VANILLA                         */
// // // // // // // // // // // // // // // // // // // // // //
int64 q, n;

void solve(){

    return;
}


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int a,b;
    cin >> a >> b;
    int rs = 0;
    int fa = 1;
    while (fa < b){
        fa+=a-1;
        rs++;
    }
    ctn(rs);
    return 0;
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
        using namespace std;
        #define ll long long int
        #define pb push_back
        #define mk make_pair
        #define ft first
        #define sc second
        #define ppb pop_back
        #define sz size
        #define forn(i,a,n) for(i=a;i<n;i++)
        #define M 1000000007
        #define inf 2e18
 
        int main() {
 
     
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
            
        ll n,k;
        cin>>n>>k;
        ll ans=0;
        while(n>0){
            // cout<<n<<" ";
            ans++; 
            n/=k;
        }
        cout<<ans;
 
 
        return 0;
        }

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
int d[210][210];
const int MAX_V = 210;
int N;
string S[210];
int color[MAX_V];
// 頂点を1と-1で塗っていく
bool dfs(int v, int c) {
	color[v] = c;
	for (int i = 0; i < N; i++) {
		if (S[v][i] == '0') continue;
		// 隣接している頂点が同じ色ならfalse
		if (color[i] == c) return false;
		// 隣接している頂点がまだ塗られていないなら-cで塗る
		if (color[i] == 0 && !dfs(i, -c)) return false;
	}

	// すべての頂点を塗れたらtrue
	return true;

}

signed main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N;
	rep(i, N) cin >> S[i];
	if (!dfs(0, 1)) {
		cout << -1 << endl;
		return 0;
	}
	rep(i, 210) rep(j, 210) d[i][j] = INF;
	rep(i, N) rep(j, N) {
		if (S[i][j] == '1') d[i][j] = 1;
	}
	rep(k, N) {
		rep(i, N) {
			rep(j, N) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	int ans = 0;
	rep(i, N) {
		rep(j, N) {
			if (i == j) continue; 
			if (d[i][j] != INF) ans = max(ans, d[i][j]);
		}
	}
	cout << ans + 1 << endl;

	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <string.h>
#include <iostream>
using namespace std;
int main()
{
    string a;
    cin >> a;
    std::string str = a;
 
    size_t size = str.length();
 
    for(int i = 0; i<size; i++){
        cout << "x" ;
    }
 
  return 0;
}


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

#define MOD (1000000000+7)
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) x.begin(), x.end()
#define print(vec,l,r) for(int i = l; i <= r; i++) cout << vec[i] <<" "; cout << endl;
#define forf(i,a,b) for(int i = (a); i < (b); i++)
#define forr(i,a,b) for(int i = (a); i > (b); i--)
#define input(vec,N) for(int i = 0; i < (N); i++) cin >> vec[i];

// template starts
typedef long long int ll;

// template ends here

void solve(){
	// code starts from here
	ll X, Y;
	cin >> X >> Y;
	
	if(Y%2 != 0){
		cout << "No" << endl;
		return;
	}
	
	ll Z = Y/2;
	if(Z > 2*X || (2*X - Z) > X) cout << "No" << endl;
	else cout << "Yes" << endl;
}

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

	int T;
	T = 1;
	while(T--){
		solve();
	}

	return 0;
}


Measured memory_bytes: 3652
#include<iostream>

using namespace std;

int main() {
    int x;
    cin >> x;
    x %= 10;
    if (x == 3) cout << "bon" << endl;
    else if(x == 0 || x == 1 || x == 6 || x == 8) cout << "pon" << endl;
    else cout << "hon" << endl;
}


Measured memory_bytes: 3632
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *
 
n = INT()
S = [input() for _ in range(n)]

dic = defaultdict(int)

for x in S[0]:
	dic[x] += 1

for i in range(1, n):
	S_dic = Counter(S[i])
	for key, value in dic.items():
		if S_dic[key] > 0:
			dic[key] = min(dic[key], S_dic[key])
		else:
			dic[key] = 0
		
ans = ""
for key, value in dic.items():
	ans += key*value

print(*sorted(ans), sep="")


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

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

template<class T> using v = std::vector<T>;
template<class T> using vv = v<v<T>>;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


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

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

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int dp[3005][3005];

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

    string s, t, res; cin >> s >> t;
    rep(i,s.size()) rep(j, t.size()) dp[i][j] = 0;
    rep(i,s.size()) rep(j, t.size())
    {
        if (s[i] == t[j]) chmax(dp[i+1][j+1], dp[i][j] + 1);
        chmax(dp[i+1][j+1], dp[i+1][j]);
        chmax(dp[i+1][j+1], dp[i][j+1]);
    }
    int i = s.size(), j = t.size();
    while (i > 0 && j > 0)
    {
        if (dp[i][j] == dp[i-1][j]) --i;
        else if (dp[i][j] == dp[i][j-1]) --j;
        else
        {
            res = s[i-1] + res;
            --i, --j;
        }
    }

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


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




    int main(){
        int n;
        std::cin >> n;
        std::vector<int> p(n);
        rep(i ,n) std::cin >> p[i];
        int k = 0;
        rep(i ,n) if(p[i] != i + 1) k++;
        if (k <= 2) 
        {
            /* code */std::cout << "YES" << "\n";
        }
        else std::cout << "NO" << "\n";
        return 0;
    }


Measured memory_bytes: 256
fun main(args: Array<String>) {
    val nd = readLine()!!.split(" ").map { it.toInt() }
    val x = mutableListOf<List<Int>>()
    for (i in 0 until nd[0]){
        x.add(readLine()!!.split(" ").map { it.toInt() })
    }
    var count = 0
    for (i in 0 until nd[0]){
        for (j in i+1 until nd[0]){
            var tmp = 0
            for (k in 0 until nd[1]){
                tmp += (x[i][k] - x[j][k])*(x[i][k] - x[j][k])
            }
            var tmp1 = Math.sqrt(tmp.toDouble())
            if (tmp1.toInt().toDouble() == tmp1)count++
        }
    }
    println(count)
}


Measured memory_bytes: 37872
#include <bits/stdc++.h> //library
#define rep(i, n) for(int i = 0; i < (int)(n); i++) //for-loop (from 0)
#define reps(i,n) for(int i = 1; i <= (int)(n); i++) //for-loop (from 1)
#define all(x) (x).begin(),(x).end() //start-to-end iteration, mainly in upper_bound, lower_bound
#define SZ(x) ((int)(x).size()) //unsigned to signed

using namespace std;
using ll = long long; //long long
ll M = 1000000000 + 7;
const ll INF = 1LL << 60;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; } //compare a,b and replace by greater
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; } //compare a,b and replace by smaller
ll qp(int a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; } //power
ll qp(int a, ll b, ll Mod) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%Mod; a = 1ll * a*a%Mod; } while (b >>= 1); return ans; } //power(mod)
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; } //gcd
int dx[4] = { 1,0,-1,0 }; //path
int dy[4] = { 0,1,0,-1 }; //path
ll RS(ll N, ll P) { if (P == 0)return 1; else if (P % 2 == 0) { ll sq = RS(N, P / 2); return sq*sq; } else { return N*RS(N, P - 1); } } //power(repeat-square,fast)
ll nPr(ll n, ll r) { ll ans = 1; rep(i, r) { ans = ans * (n - i); } return ans; } //permutation
ll nCr(ll n, ll r) { ll bunbo = 1; ll bunshi = 1; rep(i, r) { bunbo = bunbo * (i + 1); bunshi = bunshi * (n - i); } return bunshi / bunbo; } //combination
ll RS(ll N, ll P, ll Mod) { if (P == 0)return 1; else if (P % 2 == 0) { ll sq = RS(N, P / 2, Mod); return sq*sq%Mod; } else { return N*RS(N, P - 1, Mod) % Mod; } } //power(mod)(repeat-square,fast)
ll nPr(ll n, ll r, ll Mod) { ll ans = 1; rep(i, r) { ans = ans * (n - i) % Mod; } return ans; } //permutation
ll nCr(ll n, ll r, ll Mod) { ll bunbo = 1; ll bunshi = 1; rep(i, r) { bunbo = bunbo * (i + 1) % Mod; bunshi = bunshi * (n - i) % Mod; } return bunshi * RS(bunbo, Mod - 2, Mod) % Mod; } //combination

ll dp[1010][20200]; // dp[i][h]:i+1番目までの魔法を使って体力をh減らすのに必要な最小魔力

int main(void) {
  int H,N; cin >> H >> N;
  vector<int> a(N),b(N);
  int max_A = 0;
  rep(i,N){
    cin >> a[i] >> b[i];
    chmax(max_A,a[i]);
  }
  rep(i,1010) rep(h,20200) dp[i][h]=INF;
  
  dp[0][0] = 0;
  
  rep(i,N){
    rep(h,H+max_A+1){
      if (h-a[i] > 0) dp[i+1][h] = min(dp[i][h], dp[i+1][h-a[i]]+b[i]);
      else dp[i+1][h] = min(dp[i][h], dp[i+1][0]+b[i]);
    }
  }
  
  cout << dp[N][H] << "\n";
  
  return 0;
}

Measured memory_bytes: 159616
import math
N=int(input())
def F(a,b):
    al = len(str(a))
    bl = len(str(b))
    if al < bl:
        return bl
    else:
        return al

min = 10
for A in range(1,int(math.sqrt(N))+1):
    if N % A == 0:
        B = N // A
        f = F(A,B)
        if f < min:
            min = f
print(f)

Measured memory_bytes: 3060