akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}
const int INF = 1e18;

const int my[4]={1, 0, -1, 0}, mx[4]={0, 1, 0, -1};

signed main() {
    int H, W;
    cin >> H >> W;
    V(string) S(H);
    rep(i, H) cin >> S[i];

    int res = 0;

    vvi visited(H, vi(W, 0));
    rep(i, H) {
        rep(j, W) {
            int b=0, w=0;
            if(visited[i][j]) continue;
            queue<P> q;
            q.push(P(i, j));
            visited[i][j] = true;
            while(!q.empty()) {
                P p = q.front();
                q.pop();
                if(S[p.fi][p.se]=='#') b++;
                else w++;
                rep(i, 4) {
                    int ny = p.fi+my[i], nx = p.se+mx[i];
                    if(ny>=H || ny<0 || nx>=W || nx<0) continue;
                    if(S[p.fi][p.se]!=S[ny][nx] && !visited[ny][nx]) {
                        visited[ny][nx] = 1;
                        q.push(P(ny, nx));
                    }
                }
            }
            res += b*w;
        }
    }

    cout << res << endl;

    return 0;
}

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

int main() {
    int n,m;
    map<int,int>cntd;

    cin>>n;
    rep(i,n){
        int d;cin>>d;
        cntd[d]++;
    }

    cin>>m;
    rep(i,m){
        int t;cin>>t;
        if(cntd[t]==0){
            cout<<"NO"<<endl;
            return 0;
        }

        cntd[t]--;
    }

    cout<<"YES"<<endl;
}


Measured memory_bytes: 9600
/** author: __nishad__ **/
#include<bits/stdc++.h>
using namespace std;


typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a,b) for(ll i=(a);i<=(b);i++)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define mp make_pair
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;

    int a, b, size=0;
    cin>>a>>b;
    int c = b;
    while(c){
        c = c/10;
        size++;
    }

    int num = a*pow(10, size) + b;

    //cout<<num<<" "<<sqrt(num)<<" "<<int(sqrt(num));

    if(sqrt(num) == int(sqrt(num)))
        cout<<"Yes";
    else
        cout<<"No";


}






























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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long ll;

const int INF = 1e9;

int main() {
  int n;
  cin >> n;
  ll ans = 0;
  unordered_map<string, int> mp;
  string s;
  rep(i, n) {
    cin >> s;
    sort(s.begin(), s.end());
    ans += mp[s];
    mp[s] = ++mp[s];
  }

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


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

using namespace std;

int main(){
  
  int n,x;
  cin>>n>>x;
  int ni=0,b=1;
  for(int i=0;i<n;i++){
    int l;
    cin>>l;
    ni+=l;
    if(ni>x)break;
    b++;
  }
  cout<<b;
  
  
  return 0;
}

Measured memory_bytes: 256
from collections import defaultdict
from itertools import permutations

N = int(input())
S = input()

pos = defaultdict(lambda: [])
for i, s in enumerate(S) :
  pos[s].append(i)

ret = 0
for a, b, c in (permutations('RGB')) :
  for center in pos[b] :
    cnt = [0] * (N + 1)
    left, right = 0, 0
    for l in pos[a] :
      if l >= center :
        break
      cnt[center-l] += 1
      left += 1
    for r in pos[c][::-1] :
      if r <= center :
        break
      cnt[r-center] += 1
      right += 1
    ret += left * right - cnt.count(2)
     

  
print(ret)

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

using int64 = long long;

bool solve(int64 a, int64 b, int64 c) {
  if (a >= c || b >= c)
    return false;
  // r(a) < r(c) - r(b)
  // a < c + b - 2r(b*c)
  // a - c - b < -2r(b*c)
  // c + b - a > 2r(b*c)
  // (c+b-a)^2 > 4*b*c
  a = c + b - a;
  return a * a > 4 * b * c;
}

int main() {
  int64 a, b, c;
  cin >> a >> b >> c;
  cout << (solve(a, b, c) ? "Yes\n" : "No\n");
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

using namespace std;

const long long MOD = 1000000007;

template<typename T>
constexpr std::pair<T, T> eea(T a, T b) noexcept {
	T x = 1, y = 0, p = 0, q = 1;
	while (b != 0) {
		T s = a;
		a = b;
		T t = s / b;
		b = s % b;

		T i = x, j = y;
		x = p;
		y = q;
		p = i - t * p;
		q = j - t * q;
	}

	return pair<T, T>(x, y);
}

template<typename E>
constexpr E inv(E a, E mod) noexcept {
	E rtv = eea(a, mod).first;
	if (rtv < 0) rtv += mod;

	return rtv;
}

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

	ll n, k;
	cin >> n >> k;

	ll comb1 = n-k+1, comb2 = 1;

	REP(i, 1, k+1) {
		cout << (comb1 * comb2) % MOD << "\n";

		comb1 *= n - k + 1 - i;
		comb1 %= MOD;
		comb1 *= inv((ll)i + 1, MOD);
		comb1 %= MOD;
		comb2 *= k - i;
		comb2 %= MOD;
		comb2 *= inv((ll)i, MOD);
		comb2 %= MOD;
	}

	return 0;
}


Measured memory_bytes: 256
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cstdio>
using namespace std;

inline int getint()
{
	int x = 0, c = getchar();
	while (c > 47 && c < 58)
	{
		x = x * 10 + c - 48;
		c = getchar();
	}
	return x;
}

constexpr int MAX = 300001;
int res[MAX * 4];

int main()
{
	int H = getint();
	int W = getint();
	int M = getint();

	int ans;
	int x, y;
	int mxr = 0;
	int mxc = 0;
	int ctrow = 0;
	int ctcol = 0;
	for (int i = 0; i < M; ++i)
	{
		res[i + 2 * MAX] = getint(), res[i + 3 * MAX] = getint();
		x = ++res[res[i + 2 * MAX]], y = ++res[res[i + 3 * MAX] + MAX];

		if (x == mxr) ++ctrow;
		else if (x > mxr) mxr = x, ctrow = 1;

		if (y == mxc) ++ctcol;
		else if (y > mxc) mxc = y, ctcol = 1;
	}
	ans = mxr + mxc;

	int ct = ctrow;
	if (ctrow > M / ctcol)
	{
		printf("%d\n", ans);
		return 0;
	}
	ct *= ctcol;

	for (int i = 0; i < M; ++i) if (res[res[i + 2 * MAX]] == mxr && res[res[i + 3 * MAX] + MAX] == mxc) --ct;
	printf("%d\n", ans - (ct <= 0));
}

Measured memory_bytes: 6288
/*================================================================
Love China, Love YALI, Love OI!
*   
*   File Name：D.cpp
*   Author：YaliKiWi
*   Date：2019年09月15日
*   Discribe：
*
================================================================*/


#include<bits/stdc++.h>
using namespace std;
#define fo(i,s,e) for(register int i=s;i<=e;i++)
#define max_(x,y) ((x)>(y)?(x):(y))
#define min_(x,y) ((x)<(y)?(x):(y))
#define dd double
#define ull unsigned long long
#define ll long long
#define maxn 100000+10
#define int ll
int n,m,ans;
priority_queue<int> a;
inline bool cmp(int x,int y){
	return x>y;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m;
	fo(i,1,n){
		int x;
		cin>>x;
		a.push(x);
	}
	fo(i,1,m){
		int reg=a.top();
		a.pop();
		reg/=2;
		a.push(reg);
	}
	fo(i,1,n){
		ans+=a.top();
		a.pop();
	}
	cout<<ans;
	return 0;
}

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


const int nax = 1e5+103;
int n, k;
int dp[nax];
int a[nax];
int f(int i){
	if (i==n-1) return 0;
	if(dp[i]!=-1) return dp[i];
	int ans = abs(a[i]-a[i+1])+f(i+1);
	for(int j=2; j<=k; j++){
		if(i+j<n) ans = min(ans, abs(a[i]-a[i+j])+f(i+j));
	}
	return dp[i]=ans;
}
int main(){
	cin>>n>>k;
	for(int i=0; i<n; i++) cin>>a[i];
	memset(dp, -1, sizeof dp);
	cout<<f(0)<<endl;
	return 0;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n,x) for(int i=(n);i<(x);++i)
#define SORT(x) sort(x.begin(),x.end())
#define rev(x) reverse(x.begin(),x.end())
#define all(x) x.begin(),x.end()
using ll = long long;

int main() {
	int n, m; cin >> n >> m;
	vector<int> x(m); rep(i, 0, m) cin >> x[i];

	if (n >= m) {
		cout << 0 << endl;
		return 0;
	}

	SORT(x);
	vector<int> itv(m - 1); rep(i, 0, m - 1) itv[i] = x[i + 1] - x[i];
	SORT(itv); rev(itv);
	ll sum = accumulate(all(itv), 0);
	ll delt = 0;
	rep(i, 0, n - 1) delt += itv[i];
	
	cout << sum - delt << endl;

	return 0;
}

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

using namespace std;

#define rep(i, N) for (long long i = 0; i < N; i++)
#define MOD 1000000007
#define IINF (INT_MAX/2)
#define LLINF (LLONG_MAX/2)

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main() {
    int n,m; cin >> n >> m;
    vi c(m); rep(i,m) cin >> c[i];

    int ans = 0;
    
    int dp[50005];
    rep(i,n+1) dp[i] = IINF;
    dp[0] = 0;

    rep(i,n){
        if(dp[i] != IINF) {
            rep(j,m) 
                if(i+c[j] <= n) dp[i+c[j]] = min(dp[i+c[j]] ,dp[i] + 1);
        }
    }

    ans = dp[n];
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3276
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF  = 0x3f3f3f3f;
const ll  mod  = 1e9 + 7;
const ll  maxn = 1e6 + 5;
const int N = 1e4 + 5;

int n,m,a[N];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>m;
	ll sum=0;
	for(int i=1;i<=m;i++){
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>n) cout<<-1<<'\n';
	else{
		cout<<n-sum<<'\n';
	}
	return 0;
}

Measured memory_bytes: 3688
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,a[100005],ans;
int main()
{
    cin>>n;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
    }
    sort ( a + 1 , a + 1 + n);
    for (int i = 1;i <= n;i++){
        if(a[i]==a[i-1]) ans++;
    }
    if(ans&1) ans++;
    cout << n-ans << endl;
    return 0;
}

Measured memory_bytes: 640
//????????????
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

//?????????????????????MaxValueException
class MaxValueException extends Exception{

}

//???????????????
class Matrix{



	public int[][] arrayA;
	public int[][] arrayB;
	public long[][] arrayC;


	public Matrix() { }

	// ????????????
	public void CreateArray(String str) throws MaxValueException{

		String[] strArray = str.split(" ");
		int a = Integer.parseInt(strArray[0]);				//??????A????????°rowA
		int b = Integer.parseInt(strArray[1]);				//??????A????????°??¨??????B????????°colA
		int c = Integer.parseInt(strArray[2]);				//??????B????????°colB

		if((1 <= a && a <= 100) && (1 <= b && b <= 100) && (1 <= c && c <= 100)) {
			this.arrayA = new int[a][b];
			this.arrayB = new int[b][c];
			this.arrayC = new long[a][c];
		}
		else {
			throw new MaxValueException();
		}
	}

	// ?????????????¨????
	public void SetValue(int i, int j, String value, boolean chk) throws MaxValueException{

		int num = Integer.parseInt(value);
		if(0 <= num && num <= 10000) {
			if(chk) {
				this.arrayA[i][j] = num;
			}else {
				this.arrayB[i][j] = num;
			}

		}else {
			throw new MaxValueException();
		}
	}

	// ?¨????
	public void SetMatrix() throws MaxValueException{
		//??????A??¨??????B?????????????´?????????????C
		
		for(int i=0; i< this.arrayA.length; i++) {
			for(int j=0; j<this.arrayA[i].length; j++) {
				for(int k=0; k<this.arrayB[j].length; k++) {
					this.arrayC[i][k] = this.arrayC[i][k] + this.arrayA[i][j] * this.arrayB[j][k];
				}				
			}
		}
	}

	// ??¨???
	public void Show()
	{
		for(int i=0; i<this.arrayC.length;i++) {
			for(int j=0; j<this.arrayC[i].length;j++) {
			if(j==(this.arrayC[i].length)-1) {
				System.out.print(this.arrayC[i][j]);
			}
			else
				System.out.print(this.arrayC[i][j]+" ");
			}
			System.out.print("\n");
		}
	}
}

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

		//matrix????????????C???????????§???????????????
		Matrix c = new Matrix();

		//????????????setmatrix?????????A??¨??????B???????????¨??°????????\?????¶?´??????????
		try {

			c.CreateArray(br.readLine());


			//??????A???????´?????????? arrayA
			for(int i=0; i<c.arrayA.length;i++) {
				String[] arrayStrA = br.readLine().split(" ");

				for(int j=0; j<c.arrayA[i].length; j++) {
					c.SetValue(i, j, arrayStrA[j], true);
				}
			}

			//??????B???????´??????????arrayB
			for(int i=0; i<c.arrayB.length ;i++) {
				String[] arrayStrB = br.readLine().split(" ");
				for(int j=0; j<c.arrayB[i].length; j++) {
					c.SetValue(i, j, arrayStrB[j], false);
				}
			}

			// ?¨????
			c.SetMatrix();
		}
		catch(MaxValueException e) {
			System.out.println(e + "???????????????????????????");
		}

		//????????????
		c.Show();
	}

}

Measured memory_bytes: 35240
/*
    Don’t practice until you get it right. Practice until you can’t get it wrong.
*/

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

#define ll long long
#define ld double
#define pii pair<ll,ll>
#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define vp vector<pii>
#define pb push_back
#define mp make_pair
#define sc(a) scanf("%lld",&a);
#define sd(a) scanf("%lf",&a);
#define test() ll tt;cin>>tt;for(ll testcase=1;testcase<=tt;testcase++)
#define all(v) v.begin(),v.end()
#define vivek_ghosh ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX 1000055
#define mod 1000000007
#define ff first
#define ss second
const int INF=0x3f3f3f3f;
const ll int inf = LLONG_MAX;

ll power(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return power((x*x)%M,n/2,M);
    else
        return (x*power((x*x)%M,(n-1)/2,M))%M;
}

ll modinv(ll a,ll m)
{
    ll g =__gcd(a, m);
    ll res=power(a, m-2, m);
    return res;
}

vb prime(MAX,true);
vl prm;
void sieve()
{
	prime[0] = prime[1] = false;
	for(ll p=2;p*p<MAX;p++)
	{
		if(prime[p])
		{
			for(ll i=p*p;i<MAX;i+=p)
				prime[i] = false;
		}
	}
	for(ll p=2;p<MAX;p++)
	{
		if(prime[p])
			prm.pb(p);
	}
}

ll n,m,t,i,j,k,q,x,y,ans=0,cnt=0,sum=0,mx=-1,mn=INT_MAX;
string s;

int main()
{
    vivek_ghosh;

    ll a,b,c;
    cin>>a>>b>>c;

    bool valid = false;

    if(a+b < c)
    {
        ll f = (c-a-b)*(c-a-b) - 4*(a*b);
        ll s = (c+a-b)*(c+a-b) - 4*(a*c);
        ll m = (c+b-a)*(c+b-a) - 4*(b*c);
//        cout<<f<<" "<<s<<" "<<m<<endl;
        if(f>0 || s>0 || m>0)
            valid = 1;
    }
    else
        valid = 0;

    if(valid)
        cout<<"Yes";
    else
        cout<<"No";
    cout<<endl;

    return 0;
}








Measured memory_bytes: 384
n,m=map(int,input().split());a=[]
for i in range(m):
  aa,bb=map(int,input().split())
  if aa==1:a.append(bb)
  if bb==n:a.append(aa)
a.sort()
for i in range(len(a)-1):
  if a[i]==a[i+1]:print("POSSIBLE");exit()
print("IMPOSSIBLE")

Measured memory_bytes: 11836
#include <iostream>
#include <vector>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;


int main(){
  stack<int> s;
  string word;
  while(cin >> word){
    if(word=="+"){
      int x1 = s.top();
      s.pop();
      int x2 = s.top();
      s.pop();
      s.push(x1+x2);
    }else  if(word=="-")
    {
      int x1 = s.top();
      s.pop();
      int x2 = s.top();
      s.pop();
      s.push(x2-x1);
    }else if (word=="*")
    {
      int x1 = s.top();
      s.pop();
      int x2 = s.top();
      s.pop();
      s.push(x1 * x2);
    }else
    {
     s.push(atoi(word.c_str()));
    }
  }
   cout << s.top() <<endl;
}

Measured memory_bytes: 1200
#include"bits/stdc++.h"
using namespace std;
char s[3001],t[3001];
int f[3001][3001];
int n,m;
void func(int x,int y)
{
	if(x==0||y==0)
		return ;
	if(s[x-1]==t[y-1])
	{
		func(x-1,y-1);
		printf("%c",s[x-1]);
	}
	else
	{
		if(f[x-1][y]>f[x][y-1])
			func(x-1,y);
		else if(f[x-1][y]<f[x][y-1])
			func(x,y-1);
		else
			func(x-1,y);
	}
}
int main()
{
	scanf("%s%s",s,t);
	n=strlen(s);
	m=strlen(t);
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
			if(s[i-1]!=t[j-1])
				f[i][j]=max(f[i-1][j],f[i][j-1]);
			if(s[i-1]==t[j-1])
				f[i][j]=f[i-1][j-1]+1;
		}
	}
	func(n,m);
}

Measured memory_bytes: 35456
#include<stdio.h>
int main()
{
	int i,j,n,temp,count[201][14],yaku[201],ans=0;
	scanf("%d",&n);
	for(i=3;i<=n;i++){
		yaku[i] = 1;
		temp = i;
		if(i%2==1){
			for(j=3;j<14;j++){
				count[i][j] = 0;
				while(temp%j==0){
					count[i][j]++;
					temp = temp/j;
				}
				yaku[i] = yaku[i]*(count[i][j]+1);
			}
			if(yaku[i]==8)ans++;
		}
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int main() {
	int a, b, c; cin >> a >> b >> c;
	if(a + b >= c) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#ifndef TEMPLATE_HPP
#define TEMPLATE_HPP
#include <bits/stdc++.h>
#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())
using namespace std;
using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename U> vector<U> make_vector(T&& n, U&& val) { return vector<U>(forward<T>(n), forward<U>(val)); }
template <typename T, typename... Args> decltype(auto) make_vector(T&& n, Args&&... args) { return vector<decltype(make_vector(forward<Args>(args)...))>(forward<T>(n), make_vector(forward<Args>(args)...)); }
const int INF = 1001001001;
const i64 LINF = 1001001001001001001ll;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
#endif

void solve() {
  int n, k;
  cin >> n >> k;
  vi32 a(n);
  cin >> a;
  for (int i = 0; i < n; i++) {
    if (i < k) continue;
    if (a[i - k] < a[i]) {
      cout << "Yes" << '\n';
    } else {
      cout << "No" << '\n';
    }
  }
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(16);
  cerr << fixed << setprecision(16);
  solve();
  return 0;
}

Measured memory_bytes: 3964
function Main(arg)
{
  var tmp = arg.split("\n");
  var N = tmp[0].split(" ")[0] -0;
  var M = tmp[0].split(" ")[1] -0;
  var p = tmp.slice(1).map(v => v.split(" ")[0]);
  var s = tmp.slice(1).map(v => v.split(" ")[1]);
    
  var ans = 0;
  var pena = 0;
  var list = new Array(N);
  var miss = new Array(N);
  list.fill(0);
  miss.fill(0);

  for (var i = 0; i < M; i++)
  {
    
    if (list[p[i]-1]) continue;

    if (s[i] === "AC")
    {
      pena += miss[p[i]-1];
      ans++;
      list[p[i]-1] = 1;
    }
    else if (s[i] === "WA")
    {
      miss[p[i]-1]++;
    }
  }

  console.log(ans + " " + pena);

  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

  ll n; std::cin >> n;
  ll nn = n-1;
  set<ll> ans;
  ans.insert(n);
  if (n > 2) ans.insert(nn);
  for (ll x = 2; x*x <= nn; x++) {
    if (nn % x) continue;
    if (nn / x == x) ans.insert(x);
    else ans.insert(x), ans.insert(n/x);
  }
  if (nn % 2) ans.insert(2);
  nn = n;
  for (ll x = 2; x*x <= nn; x++) {
    if (nn % x) continue;
    ll tmp = nn;
    while (tmp % x == 0) tmp /= x;
    if (tmp % x == 1) ans.insert(x);
  }
  std::cout << ans.size() << "\n";
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define fast_io(); std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
const std::string yes = "Yes";
const std::string no  = "No";

int main(){
    int n,ac=0,wa=0,tle=0,re=0;
    std::cin >> n;
    rep(i,n){
        std::string s;
        std::cin >> s;
        if(s=="AC"){ac++;}
        if(s=="WA"){wa++;}
        if(s=="TLE"){tle++;}
        if(s=="RE"){re++;}
    }

    std::cout << "AC x " << ac << "\n";
    std::cout << "WA x " << wa << "\n";
    std::cout << "TLE x " << tle << "\n";
    std::cout << "RE x " << re << "\n";
    return 0;
}

Measured memory_bytes: 3632
#include <algorithm>
#include <iostream>
#define min(x,y) (x < y ? x : y)
int seq[100005];
int main(){
    long long amx = 1e9 + 1;
    long long bmx = 1e9 + 1;
    int t ;
    std::cin >> t;
    for(int i = 1; i <= t; i ++) std::cin >> seq[i];
    int ii = 1;
    while(true) {
        std::sort(seq + ii, seq + 1 + t);
        if (seq[t - 1] == 0) return !(std::cout <<seq[t]);
        while(seq[ii] == 0) ii++;
        int tmp = ii;
        for (int i = tmp + 1; i <= t; i++) {
            seq[i] = seq[i] % seq[tmp];
        }
    }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
 
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define len(x) int((x).size())
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define randint(n) uniform_int_distribution<int>(1, (n))(rng)

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	#ifdef ARTHUR_LOCAL
		ifstream cin("input.txt");
	#endif

	int n;
	cin>>n;

	int dubs=0;
	bool w=0;

	for(int i=0; i<n; i++)
	{
		int d1,d2;
		cin>>d1>>d2;

		if(d1==d2) dubs++;
		else
		{
			if(dubs>=3) w=1;
			dubs=0;
		}
		// if(d1==d2) dubs++;
	}

	if(dubs>=3) w=1;

	cout << (w ? "Yes\n" : "No\n");
}

Measured memory_bytes: 3620
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n,m = gets.chomp.split.map(&:to_i)
x = gets.chomp.split.map(&:to_i)

a = Array.new(m, 0)
x.each do |num|
  a[num % m] += 1
end

h = Hash.new(0)
x.each do |num|
  h[num] += 1
end

onazi = Array.new(m, 0)
h.each do |k, v|
  v -= 1 if v.odd?
  onazi[k % m] += v
end

ans = 0

mid = m / 2
mid -= 1 if m.even?
1.upto(m/2) do |i|
  snum = [a[i], a[m - i]].min
  a[i] -= snum
  a[m-i] -= snum
  ans += snum
end
if m.even?
  ans += a[m/2] / 2
  a[m/2] = 0
end
ans += a[0] / 2
a[0] = 0

m.times do |i|
  if onazi[i] > a[i]
    tmp = a[i]
    ans += tmp / 2
  else
    ans += onazi[i] / 2
  end
end
puts ans

=begin
10 20
1 11 11 11 21
5 25 25
6 26
99 99 99

=end


Measured memory_bytes: 20092
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;

	if (a + b == c || a + c == b || b + c == a)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
int main(){
    int w,n;
    scanf("%d%d",&w,&n);
    int *ar=new int[w];
    for(int i=0;i<w;i++){
        ar[i]=i+1;
    }
    for(int i=0;i<n;i++){
        int a,b,t;
        scanf("%d,%d",&a,&b);
        t=ar[a-1];
        ar[a-1]=ar[b-1];
        ar[b-1]=t;
    }
    for(int i=0;i<w;i++){
        printf("%d\n",ar[i]);
    }
}

Measured memory_bytes: 0
#include <cstdio>

long long gcd(long long a, long long b)
{
  if (a < b) return gcd(b, a);
  long long r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}

int main()
{
  int n;
  long long ans;
  scanf("%d %lld", &n, &ans);
  
  for (int i = 1; i < n; ++i)
  {
    long long t;
    scanf("%lld", &t);
    ans = ans / gcd(ans, t) * t;
  }
  printf("%lld\n", ans);
  return 0;
}

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

int main() {
  string s;
  int ren=0;
  cin >> s;
  vector<int> ans(s.size());

  for(int i=0;i<s.size();i++) {
    ren++;
    if(s[i]=='L') {
      if(ren%2==0) ans[i-ren]++;
      else ans[i-ren+1]++;
    }
    if(i+1==s.size()) continue;
    if(s[i]=='R'&&s[i+1]=='L') {
      ans[i]+=ren-(ren/2);
      ans[i+1]+=ren/2;
      ren=0;
    }
    if(s[i]=='L'&&s[i+1]=='R') ren=0;
  }
  for(int i=0;i<s.size();i++) cout << ans.at(i) << " ";
  cout << endl;
}

Measured memory_bytes: 1024
fun main(args: Array<String>) {
    solve(java.util.Scanner(System.`in`))
}

fun <A> List<Comparable<A>>.upperBoundOf(target: A): Int {
    var l = -1
    var r = this.count()
    while (l + 1 < r) {
        val mid = (l + r) / 2
        if (this[mid] > target) {
            r = mid
        } else {
            l = mid
        }
    }
    return r
}

fun solve(sc: java.util.Scanner) {
    val N = sc.nextInt()
    val L = Array(N) { sc.nextLong() }.sorted()

    var result = 0L
    for (i in 2 until N) {
        val a = L[i]
        for (j in 1 until i) {
            val b = L[j]
            val ci = j - L.upperBoundOf(a - b)
            if (ci > 0) result += ci
        }
    }
    println(result)
}


Measured memory_bytes: 45292
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct BoolName : numpunct<char> {
  string t, f;
  BoolName (string t = "Yes", string f = "No") : t(t), f(f) {}
  string do_truename() const {return t;}
  string do_falsename() const {return f;}
};

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
    cout.imbue(locale(cout.getloc(), new BoolName));
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

void set_bool_name(string t, string f) {
  cout.imbue(locale(cout.getloc(), new BoolName(t, f)));
}

int main() {
  int64_t a, b, c, k;
  cin >> a >> b >> c >> k;
  cout << (k % 2 ? -1 : 1) * (a - b) << endl;
}



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

const string YES = "Yes";
const string NO = "No";

void solve(std::vector<std::vector<long long>> A, long long N, std::vector<long long> b){
	vector<bool> bs(101, false); 
	for (auto i: b) bs[i] = true; 

	bool good = false;
	for (int i = 0; i < 3; ++i) {
		if (bs[A[i][0]] and bs[A[i][1]] and bs[A[i][2]]) {
			good = true; 
		} else if (bs[A[0][i]] and bs[A[1][i]]  and bs[A[2][i]]) {
			good = true; 
		}
	}

	if (bs[A[0][0]] and bs[A[1][1]] and bs[A[2][2]]) good = true;
	if (bs[A[2][0]] and bs[A[1][1]] and bs[A[0][2]]) good = true;  

	(good) ? cout << YES << endl : cout << NO << endl; 
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::vector<std::vector<long long>> A(3, std::vector<long long>(3));
    for(int i = 0 ; i < 3 ; i++){
        for(int j = 0 ; j < 3 ; j++){
            scanf("%lld",&A[i][j]);
        }
    }
    long long N;
    scanf("%lld",&N);
    std::vector<long long> b(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&b[i]);
    }
    solve(std::move(A), N, std::move(b));
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[34];
int main()
{
     int m,n,x,y;
     cin>>m>>n;
     for(int i=0;i<m;i++)
     {
            cin>>x;
            for(int j=0;j<x;j++)
            {
                cin>>y;
                a[y]++;
            }

     }
     int ans=0;
  for(int i=1;i<=30;i++)
  {
      if(a[i]==m)
        ans++;
  }
  cout<<ans<<endl;
}


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

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

using ll = long long;
using ull = unsigned long long;

int main() {
    int n, m;
    cin >> n >> m;
    cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;

    return 0;
}

Measured memory_bytes: 764
n=input()

c=len(n)-1
for i in range(2**c):
      L=['-']*c
      for j in range(c):
            if ((i>>j)&1):#「>>」自体に二進数演算が含まれている
                  L[c-1-j]="+"#右詰めにする
      L+=['']
      f=""
      for a,b in zip(n,L):
            f+=a+b
      if eval(f)==7:
            print(f + '=7')
            break

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

#define sp ' '
#define endl '\n'
#define st first
#define nd second
#define sz(x) ((long long int)x.size())
#define pb push_back
#define pob pop_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define forn(YY, yy) for(long long int yy = 0; yy < YY; ++yy)
#define prn(XX) cout << XX << '\n'
#define prs(XX) cout << XX << ' '
#define TEST cout << "TEST\n";

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;

const long long int MOD = 1e9 + 7;
const long long int INF = 2e9 + 13;
const long long int mINF = -2e9 - 13;
const double PI = acos(-1.0);
const double EPS = 1e-9;

ll mx(ll x, ll y){ return (x>y?x:y); }
ll mn(ll x, ll y){ return (x<y?x:y); }

void max_self(ll &x, ll y){ x = mx(x, y); }
void min_self(ll &x, ll y){ x = mn(x, y); }
void add(ll &x, ll y){ x%=MOD; x += (y%MOD); x %= MOD; }
void mul(ll &x, ll y){ x%=MOD; x *= (y%MOD); x %= MOD; }

ll us(ll n, ll x, ll m){
    if(x == 0) return 1;
    ll a = us(n, x>>1, m);
    return (((a*a)%m)*(x&1?n:1))%m;
}

ll n, a, b;

int main(int argc, char **argv){
    //ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    cin >> n >> a >> b;

    ll A = 1, B = 1, afac = 1, bfac = 1;

    for(ll i = n; i >= n-a+1; --i){ A*=i; A%=MOD; }
    for(ll i = n; i >= n-b+1; --i){ B*=i; B%=MOD; }

    for(ll i = 1; i <= a; ++i){ afac*=i; afac%=MOD; }
    for(ll i = 1; i <= b; ++i){ bfac*=i; bfac%=MOD; }

    ll top = (us(2, n, MOD) - 1)%MOD;
    ll yalniza = (A*(us(afac, MOD-2, MOD)))%MOD;
    ll yalnizb = (B*(us(bfac, MOD-2, MOD)))%MOD;

    ll ans = (top - yalniza + MOD - yalnizb + MOD)%MOD;
    cout << ans << endl;

    return 0;
}

//cikisir



Measured memory_bytes: 256
line = list(input().split())
line.sort()
if int(line[1]) - int(line[0]) > int(line[2]) - int(line[1]):
    print((int(line[2]) - int(line[1]) + (int(line[1]) - int(line[0]))))
else:
    print(abs((int(line[2]) - int(line[1]) + (int(line[1]) - int(line[0])))))

Measured memory_bytes: 9108
#include<bits/stdc++.h>
using namespace std;
typedef		 long long int    ll;
typedef		 long double   ld;
typedef		vector<ll>      vll;
#define     fi              first
#define     print(v)        for(ll i:v) cout<<i<<ss
#define     se              second
#define		pb              push_back
#define		nn              "\n"
#define		all(p)          p.begin(),p.end()
#define		zz(v)           (ll)v.size()
#define 	S(a)            scanf("%lld",&a)
#define 	SS(a,b)         scanf("%lld %lld",&a,&b)
#define 	SSS(a,b,c)      scanf("%lld %lld %lld",&a,&b,&c)
#define		ss              ' '
#define     pii             pair<ll,ll>
#define		gcd(a,b)        __gcd(a,b)
#define		lcm(a,b)        (a*b)/gcd(a,b)
const double eps = 1e-8;


int main()
{
    char c;
    cin>>c;
    cout<<(char)(c+1)<<nn;




}


/* Final check before submit :

1. array size or integer overflow,like uninitialised 0 index.

2. Think twice,code once.check all possible counter test case.

3. Be careful about corner case! n=1?k=1? something about 0?

4. avoid stupid mistake!complexity(t/m)?precision error?submit same code twice?

5. if got WA than remember that you are missing something common.
   *** Be confident!!! who knows? may be your one step back to AC ***
4. minus mod ans=(ans-k+mod)%mod;

*/






Measured memory_bytes: 3552
//Serene
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
using namespace std;
#define ll long long
#define db double
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
const int maxn=2e5+7;
const ll mod=1e9+7,INF=1e10;
ll n,X,Y,mi[maxn],inv[maxn],ans=1;
ll p[maxn],c[maxn],w[maxn],sum[maxn];

char cc; ll ff;
template<typename T>void read(T& aa) {
	aa=0;cc=getchar();ff=1;
	while((cc<'0'||cc>'9')&&cc!='-') cc=getchar();
	if(cc=='-') ff=-1,cc=getchar();
	while(cc>='0'&&cc<='9') aa=aa*10+cc-'0',cc=getchar();
	aa*=ff;
}

ll qp(ll x,ll k) {
	ll rs=1;
	while(k) {
		if(k&1) rs=rs*x%mod;
		k>>=1; x=x*x%mod;
	}
	return rs;
}

struct Node{
	ll col,x,w;
	Node(){}
	Node(ll col,ll x,ll w):col(col),x(x),w(w){}
	bool operator < (const Node& b) const{return w<b.w;}
}node[maxn];
int tot;

bool vis[maxn];
int nxt[maxn];
int find(int x) {return x==nxt[x]? x:nxt[x]=find(nxt[x]);}

int main() {
	read(n); read(X); read(Y);
	mi[0]=1; For(i,1,n) mi[i]=mi[i-1]*(ll)i%mod;
	inv[n]=qp(mi[n],mod-2); Rep(i,n,1) inv[i-1]=inv[i]*(ll)i%mod;
	w[n+1]=INF;
	For(i,1,n) p[i]=n+1;
	For(i,1,n) {
		read(c[i]); read(w[i]);
		if(w[i]<w[p[c[i]]]) p[c[i]]=i;
		sum[i]=1;
	}
	For(i,1,n) {
		if(p[c[i]]==i) continue;
		if(w[p[c[i]]]+w[i]<=X) sum[i]=0,sum[p[c[i]]]++;
	}
	For(i,1,n) if(sum[i]) node[++tot]=Node(c[i],sum[i],w[i]);
	sort(node+1,node+tot+1);
	For(i,1,tot+1) nxt[i]=i;
	int j=2,pos=2;
	while(j<=tot&&node[j].col==node[1].col) ++j;
	memset(sum,0,sizeof(sum));
	if(node[j].w+node[1].w<=Y) {
		sum[0]+=node[1].x; sum[node[1].col]+=node[1].x;
		for(pos=2;pos<=tot&&node[pos].w+node[1].w<=Y;++pos) {
			if(node[pos].col==node[1].col&&node[pos].w+node[j].w>Y) continue;
			sum[0]+=node[pos].x;
			sum[node[pos].col]+=node[pos].x;
		}
		ans=mi[sum[0]];
		For(i,1,n) ans=ans*inv[sum[i]]%mod;
	}
	else {
		sum[0]+=node[j].x; sum[node[j].col]+=node[j].x;
		for(pos=2;pos<=tot&&node[pos].w+node[1].w<=Y;++pos) {
			if(node[pos].col==node[1].col||pos==j) continue;
			sum[0]+=node[pos].x;
			sum[node[pos].col]+=node[pos].x;
		}
		ans=mi[sum[0]];
		For(i,1,n) ans=ans*inv[sum[i]]%mod;
		memset(sum,0,sizeof(sum));
		for(pos=2;pos<=tot&&node[pos].w+node[j].w<=Y;++pos) if(node[pos].col==node[1].col){
			sum[0]+=node[pos].x;
			sum[node[pos].col]+=node[pos].x;
		}
		ans=ans*mi[sum[0]]%mod;
		For(i,1,n) ans=ans*inv[sum[i]]%mod;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 15104
#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
#define fastio  cin.sync_with_stdio(0); cin.tie(0);cin.exceptions(cin.failbit);
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a,v) memset(a, v, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=1e9+7;
const int N=2e5+5;
int main() {
   
    fastio;
    int T=1;
    // cin>>T;
    while(T--){
        string s,t;cin>>s>>t;
        int ans=0;  
        rep(i,sz(s)){

            if(s[i]!=t[i])ans++;
        }
        cout<<ans;
    }   
    timecalculater();
    return 0;   
} 

Measured memory_bytes: 3820
#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

template<class T>
using vector2d=vector<vector<T>>;

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

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

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

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

  lint n;
  cin>>n;
  vector<lint> x(n);
  for(int i=0;i<n;i++){
    cin>>x[i];
  }
  lint min=INT64_MAX;
  for(int p=0;p<100;p++){
    lint result=0;
    for(auto v:x){
      result+=(v-p)*(v-p);
    }
    UpdateMin(min,result);
  }
  cout<<min<<endl;

  return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string a[101];
int n,i;
int main(){
    scanf("%d%*d",&n);
    for(i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(i=0;i<n;i++)    cout<<a[i];
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>

const int MAXN = (int)2e5 + 1;

std::vector<int> tree[MAXN];
int dfs_seq[MAXN];
int dfs_seq_cur;
int size[MAXN];
int f[MAXN];

void dfs(int p, int u) {
  size[u] = 1;
  dfs_seq[u] = ++dfs_seq_cur;
  for (const auto &v : tree[u]) {
    if (v == p) continue;
    dfs(u, v);
    size[u] += size[v];
  }
}

int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d %d", &u, &v);
    tree[u].emplace_back(v);
    tree[v].emplace_back(u);
  }
  dfs_seq_cur = 0;
  dfs(-1, 1);
  for (int i = 0, x, u; i < q; ++i) {
    scanf("%d %d", &u, &x);
    f[dfs_seq[u]] += x;
    f[dfs_seq[u] + size[u]] -= x;
  }
  for (int i = 2; i <= n; ++i) {
    f[i] += f[i - 1];
  }
  for (int i = 1; i <= n; ++i) {
    printf("%d\n", f[dfs_seq[i]]);
  }
  return 0;
}


Measured memory_bytes: 25088
#include<bits/stdc++.h>
using namespace std;
int n,k;
int main(){
  cin >> n >> k;
  double ans = 0;
  for(int i=1;i<=n;i++){
    double kaku = 1.0/n;
    int tmp = i;
    while(k > tmp){
      tmp*=2;
      kaku/=2;
    }
    ans+=kaku;
  }
  printf("%.12f\n",ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a>b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=x-1;i>=;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define endl "\n"
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;

int main(){
    ll h,n,ans=0;cin>>n>>h;
    ll a[101010];
    while(n>0){
        n-=h;
        ans++;
    }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRTV(v) sort(v.begin(),v.end())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;

int atcoder(){
    //入力
    int x,a,b;
    cin >> x >> a >> b;
    //処理
    //出力
    if(b-a<=0) cout << "delicious" << ENT;
    else if(b-a<=x) cout << "safe" << ENT;
    else cout << "dangerous" << ENT;
    return 0;
}

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


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

int main(void){
    int min = INT_MAX, max = INT_MIN;
    long int sum = 0;
    int i;
    int n, input;
    scanf("%d", &n);
    
    for(i=0;i<n;i++){
        scanf("%d", &input);
        min = min < input? min:input;
        max = max > input? max:input;
        sum += input;
    }
    printf("%d %d %ld\n", min, max, sum);
    return 0;
}

Measured memory_bytes: 2648
#include<bits/stdc++.h>
using namespace std;
const long long maxn=110,maxx=1e5+1;
long long w[maxn],v[maxn],dp[maxn][maxx];
int main()
{
    long long i,n,j,W;
    cin>>n>>W;
    for (i=1;i<=n;i++)
    {
        cin>>w[i]>>v[i];
    }
    for (i=1;i<=n;i++)
    {
        for (j=1;j<=W;j++)
        {
            if (w[i]<=j) dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);
            else dp[i][j]=dp[i-1][j];
        }
    }
    cout<<dp[n][W]<<endl;
}


Measured memory_bytes: 81712
#include <iostream>
#include <cctype>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n;cin>>n;
  string taros,hanakos;
  int taro=0,hanako=0;
  
  for(int i=0;i<n;i++){
  	cin>>taros>>hanakos;
    if(taros>hanakos){
    	taro+=3;
    }else if(taros==hanakos){
    	taro++;
      	hanako++;
    }else{
    	hanako+=3;
    }
  }
  cout<<taro<<" "<<hanako<<endl;
}	


Measured memory_bytes: 3156
// https://atcoder.jp/contests/abc099/tasks/abc099_a
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    int df = abs(a - b);
    int t = df * (df - 1) / 2;
    cout << t - a << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,A[1000001],i,c,mx;
int main(){
  cin>>n;
  cin>>A[0];
  mx=A[0];
  for(i=1;i<n;i++){
    cin>>A[i];
   if(A[i]>=mx){
     mx=A[i];
     c++;}}
  cout<<c+1;}

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

int main() {
    string date;
    cin >> date;
    string year = date.substr(0, 4);
    string month = date.substr(5, 2);
    string day = date.substr(8, 2);

    int year_n = atoi(year.c_str());
    int month_n = atoi(month.c_str());
    int day_n = atoi(day.c_str());

    bool heisei = true;

    if (year_n>2019) {
        heisei = false;
    }
    else {
        if (month_n > 4) {
            heisei = false;
        }
    }
    if (heisei) {
        cout << "Heisei" << endl;
    }
    else {
        cout << "TBD" << endl;
    }
}

Measured memory_bytes: 256