akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std ;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
typedef long long ll ;

/*
  ll n , m ;
  cin >> n >> m ;
  ll a , b , c ;
  cin >> a >> b >> c ;
  vector<ll> A(n) ;
  cout << "Yes" << endl ;
  cout << "No"  << endl ;
*/

int main(){
  ll a , b , c ;
  cin >> a >> b >> c ;
  ll k ;
  cin >> k ;
  for (ll i = 0 ; i <= k ;i++ ){
    ll c_new = c ;
   	ll b_new = b ;
    for(ll j = 0 ; j < i ;j++) c_new *= 2 ;
    for(ll l = 0 ; l < k-i ;l++) b_new *= 2 ;
    if( c_new > b_new && b_new > a ){
      cout << "Yes" << endl ;
      return 0 ;
    }
    //cout << a << ' ' << b_new << ' ' << c_new << endl;
  }
  cout << "No"  << endl ;
}


Measured memory_bytes: 3636
k = int(input())
def f(n):
	num,ans = n/sum([int(i) for i in str(n)]),n
	for i in range(len(str(n))+1):
		x = (10**(i+1))*(n//(10**(i+1))+1)-1
		y = x/sum([int(j) for j in str(x)])
		if num>y: ans,num = x,y
	return ans
n = 0
for _ in range(k):
	n = f(n+1)
	print(n)

Measured memory_bytes: 3188
n = int(input())

ans = 0
for a in range(1,int(n**(1/2)+1)):
  tmp = 0
  if (a**2) == n:
    break
  elif n%a == 0:
    tmp += ((n//a)-1-a)*2
    tmp += 1
  elif (a * (n//a)) < n:
    tmp += (n//a-a)*2
    tmp += 1
  #print(tmp)
  ans += tmp
print(ans)



Measured memory_bytes: 9444
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
	int wg[10];
	wg[9]=1;
	for(int i=8;i>=0;i--){
		wg[i]=wg[i+1]*2;
	}
	int n;
	while(scanf("%d",&n)!=EOF){
		vector<int> res;
		for(int i=0;i<10;i++){
			if(n-wg[i]>=0){
				n-=wg[i];
				res.push_back(wg[i]);
			}
		}
		sort(res.begin(),res.end());
		printf("%d",res[0]);
		for(int i=1;i<res.size();i++){
			printf(" %d",res[i]);
		}
		printf("\n");
	}
}

Measured memory_bytes: 3064
#ifdef loc
    #include "../codes/loc_debug.h"
#else
    #include <bits/stdc++.h>
    #define pr(...)
    #define pra(a,n)
    #define praa(a,n,m)
    #define prl()
#endif
using namespace std;

typedef long long ll;
#define sz(a) int(a.size())
const int N = 100005;



int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    int maxd = 0;
    map<int, int> b;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        maxd = max(maxd, a[i]);
        b[a[i]]++;
    }
    int res = 1;
    int mod = 998244353;
    for(int i = 1; i <= maxd; i++) {
        for(int j = 1; j <= b[i]; j++) {
            res = int((res * (ll)b[i - 1]) % mod);
        }
    }
    if(b[0] != 1 || a[0] != 0) {
        res = 0;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 5376
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define int long long
#define F(i,L,R) for(int i=L;i<R;++i)
#define FE(i,L,R) for(int i=L;i<=R;++i)
#define getI(a) scanf("%lld",&a)
#define getII(a,b) scanf("%lld%lld",&a,&b)
#define getIII(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define VgetI(n) int (n); scanf("%lld",&(n))
#define VgetII(n,m) int (n),(m); scanf("%lld%lld",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%lld%lld%lld",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define qq cout<<"QQ\n";
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define INF 2000000000
int n,a[1000005];
set<int> appear;
bool decompose(int x){
	for(int i=2;i*i<=x;i++) if(x%i==0){
		if(appear.find(i)!=appear.end()) return 0;
		while(x%i==0) x/=i;
		appear.insert(i);
	}
	if(x!=1){
		if(appear.find(x)!=appear.end()) return 0;
		appear.insert(x);
	}
	return 1;
}
main(){
	while(~getI(n)){
		appear.clear();
		F(i,0,n) getI(a[i]);
		bool pairwise=1;
		int gcdOfAll=a[0];
		F(i,1,n) gcdOfAll=__gcd(gcdOfAll,a[i]);
		F(i,0,n){
			bool ok=decompose(a[i]);
			if(!ok){
				pairwise=0;
				break;
			}
		}
		if(pairwise&&gcdOfAll==1) puts("pairwise coprime");
		else if(gcdOfAll==1) puts("setwise coprime");
		else puts("not coprime");
	}
}

Measured memory_bytes: 11508
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
struct sw {
	int h;
	int l;
	int r;
};

int main() {
	int H, W, N; cin >> H >> W >> N;
	vector<sw>sws;
	for (int i = 0; i < N; ++i) {
		int a, b; cin >> a >> b;
		a--;
		int h = a;
		a %= (2 * W);
		int nl = b - 1; int nr = b;
		{
			int rest_h = a;
			if (nl >= rest_h - 1) {
				nl -= rest_h;
				nl = max(0, nl);
			}
			else {
				rest_h -= nl + 1;
				nl = 0;
				if (rest_h > W) {
					rest_h -= W;
					nl = W - 1;
					nl -= rest_h;
				}
				else {
					nl = rest_h;
					nl = min(W - 1, nl);
				}
			}
		}
		{
			int rest_h = a;
			if (W - nr >= rest_h) {
				nr += rest_h;
				nr = min(nr, W - 1);
			}
			else {
				rest_h -= (W - nr);
				nr = W - 1;
				if (rest_h > W - 1) {
					rest_h -= W;
					nr = 0;
					nr += rest_h;
				}
				else {
					nr = W - rest_h - 1;
					nr = max(nr, 0);
				}
			}
		}
		sws.emplace_back(sw{ h,nl,nr });
	}
	sort(sws.begin(), sws.end(), [](const sw&l, const sw&r) {
		return l.h < r.h;
	});
	vector<int>vs(W);
	iota(vs.begin(), vs.end(), 0);
	for (auto s : sws) {
		swap(vs[s.l], vs[s.r]);
	}
	vector<int>sw(W);
	for (int i = 0; i < W; ++i) {
		if (i % 2==0) {
			 int n = i;
			int rest_h = H;
			rest_h %= 2 * W;
			if (W - n >= rest_h) {
				n += rest_h;
				n = min(n, W - 1);
			}
			else {
				rest_h -= (W - n);
				n = W - 1;
				if (rest_h > W - 1) {
					rest_h -= W;
					n = 0;
					n += rest_h;
				}
				else {
					n = W - rest_h-1;
					n = max(n, 0);
				}
			}
			sw[i] = n;
		}
		else {
			int n = i;
			int rest_h = H;
			rest_h %= 2*W;
			if (n >= rest_h-1) {
				n -= rest_h;
				n = max(n, 0);
			}
			else {
				rest_h -= n+1;
				n= 0;
				if (rest_h > W) {
					rest_h -= W;
					n = W - 1;
					n -= rest_h;
				}
				else {
					n = rest_h;
					n = min(W - 1, n);
				}
			}
			sw[i] = n;
		}
	}
	vector<int>anss(W);
	for (int i = 0; i < W; ++i) {
		anss[i] = sw[vs[i]];
	}
	vector<int>revvs(W);
	for (int i = 0; i < W; ++i) {
		revvs[vs[i]] = i;
	}
	for (int i = 0; i < W; ++i) {
		anss[i] = sw[revvs[i]];
	}
	for (auto v : anss) {
		cout << v + 1 << endl;
	}
	return 0;
}

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

#define rep(i, n)  for (int i = 0; i < (int) (n); i++)
#define Rrep(i, n) for (int i = ((int) n - 1); i >= 0; i--)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
#define INF 2e15
#define MOD 10e9 + 7

typedef vector <int> vint;
typedef long long    ll;



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

    string s;
    cin >> s;

    if (s == "RRR") { cout << "3" << endl; }
    else if (s == "RRS" || s == "SRR") { cout << "2" << endl; }
    else if (s == "RSS" || s == "SRS" || s == "SSR" || s == "RSR") { cout << "1" << endl; }
    else { cout << "0" << endl; }

    return 0;
}


Measured memory_bytes: 3652
# -*- coding: utf-8 -*-

N, K = map(int, raw_input().split())
S = raw_input()

_ans = str()

if S[K-1] == "A":
    _ans = S[:K-1]+"a"+S[K:]
elif S[K-1] == "B":
    _ans = S[:K-1]+"b"+S[K:]
elif S[K-1] == "C":
    _ans = S[:K-1]+"c"+S[K:]

print _ans

Measured memory_bytes: 2568
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		rectangle();

	}
	
	public static void rectangle() {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		System.out.println(a * b + " " + (a + b) * 2);
	}
}


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

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

    int H, W;
    cin >> H >> W;
    vector<string> a(H);
    REP(i, H) cin >> a[i];
    vector<int> cnt(26);
    REP(i, H) {
        REP(j, W) {
            cnt[a[i][j] - 'a']++;
        }
    }
    int g1, g2, g4;
    if (H % 2 == 0 && W % 2 == 0) {
        g1 = g2 = 0;
        g4 = (H / 2) * (W / 2);
    } else if (H % 2 == 1 && W % 2 == 0) {
        g1 = 0;
        g2 = W / 2;
        g4 = (H / 2) * (W / 2);
    } else if (H % 2 == 0 && W % 2 == 1) {
        g1 = 0;
        g2 = H / 2;
        g4 = (H / 2) * (W / 2);
    } else {
        g1 = 1;
        g2 = H / 2 + W / 2;
        g4 = (H / 2) * (W / 2);
    }
    vector<int> c(4);
    REP(i, 26) {
        c[cnt[i] % 4]++;
    }
    if (c[1] + c[3] != g1) cout << "No" << endl;
    else if (c[2] + c[3] > g2) cout << "No" << endl;
    else cout << "Yes" << endl;
}

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

using namespace std;

int main(){
  string a,b;
  cin >> a >> b;
  int concat = stoi(a+b);
  
  int i=1;
  bool res = false;
  while(i*i<=concat){
    res = res | (concat == i*i);
    i++;
  }
  if(res){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
using namespace std;
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 MAX = 500;
const int INF = 1<<29;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int dp[MAX][MAX];

int main() {
    int H, W;
    cin >> H >> W;
    vector<string> s(H);
    for (int i = 0; i < H; ++i) cin >> s[i];
    auto id = [&](int x, int y) { return x * W + y; };

    // 初期化
    for (int i = 0; i < MAX; ++i) {
        for (int j = 0; j < MAX; ++j) dp[i][j] = INF;
        dp[i][i] = 0; // これを忘れないように
    }

    // make graph
    for (int x = 0; x < H; ++x) {
        for (int y = 0; y < W; ++y) {
            if (s[x][y] == '#') continue;
            for (int dir = 0; dir < 4; ++dir) {
                int nx = x + dx[dir], ny = y + dy[dir];
                if (nx < 0 || nx >= H || ny < 0 || ny >= W || s[nx][ny] == '#')
                    continue;
                dp[id(x, y)][id(nx, ny)] = 1;
                dp[id(nx, ny)][id(x, y)] = 1;
            }
        }
    }

    // Floyd--Warshall
    int V = H*W;
    for (int k = 0; k < V; ++k)
        for (int i = 0; i < V; ++i)
            for (int j = 0; j < V; ++j)
                chmin(dp[i][j], dp[i][k] + dp[k][j]);

    int res = 0;
    for (int x = 0; x < H; ++x) {
        for (int y = 0; y < W; ++y) {
            if (s[x][y] == '#') continue;
            for (int x2 = 0; x2 < H; ++x2) {
                for (int y2 = 0; y2 < W; ++y2) {
                    if (s[x2][y2] == '#') continue;                 
                    chmax(res, dp[id(x, y)][id(x2, y2)]);
                }
            }
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
struct uf{
	int par[200005],ran[200005],sum[200005];
	void init(){
		rep(i,200005) { par[i] = i,ran[i] = 0,sum[i] = 0; }
	}
	int find(int x){
		if(x == par[x]) return x;
		else return par[x] = find(par[x]);
	}
	void unite(int x,int y){
		x = find(x); y = find(y);
		if(x == y) return;
		if(ran[x] < ran[y]){
			par[x] = y;
			sum[y] += sum[x];
		}
		else{
			par[y] = x;
			sum[x] += sum[y];
		}
	}
}kaede;
int n,h,w;
vector<P1>vec;
int main(){
	scanf("%d%d%d",&n,&h,&w);
	for(int i=1;i<=n;i++){
		int r,c,a; scanf("%d%d%d",&r,&c,&a);
		vec.pb(mp(-a,mp(r,100000+c)));
	}
	SORT(vec);
	ll ans = 0;
	kaede.init();
	for(int i=0;i<vec.size();i++){
		int x = vec[i].sc.fi , y = vec[i].sc.sc;
		if(kaede.find(x) != kaede.find(y)){
		    if(kaede.sum[kaede.find(x)] + kaede.sum[kaede.find(y)] <= 1){
    			kaede.unite(x,y);
    			ans -= vec[i].fi;
		    }
		}
		else if(kaede.sum[kaede.find(x)] == 0){
			kaede.sum[kaede.find(x)]++;
			ans -= vec[i].fi;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 4212
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        var N = int.Parse(ReadLine());
        var S = ReadLine();
        var K = int.Parse(ReadLine()) - 1;
        var ans = Enumerable.Repeat('*', N).ToArray();
        for (int i = 0; i < N; i++)
        {
            if (S[i] == S[K]) ans[i] = S[K];
        }
        //var X = ReadLine().Split().Select(int.Parse).ToArray();
        WriteLine(new string(ans));
    }
}



Measured memory_bytes: 13268
#include <iostream>

using namespace std;
int main(){
	int i,j,n;
	cin >> n;
	for(i=1;i<=9;i++){
		for(j=1;j<=9;j++){
			if(i*j==n){
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
using R = double;
using Data = pair < ll, vector <ll>>;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
struct edge { ll from; ll to; ll cost; };
typedef pair<ll, ll>pll;
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)
#define INF INT_MAX/2

ll dp[2020][2020];
int main() {
	ll N, M;
	cin >> N >> M;
	vector<ll>S(N), T(M);
	rep(i, 0, N)cin >> S[i];
	rep(i, 0, M)cin >> T[i];

	dp[0][0] = 1;
	rep(i, 0, 2020)dp[i][0] = 1;
	rep(j, 0, 2020)dp[0][j] = 1;
	rep(i, 1, N+1)rep(j, 1, M+1) {
		if (S[i-1] == T[j-1]) {
			dp[i][j] += dp[i - 1][j - 1];
		}
		dp[i][j] += dp[i - 1][j] + dp[i][j-1];
		dp[i][j] -= dp[i - 1][j - 1];
      	dp[i][j] += MOD;
		dp[i][j] %= MOD;
	}
	cout << dp[N][M] % MOD << endl;

	return 0;
}

Measured memory_bytes: 31872
s=input()
A=[]
d=s[0]
for i in range(2**(len(s)-1)):
    v=[]
    for j in range(len(s)-1):
        if ((i>>j)&1):
            v.append('+')
        else:
            v.append('-')
    A.append(v)

for i in range(len(A)):
    c=int(s[0])
    for j in range(3):
        if A[i][j]=='+':
            c+=int(s[j+1])
        else:
            c-=int(s[j+1])
    if c==7:
        for j in range(3):
            d+=A[i][j]+s[j+1]
        print(d+'=7')
        exit()

Measured memory_bytes: 9168
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>

using namespace std;

template<typename T>
T m(T a, T b) { return a > b ? a : b; }

vector<int> v(5001);

int main(void) {
    int N;
    while(true) {
        cin >> N;
        if(N == 0) break;

        for(int i = 0; i < N; i++) cin >> v[i];

        long long mx = -100000L;

        for(int i = 0; i < N; i++) {
            long long tmp = 0L;
            for(int j = i; j < N; j++) {
                tmp += v[j];
                mx = m(mx, tmp);
            }
        }
        cout << mx << endl;
    }
    return 0;
}

Measured memory_bytes: 0
/*
    Created by Ezio112
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef vector<ll> vll;
ll inf(1e18);
#define mod ll(1e9+7)
//#define mod ll(998244353)
#define ff first
#define ss second
ll power(ll a,ll b)
{
	if(!b)
		return 1;
	ll dp=power(a,b/2)%mod;
	
	if(b&1) return (((dp*dp)%mod)*a)%mod;
	
	return (dp*dp)%mod;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll test=1;
    //cin>>test;

    while(test--)
    {
		ll x,n;
		cin>>x>>n;
		set<ll> dp;
		
		for(ll i=0;i<n;++i)
		{
			ll num;
			cin>>num;
			dp.insert(num);
		}
		ll mn=-1;
		for(ll i=-1;i<102;++i) if(dp.count(i)==0)
		{
			if(abs(x-mn)>abs(x-i))
			{
				mn=i;
			}
		}
		cout<<mn;
	}
	return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int a[20][20],v[20],n;
ll f[65540],sum[65540];
int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)scanf("%d",&a[i][j]);
    for(int i=0;i<(1<<n);i++){
        int num=0;
        for(int j=0;j<n;j++)
            if(i>>j&1)v[++num]=j;
        ll ss=0;
        for(int j=1;j<=num;j++){
            for(int k=j+1;k<=num;k++)ss+=a[v[j]][v[k]];
        }
        f[i]=sum[i]=ss;
    }
    for(int j=0;j<(1<<n);j++){
        for(int i=j;i;i=(i-1)&j)f[j]=max(f[j],f[i^j]+sum[i]);
    }
    printf("%lld\n",f[(1<<n)-1]);
    return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;



int main()
{
	string S, T, U;
	int A, B;

	cin >> S >> T >> A >> B >> U;

	if (S == U) A--;
	else if (T == U) B--;

	cout << A << ' ' << B << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int i;
  cin>>s;
  for(i=0;i<s.length();i++){
    if((i+1)%2==1 && s.at(i)=='L') break;
    else if((i+1)%2==0 && s.at(i)=='R') break;
  }
  if(i==s.length()) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;
ll mpow(ll a, ll b) { ll r = 1; a %= mod; while (b) { r = r * ((b % 2) ? a : 1) % mod, a = a * a % mod, b >>= 1; }return r; }



int main() {
	int n; cin >> n;
	vector<int> a(n), b(n);
	rep(i, 0, n) cin >> a[i];
	rep(i, 0, n) cin >> b[i];
	ll sum1 = 0, sum2 = 0;
	rep(i, 0, n) {
		if (a[i] > b[i]) sum1 += a[i] - b[i];
		else sum2 += (b[i] - a[i]) / 2;
	}
	if (sum1 > sum2)printf("No");
	else printf("Yes");
	return 0;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main() {
	char c;
	while (cin.get(c)){
		if (c == 'a')cout.put('A');
		else if (c == 'b')cout.put('B');
		else if (c == 'c')cout.put('C');
		else if (c == 'd')cout.put('D');
		else if (c == 'e')cout.put('E');
		else if (c == 'f')cout.put('F');
		else if (c == 'g')cout.put('G');
		else if (c == 'h')cout.put('H');
		else if (c == 'i')cout.put('I');
		else if (c == 'j')cout.put('J');
		else if (c == 'k')cout.put('K');
		else if (c == 'l')cout.put('L');
		else if (c == 'm')cout.put('M');
		else if (c == 'n')cout.put('N');
		else if (c == 'o')cout.put('O');
		else if (c == 'p')cout.put('P');
		else if (c == 'q')cout.put('Q');
		else if (c == 'r')cout.put('R');
		else if (c == 's')cout.put('S');
		else if (c == 't')cout.put('T');
		else if (c == 'u')cout.put('U');
		else if (c == 'v')cout.put('V');
		else if (c == 'w')cout.put('W');
		else if (c == 'x')cout.put('X');
		else if (c == 'y')cout.put('Y');
		else if (c == 'z')cout.put('Z');
		else if (c == 'A')cout.put('a');
		else if (c == 'B')cout.put('b');
		else if (c == 'C')cout.put('c');
		else if (c == 'D')cout.put('d');
		else if (c == 'E')cout.put('e');
		else if (c == 'F')cout.put('f');
		else if (c == 'G')cout.put('g');
		else if (c == 'H')cout.put('h');
		else if (c == 'I')cout.put('i');
		else if (c == 'J')cout.put('j');
		else if (c == 'K')cout.put('k');
		else if (c == 'L')cout.put('l');
		else if (c == 'M')cout.put('m');
		else if (c == 'N')cout.put('n');
		else if (c == 'O')cout.put('o');
		else if (c == 'P')cout.put('p');
		else if (c == 'Q')cout.put('q');
		else if (c == 'R')cout.put('r');
		else if (c == 'S')cout.put('s');
		else if (c == 'T')cout.put('t');
		else if (c == 'U')cout.put('u');
		else if (c == 'V')cout.put('v');
		else if (c == 'W')cout.put('w');
		else if (c == 'X')cout.put('x');
		else if (c == 'Y')cout.put('y');
		else if (c == 'Z')cout.put('z');
		else cout.put(c);
	}
	cin >> c;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rep3(i, m, n) for(ll i=m;i<=(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000
#define LLINF 1000000000000000000

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const ll mod = MOD;
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 {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= 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 {
		mint res(*this);
		return res /= a;
	}
};

ll dp[100005];

void solve_abc_d() {
	ll n, k;
	ll l_ans = 0;

	cin >> n >> k;
	V h(n+1);
	rep(i, n) cin >> h[i+1];

	rep1(i, n) dp[i] = INF;
	
	dp[1] = 0;
	rep1(i, n) {
		rep1(j, k) {
			if (i - j >= 1) {
				chmin(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
			}
		}
	}

	cout << dp[n] << "\n";

	return;
}

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

	solve_abc_d();

	return 0;
}


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

const int MAX = 1000000;
const int MOD=1000000007;

int main() {
  int N;
  cin >> N; 
  vector<string>A;
  vector<string>B;
  vector<string>AB;
  
  int sum = 0;
  rep(i,N){
    string s;
    cin >> s;
    rep(j,s.size()-1){
      if(s[j] == 'A' &&  s[j+1] == 'B') sum++;
    }
    if (s[0] == 'B' && s[s.size()-1] == 'A') AB.push_back(s);
    else if (s[0] == 'B') B.push_back(s);
    else if (s[s.size()-1] == 'A') A.push_back(s);
    else continue;
  }
  int L_AB = AB.size();
  int L_A = A.size();
  int L_B = B.size();
  sum += max(0, L_AB-1);
  if(L_AB){
    bool flag_A = true;
    bool flag_B = true;
    if(L_A){
      sum++;
      flag_B = false;
    }
    if(L_B){
      sum++;
      flag_A = false;
    }
    L_A--;
    L_B--;
    if(L_A>0 && L_B>0) sum += min(L_A,L_B);
    else if(L_A>0 && flag_B) sum ++;
    else if(L_B>0 && flag_A) sum ++;
  }
  else sum += min(L_A,L_B);
  
  cout << sum << endl;      
}

Measured memory_bytes: 768
import java.io.InputStream;
import java.util.Scanner;

public class Main {
  public static void main(String[] args){
    System.out.println(new Main().excute(System.in)); 
  }
  public String excute(InputStream f) {
    Scanner scan = new Scanner(f);
    int A1  = scan.nextInt();
    int A2  = scan.nextInt();
    int A3  = scan.nextInt();
    
    if ((A1+A2+A3) >= 22)  {
      return "bust";
    }
    return  "win";
  }
}


Measured memory_bytes: 22996
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

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


const long long int mod = 998244353;
const long long int INF = 1e18;

long long int a,b,h;



int main()
{
    cout << fixed << setprecision(18);
    cin>>a>>b>>h;
    cout<<(a+b)*h/2<<endl;
}


Measured memory_bytes: 256
local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local mab = math.abs
local mod = 1000000007
local n, m = io.read("*n", "*n")
local curpos = 0

local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end

local function calcfibo(len)
  local a, b = 0, 1
  for i = 1, len do
    a, b = b, (a + b) % mod
  end
  return b
end

local ret = 1
for i = 1, m do
  local anapos = io.read("*n")
  if anapos == curpos then
    ret = 0
    curpos = n
  elseif curpos < anapos then
    local len = (anapos - 1) - curpos
    local fibo = calcfibo(len)
    ret = bmul(ret, fibo)
    curpos = anapos + 1
  end
end
if curpos < n then
  local len = n - curpos
  ret = bmul(ret, calcfibo(len))
end
print(ret)


Measured memory_bytes: 256
n,m = [int(i) for i in input().split()]
a = list(map(int,input().split()))

import sys
sys.setrecursionlimit(50000)

match = [0,2,5,5,4,5,6,3,7,6]

dig = [0] * (n+1)

inf = 10**9


for i in range(1, n + 1):
    lst = []
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if bef >= 0:
            if bef == 0:
                lst.append(dig[bef])
            else:
                if dig[bef] > 0:
                    lst.append(dig[bef])
        if lst:
            dig[i] = max(lst) + 1


ans = ""


def dp(i):
    k = -1
    if i == 0:
        return
    global ans
    maxi = 0
    for j in range(len(a)):
        num = a[j]
        mat = match[num]
        bef = i - mat
        if dig[i] == 1:
            if bef == 0:
                maxi = max(maxi, num)
                k = 0
        else:
            if bef >= 0:
                if dig[bef] == dig[i] - 1:
                    if num > maxi:
                        maxi = num
                        k = bef
    ans += str(maxi)
    if k >= 0:
        dp(k)


dp(n)
print(ans)

Measured memory_bytes: 7768
import itertools as it


def main():
    N = int(input())
    ans = {n:[] for n in range(1,N+1)}


    for x in range(1, 110):
        if x**2 + 2*x> N:
            break
        
        for y in range(1, x+1):
            if x**2 + y**2 > N:
                break
            for z in range(1, y+1):
                t = x*x + y*y + z*z + x*y + y*z + z*x
                if t > N:
                    break
                ans[t].append((x, y, z))
        
    for v in ans.values():
        num = 0
        for x, y, z in v:
            if x == y and y == z:
                num += 1
            elif x == y or y == z or z == x:
                num += 3
            else:
                num += 6
        
        print(num)


if __name__ == '__main__':
    main()

Measured memory_bytes: 73832
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    var n = sc.nextInt()

    while (!judge(n)) {
        n++
    }
    println(n)
}

fun judge(n: Int): Boolean {
    val s = n.toString()
    return s.filter { it == s[0] }.length == s.length
}


Measured memory_bytes: 31140
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<=(end);i++)
#define REP(i, n) FOR(i,1,n)
#define IFOR(i, begin, end) for(int i=(end);i>=(begin);i--)
#define IREP(i, n) IFOR(i,1,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())

#define ll long long
using namespace std;

bool is_prime(int k)
{
    for(int j=2;j*j<=k;j++){
        if(k%j==0) {
            return false;
        }
    }
    return true;
}

int main()
{
	string S;
    cin>>S;
    int s = atoi(S.c_str());
    int s2=s%100;
    int s1=s/100;
    string ans;
    if(s2<=12 && s1<=12 && s1>=1 && s2>=1) ans="AMBIGUOUS";
    else {
        if(s1<=12&& s1>=1) ans="MMYY";
        else if(s2<=12&& s2>=1) ans="YYMM";
        else ans="NA";
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <iomanip>
#include <cstdlib>
#include <climits>
using namespace std;

//関数getinputdata宣言
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();

void abc124_a(vector<vector<int>> v) {

    int a = v[0][0];
    int b = v[0][1];

    int mysum = 0;

    if (a >= b) {

        mysum += a;
        a -= 1;
    } else {

        mysum += b;
        b -= 1;
    }
    
    mysum+=max(a,b);


    cout << mysum << endl;





}

int main() {

    //    vector<vector < string>> vec_arr_result;
    vector<vector<int>> vec_arr_result;
    vec_arr_result = getinputdata2();

    abc124_a(vec_arr_result);

    return 0;
}

//関数getinputdata実装

vector<vector<double>> getinputdata3() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<double>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<double> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atof(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;
}

//関数getinputdata実装

vector<vector<int>> getinputdata2() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<int>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<int> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atoi(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;


}

//関数getinputdata実装

vector<vector < string >> getinputdata() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector < string>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<string> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(ret);
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;

}


Measured memory_bytes: 256
# D - Div Game
import bisect

N = int(input())

arr = [1] * 50
for i in range(2, 50):
    arr[i-1] = arr[i-2]+i

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

primes = prime_factorization(N)

ans = 0
if N != 1:
    for p, ex in primes:
        ans += bisect.bisect_right(arr, ex)

print(ans)

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

using namespace std;

const int INF = 1e6;

int main(){
 int K,X; cin >> K >> X;
  if( X - ( K - 1) < -INF){ 
    int m = -INF;
    for(int i = 0 ; i < X + K + INF; i++){
      cout << m << " "; m++;}
    cout << endl;
  }
  
  else if( X + ( K - 1) > INF){
    int m = X - ( K - 1);
    while( m <= INF){
      cout << m << " "; m++;}
    cout << endl;}
  
  else{
    
    for(int i = X - ( K - 1) ; i <= X + ( K - 1); i++){
      cout << i << " " ;}
    cout << endl;}
  
  return 0;}


Measured memory_bytes: 384
a, b = map(int, input().split())

def s(x):
    xbin = bin(x)[2:]
    l = len(xbin)
    tmp = 0
    for i in range(l):
        if i != l - 1:
            rem = x % (2 ** (l - i))
            rem2 = rem - (2 ** (l - i - 1))
            # print(l - i, rem2)
            if rem2 >= 0 and rem2 % 2 == 0:
                tmp += 2 ** (l - i - 1)
        else:
            rem = x % 4
            if rem in [1, 2]:
                tmp += 1
    return tmp

print(s(a - 1) ^ s(b))


Measured memory_bytes: 3064
#include<stdio.h>

int main(void){
  int a[10];
  int i,x,n,s=0,m=0;

  scanf("%d",&n);

  for(i=0;i<8;i++)
    a[i]=0;

  for(i=0;i<n;i++){
    scanf("%d",&x);
    if(x>=3200) 
      s++;
    else
      a[x/400]++;
  }

  for(i=0;i<8;i++){
    if(a[i]!=0) m++;
  }

  if(m==0){
    m++;
    s--;
  }

  printf("%d %d\n",m,m+s);

  return 0;
}


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

int main() {
    
    int h,m,ho,mi,k;

    cin >> h >> m >> ho >> mi >> k ;

    int wake = h * 60 + m;
    int sleep = ho * 60 + mi;

    int time = sleep - wake - k;

    cout << time << endl;
    


}


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

using namespace std;

const int INF = 1e9 + 10;

int sumdig(int n){

	int ret = 0;

	while(n){
		ret+=n%10;
		n/=10;
	}

	return ret;

}

int main(){

	int n;

	cin >> n;

	int ans = INF;

	for(int i=1;i<n;++i){
		ans = min(ans,sumdig(i)+sumdig(n-i));
	}

	cout << ans << '\n';

	return 0;
}

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

const int maxn = 2e3 + 5;

int main(int argc, const char* argv[]) {
    int n, x, y, a[maxn] = {0};
    cin >> n >> x >> y;
    x--; y--;
    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
            a[min(abs(i - j), abs(i - x) + abs(j - y) + 1)]++;
    for (int i = 1; i < n; i++)
        cout << a[i] << endl;
    return 0;
}

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

int main() {
  int a, b, c, d, p, q, r;
  cin >> a >> b >> c >> d;
  p = a - b;
  q = a - c;
  r = b - c;
  if(p < 0)
    p *= -1;
  if(q < 0)
    q *= -1;
  if(r < 0)
    r *= -1;
  if((p > d || r > d) && q > d)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}

Measured memory_bytes: 384
# -*- coding: utf-8 -*-
N=input()
dp=[ float("inf") for _ in range(N+1) ]
dp[0]=0

#9円
for k in range(1,10**5):
    yen=9**k
    for i in range(N+1):
        if i+yen<=N:
            dp[i+yen]=min(dp[i+yen],dp[i]+1)
    if N<=yen:break

#6円
for k in range(1,10**5):
    yen=6**k
    for i in range(N+1):
        if i+yen<=N:
            dp[i+yen]=min(dp[i+yen],dp[i]+1)
    if N<=yen:break

#1円
for i in range(N+1):
    if i+1<=N:
        dp[i+1]=min(dp[i+1],dp[i]+1)


print dp[N]


Measured memory_bytes: 33772
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
  string s,t;
  cin >>s;
  cin >>t;



  std::vector<int> ss(26,0);
  std::vector<int> ts(26,0);
  std::vector<int> S(26,-1);
  std::vector<int> T(26,-1);

  for (size_t i = 0; i < s.size(); i++) {
    
    ss[int(s[i])-97]++;
    int index=0;
    int exist=0;
    for (size_t j = 0; j < 26; j++) {
      if (S[j]!=-1) {


        if(S[j]==int(s[i])-97){
            exist=1;
        }
        index++;
      }

    }
    if(exist!=1){S[index]=int(s[i])-97;}
  }

  for (size_t i = 0; i < s.size(); i++) {
    ts[int(t[i])-97]++;
    int index=0;
    int exist=0;
    for (size_t j = 0; j < 26; j++) {
      if (T[j]!=-1) {


        if(T[j]==int(t[i])-97){
            exist=1;
        }
        index++;
      }

    }
    if(exist!=1){T[index]=int(t[i])-97;}
  }
  for (size_t i = 0; i < 26; i++) {
    if (S[i]==-1&&T[i]==-1) {
      break;
    }
    if(ss[S[i]]!=ts[T[i]]){
        printf("No\n");
        return 0;
    }
    /* code */
  }

  printf("Yes\n");
  return 0;
}


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

int n,ans=1e9+7;
int a[1005];

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

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

int main()
{
  char s[10] = "";
  char t[10] = "";
  char u[10] = "";
  int a = 0;
  int b = 0;
  int ok = 0;
  
  scanf( "%s %s",s,t);
  scanf("%d %d",&a,&b);
  scanf("%s",u);
  ok = memcmp(s, u, 10 * sizeof(char));
  if(ok == 0)
  {
    a--;
  }
  else
  {
    b--;
  }
  printf("%d %d",a,b);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <tuple>
using namespace std;
typedef long long ll;
#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

const int INF = 1e9;
int N,M;
vector<int> G[100010];
int memo[100010];

int dfs (int v)
{
    if (memo[v] < INF) {
        return memo[v];
    }
    if (G[v].size() == 0) {
        memo[v] = 0;
        return memo[v];
    }
    int ret = 0;
    REP(i,G[v].size()) {
        ret = max(ret, dfs(G[v][i]));
    }
    return memo[v] = ret + 1;
}

int main ()
{
    cin >> N >> M;
    REP(i,M) {
        int x,y;
        cin >> x >> y;
        G[x].push_back(y);
    }

    fill(memo, memo + 100010, INF);
    for (int i = 1; i <= N; i++) {
        dfs(i);
    }

    int ans = 0;
    for (int i = 1; i <= N; i++) {
        ans = max(ans, memo[i]);
        cerr << memo[i] << " ";
    }
    cerr << endl;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
    cin.tie(NULL); cout.tie(NULL);
    ios_base:: sync_with_stdio(false);
    ll n;cin>>n;
    ll a,b,c,d,e;cin>>a>>b>>c>>d>>e;
    ll mx = min({a,b,c,d,e});
    cout<<(n+mx-1)/mx + 4;
}





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

using namespace std;

#define int long long
#define pb push_back
#define pii pair<int,int>
#define ppii pair<pii,pii>
#define fr(i,N) for(int i=0;i<N;i++)
#define F first
#define S second
#define ccM 1000000007

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

int32_t main()
{fastio;
    #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	
	string s;
	cin>> s;

	if(s=="ABC"){
		cout<< "ARC"<<endl;
	}
	else{
		cout<<"ABC"<<endl;
	}
	return 0;
	 
} 

Measured memory_bytes: 3632
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const double PI = acos(-1);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
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;
}
///////////////////////////////////////////////////////////////

template< typename T >
vector< vector< T > > binomial_table(int N) {
  vector< vector< T > > mat(N + 1, vector< T >(N + 1));
  for(int i = 0; i <= N; i++) {
    for(int j = 0; j <= i; j++) {
      if(j == 0 || j == i) mat[i][j] = 1;
      else mat[i][j] = mat[i - 1][j - 1] + mat[i - 1][j];
    }
  }
  return mat;
}


int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    ll N,A,B; cin >> N>> A >> B;
    vector<ll> v(N);
    rep(i,N) cin >> v[i];

    auto mat = binomial_table<ll>(N);

    sort(all(v));
    reverse(all(v));
    map<ll, ll> dic;
    rep(i,N) dic[v[i]]++;
    double ans = 0.0;
    ll cnt = 0LL;
    if (dic[v[0]] >= A) {
        ans = v[0];
        ll M = dic[v[0]];
        for (ll i = A; i <= min(M,B); i++) {
            cnt += mat[M][i];
        }
    } else {
        ll k = 0;
        rep(i,A) {
            if (v[i] == v[A-1]) k++;
            ans += double(v[i]);
        }
        ans /= double(A);
        ll M = dic[v[A-1]];
        cnt = mat[M][k];
    }

    cout << fixed << setprecision(10) << ans << endl;
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

//gcd,lcm,べき,二進展開
//組み合わせ、mod計算
//最短路問題、bit、union find

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





int main() {
	
	ll K, X;
	cin >> K >> X;
	if (500 * K >= X) { cout << "Yes"; }
	else { cout << "No"; }

	system("PAUSE");


}


Measured memory_bytes: 504
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 10010;
int n;
string s;
int val;
vector<string> ve;
int main()
{
    ll ans = 0;
    scanf("%d",&n);
    for(int i=1;i<=n;++i){
        cin >> s;
        sort(s.begin(),s.end());
        ve.push_back(s);
    }
    sort(ve.begin(),ve.end());
    for(int i=0;i<n;++i){
        int ed = i;
        ll cnt = 0;
        while(ed+1<n && ve[i]==ve[ed+1]){
            ed++;
        }
        cnt = ed - i;
        i=ed;
        if(cnt)
            ans += (cnt*(cnt+1))/2;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 5748
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define mp make_pair

int main()
{
	int  n; cin >> n;
	string arr; cin >> arr;
	int red = 0;
	forn(i,0,n)
	{
		// cin >> arr[i];
		if (arr[i] == 'R')
			red++;

	}
	int count = 0;

	forn(i,0,red)
	{
		if(arr[i] == 'W')
			count++;
	}

	cout << count << endl;
}

Measured memory_bytes: 3752