akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  string s;
  cin >> s;
  int m = atoi(s.substr(5, 2).c_str()), d = atoi(s.substr(8, 2).c_str());
  
  cout << (m <= 4 ? "Heisei" : "TBD");
}
#endif


Measured memory_bytes: 3636
/*
 * Counting_of_Trees.cpp
 *
 *  Created on: 2019/11/09
 *      Author: lum1narie
 */

#include "iostream"
#include "string"
#include "vector"
#include "algorithm"
#include "functional"
#include "cmath"
#include "map"

using namespace std;

#define DIVIDER 998244353

void output_answer(long long int answer) {
    cout << answer << endl;
}

long long int powerLL(long long int x, long long int y, long long int divider = 1LL) {
    long long int answer = 1;
    long long int current_factor = x % divider;
    long long int remain_y = y % divider;
    while(remain_y != 0){
        if (remain_y % 2 == 1) {
            answer = (answer * current_factor) % divider;
        }

        current_factor = (current_factor * current_factor) % divider;
        remain_y >>= 1;
    }

    return answer;
}

int main() {
    // get values from input
    int N;
    cin >> N;

    vector<int> D(N);
    map<int, int> num_of_Di;
    int max_Di = 0;
    for (int i = 0; i < N; ++i) {
        int Di;
        cin >> Di;
        D[i] = Di;

        num_of_Di[Di]++;
        max_Di = max(max_Di, Di);
    }
    // main procedure
    long long int answer = 1;

    // if D1 is not 0, unmakeable
    if (D[0] != 0) {
        output_answer(0LL);
        return 0;
    }

    // if Di (i is not 0) is 0, unmakeable
    if (num_of_Di[0] > 1) {
        output_answer(0LL);
        return 0;
    }

    for (int Di = 1; Di < max_Di; ++Di) {
        int num_upper_node = num_of_Di[Di];
        int num_lower_node = num_of_Di[Di + 1];

        if (num_upper_node == 0) {
            output_answer(0LL);
            return 0;
        }

        long long int num_node_from_Di = powerLL(num_upper_node, num_lower_node, DIVIDER);
        answer = (answer * num_node_from_Di) % DIVIDER;
    }

    // output
    output_answer(answer);
    return 0;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define V vector
#define VI vector<int>
#define VVI vector<vector<int>>

using namespace std;

int main(void){
    long long N,M,ans=0;
    cin>>N>>M;
    VVI A(N,VI(2));
    priority_queue<int> que;
    rep(i,N){
        cin>>A[i][0]>>A[i][1];
    }
    sort(A.begin(),A.end());
    //cout<<"!!"<<endl;
    int st=0;
    for(int i=1;i<=M;i++){
        for(int j=st;j<N;j++){
            if(A[j][0]<=i){
                que.push(A[j][1]);
                st=j+1;
            }else{
                st=j;
                break;
            }
        }
        if(que.size()!=0){
            ans+=que.top();
            que.pop();
        }
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 6396
import sys
from collections import defaultdict
from itertools import combinations
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    N = int(readline())
    d = defaultdict(int)
    for _ in range(N):
        S = readline().decode('utf-8')
        if S.startswith('M'):
            d['M'] += 1
        elif S.startswith('A'):
            d['A'] += 1
        elif S.startswith('R'):
            d['R'] += 1
        elif S.startswith('C'):
            d['C'] += 1
        elif S.startswith('H'):
            d['H'] += 1
        else:
            continue
    if len(d)<3:
        print(0)
        sys.exit()
    ans = 0
    for cmb in combinations(d.keys(),3):
        tmp = 1
        for kye in cmb:
            tmp *= d[kye]
        ans += tmp
    print(ans)



if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
vector<string> split(const string &str, char sep){
    std::vector<std::string> v;
    auto first = str.begin();
    while(first != str.end()){
        auto last = first;
        while(last != str.end() && *last != sep) ++last;
        v.push_back(std::string(first,last));
        if(last!=str.end()) ++last;
        first=last;
    }
    return v;
}

int n,k;
int a[100000];
long long b[100001];
long long c[100001];
int main(){
    cin>>n>>k;
    rep(i,n) cin>>a[i];
    b[0]=c[0]=0;
    rep(i,n){
        if(a[i]>0) b[i+1]=b[i]+a[i];
        else b[i+1]=b[i];
        c[i+1]=c[i]+a[i];
    }
    long long ans=0;
    rep(i,n-k+1){
        ans=max(ans,b[i]+max((long long)0,c[i+k]-c[i])+b[n]-b[i+k]);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

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

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, a, b;
    cin >> x >> a >> b;

    if(abs(x - a) < abs(x - b)){
        cout << "A" << "\n";
    }else{
        cout << "B" << "\n";
    }


    return 0;
}


Measured memory_bytes: 256
N = int(input())
ans = 0
for i in range(1,N+1):
  cnt = 0
  # 偶数ならスキップ
  if i % 2 == 0:
    continue
  for j in range(1, i+1):
    if i % j == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)

Measured memory_bytes: 2940
package main

import(
	"os"
	"bufio"
	"strconv"
	"fmt"
)

func main() {
    var sc = bufio.NewScanner(os.Stdin)
    sc.Scan()
    s, _ := strconv.Atoi(sc.Text())
    h := s/3600
    m := (s%3600)/60
    s = (s%3600)%60
    fmt.Println(fmt.Sprintf("%d:%d:%d",h,m,s))
}


Measured memory_bytes: 1104
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>

using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> p(M), r(N), w(N);
  vector<string> S(M);
  for (int i = 0; i < M; ++i) {
    cin >> p[i] >> S[i];
  }
  for (int i = 0; i < M; ++i) {
    if (S[i] == "AC") {
      r[p[i] - 1] = 1;
    } else if (r[p[i] - 1] == 0) {
      ++(w[p[i] - 1]);
    }
  }
  int point = accumulate(r.begin(), r.end(), 0);
  int penalty = inner_product(r.begin(), r.end(), w.begin(), 0);
  cout << point << ' ' << penalty << endl;
  return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define rep(i,n) FOR(i,0,n)
using namespace std;
typedef long long ll;
ll n,a[200009];
int main(){
    cin>>n;
    int num=0;
    rep(i,n){
        cin>>a[i];
        if(a[i]==num+1)num++;
    }
    cout<<(num?n-num:-1)<<endl;
}

Measured memory_bytes: 1792
s = input()
sl = len(s)
dic = {"A":1,"C":1,"G":1,"T":1}
cntmax = 0
for i in range(sl):
    cnt=0    
    for j in range(i,sl):
        try :
            # print(str(cnt) +" "+ s[j])
            cnt += dic[s[j]]
        except KeyError:
            # print(s[j])
            if cntmax < cnt:
                # print(str(i)+" "+str(j)+" "+str(cntmax)+" "+str(cnt))
                cntmax = cnt
            break
    if cntmax < cnt:
        cntmax = cnt
print(cntmax)


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


int N, X, Y;


void input() {
    cin >> N >> X >> Y;
    X--;
    Y--;
}


int main() {
    input();
    vector<int> ans(N, 0);
    ans[1] = N;
    vector<vector<int>> w(N, vector<int>(N));
    int n1 = (X + Y - 1) / 2;
    for (int i = 0; i <= n1; i++) {
        for (int j = 2; j < N - i; j++) {
            ans[j]++;
            int s = max(X - i, i - X);
            int y = s + 1;
            if (y > j) continue;
            int v1 = Y - (j - y);
            if (v1 < i + j) {
                ans[j]--;
            } else if (v1 > i + j) {
                ans[j]++;
            }
            if (j == y) continue;
            int v2 = Y + (j - y);
            if (v2 < N) ans[j]++;
        }
    }
    for (int i = n1 + 1; i < N; i++) {
        for (int j = 2; j < N - i; j++) ans[j]++;
    }
    for (int i = 1; i < N; i++) cout << ans[i] << endl;
}


Measured memory_bytes: 16000
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)

int main(){
	string s;
	cin>>s;
	bool f,c;
	f=c=false;
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='F')f=true;
		if(f&&s[i]=='C')c=true;
	}
	if(c)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
		
}

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


void solve(long long X){
    const ll num_product = 6;
    const ll price[] = {100, 101, 102, 103, 104, 105};
    vector<bool> ok(X + 1, false);
    ok.at(0) = true;
    REP(i, num_product){
        REP(j, ok.size()){
            if(ok.at(j) && j + price[i] < ok.size()){
                ok.at(j + price[i]) = true;
            }
        }
    }
    if(ok.at(X)){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long X;
    scanf("%lld",&X);
    solve(X);
    return 0;
}


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

int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll nc = b / c;
    if(a % c == 0)
    nc -= (a / c - 1);
    else
    nc -= a / c;
    ll nd = b / d;
    if(a % d == 0)
    nd -= (a / d - 1);
    else
    nd -= a / d;
    ll lcm = c * (d / __gcd(c, d));
    ll nlcm = b / lcm;
    if(a % lcm == 0)
    nlcm -= (a / lcm - 1);
    else
    nlcm -= a / lcm;
    
    cout << (b - a + 1) - (nc + nd - nlcm);
    return 0;
}

Measured memory_bytes: 256
_,*A=*$<
101.times{|x|101.times{|y|a=A.map{|s|i,j,k=s.split.map &:to_i;[k,(i-x).abs+(j-y).abs]}
K,D=a.max
a.all?{|k,d|k==[K+D-d,0].max}&&$><<[x,y,K+D]*" "}}

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

/*
過去のを3つ保持する
TAGC=0123
*/

template<int MOD>
struct ModInt {
	static const int Mod = MOD;
	unsigned x;
	ModInt() : x(0) { }
	ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }
	ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }

	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
	ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }

	ModInt inverse() const {
		signed a = x, b = MOD, u = 1, v = 0;
		while (b) {
			signed t = a / b;
			a -= t * b; std::swap(a, b);
			u -= t * v; std::swap(u, v);
		}
		if (u < 0) u += Mod;
		ModInt res; res.x = (unsigned)u;
		return res;
	}
};
typedef ModInt<1000000007> mint;

ll n;
mint dp[65],dp2[65],ans;

bool is_safe(ll x){  // AGCにならないことを確認する
	bool ans=true;
	ll a[4];  // a[0]が一番右
	rep(i,4){
		a[i]=x%4;
		x/=4;
	}
	if(a[3]==1 && a[2]==2 && a[1]==3)ans=false;  // AGC*
	if(a[2]==1 && a[3]==2 && a[1]==3)ans=false;  // GAC*
	if(a[3]==1 && a[1]==2 && a[2]==3)ans=false;  // ACG*
	if(a[2]==1 && a[1]==2 && a[0]==3)ans=false;  // *AGC
	if(a[1]==1 && a[2]==2 && a[0]==3)ans=false;  // *GAC
	if(a[2]==1 && a[0]==2 && a[1]==3)ans=false;  // *ACG
	if(a[3]==1 && a[1]==2 && a[0]==3)ans=false;  // A*CG
	if(a[3]==1 && a[2]==2 && a[0]==3)ans=false;  // AC*G
	return ans;
}

int main(void){
	cin>>n;
	dp[0]=1;  // 初期状態はTTTにする（こうしても問題ない）
	rep(i,n){
		rep(j,64){
			rep(k,4){
				if(is_safe(j*4+k))dp2[(j*4)%64+k]+=dp[j];
			}
		}
		rep(j,64){
			dp[j]=dp2[j];
			dp2[j]=0;
		}
	}
	rep(j,64)ans+=dp[j];
	cout<<ans.get()<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=((ll)n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=((ll)a);i<((ll)n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    string s,t;
    cin>>n>>s>>t;
    rrep(d,n+1){
        bool ok = true;
        rep(i,d){
            ok &= s[n-d+i] == t[i];
        }
        if(ok){
            puta(n*2-d);
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace At_coder
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int Pie;
            int[] X = new int[2];

            //数値を入力
            X = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //アップルパイの数を計算
            Pie = ((X[0] * 3) + X[1]) / 2;
            Console.WriteLine(Pie);
        }
    }
}


Measured memory_bytes: 11348
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#include <numeric>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; // x軸方向への変位
ll dy[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; // y軸方向への変位

int main(void) {
    ll n, k;
    cin >> n >> k;
    ll a[n];
    ll c;

    for(ll i = 0; i < n ; i++){
        cin >> a[i];
        if(a[i]==1) c = i;
    }
    ll ans = (n-1)/(k-1);
    if((n-1)%(k-1)!=0) ans++;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
fun main(args: Array<String>) {
    var n = getLong()

    val out = ArrayList<Long>()

    while (n > 0) {
        var m = n % 26
        if (m == 0L) {
            m = 26
            n--
        }
        out.add(m)
        n /= 26
    }

    println(out.reversed().map {'a' + it.toInt() - 1}.joinToString(""))
}

fun getInt() = readLine()!!.toInt()
fun getInts() = readLine()!!.split(" ").map { it.toInt() }
fun getLong() = readLine()!!.toLong()

Measured memory_bytes: 36532
#include<bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007
#define Vi vector<int>
#define Vl vector<long long>
#define pb(a) push_back(a)

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=10000000000000000001;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct edge{int to,cost;};
struct pos{
	int x,y,cost;
};
int dp[1001][1001]={};
char c[1001][1001]={};

int main() {

	int h,w;
	cin>>h>>w;

	queue<pos> que;
	rep(i,h){
		rep(j,w){
			cin>>c[j][i];
			if(c[j][i]=='#'){
				int sj=j,si=i;
				pos pos1={sj,si,0};
				que.push(pos1);
			}
		}
	}

	int ans=0;
	while(!que.empty()){
		pos pos2=que.front();que.pop();
		ans=max(ans,pos2.cost);
		if(c[pos2.x+1][pos2.y]=='.'&&dp[pos2.x+1][pos2.y]==0){
			dp[pos2.x+1][pos2.y]=1;
			pos pos3={pos2.x+1,pos2.y,pos2.cost+1};
			que.push(pos3);
		}
		if(c[pos2.x-1][pos2.y]=='.'&&dp[pos2.x-1][pos2.y]==0){
			dp[pos2.x-1][pos2.y]=1;
			pos pos4={pos2.x-1,pos2.y,pos2.cost+1};
			que.push(pos4);
		}
		if(c[pos2.x][pos2.y+1]=='.'&&dp[pos2.x][pos2.y+1]==0){
			dp[pos2.x][pos2.y+1]=1;
			pos pos5={pos2.x,pos2.y+1,pos2.cost+1};
			que.push(pos5);
		}
		if(c[pos2.x][pos2.y-1]=='.'&&dp[pos2.x][pos2.y-1]==0){
			dp[pos2.x][pos2.y-1]=1;
			pos pos6={pos2.x,pos2.y-1,pos2.cost+1};
			que.push(pos6);
		}
	}

	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 13328
#include <iostream>

using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;
    if(n==m) cout << "Yes" << endl; 
    else cout << "No" << endl; 
    /*
    int a[n];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    */
    //int ans = 0;
    //cout << "Hello World" << endl; 
    return 0;
}

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

int main()
{
    vector<vector<char>> data(3, vector<char>(3));


    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cin >> data.at(i).at(j);

        }
    }

    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            if (i == j)
            {
                cout << data.at(i).at(j) ;
            }
        }
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define LL long int
#define ULL unsigned long int
#define LD long double

LL MOD = 1000000007;


int main(void){
    string s,t;
    cin >> s >> t;
    int ans = 0;

    for(int i = 0; i < s.size(); ++i){
        if(s[i] != t[i])ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3916
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] arr = s.split("");
		boolean dif = false;
		for (int i=1; i<arr.length; i++) {
			if (arr[i].equals(arr[i-1])) {
				dif = true;
			}
		}

		if (dif) {
			System.out.println("Bad") ;
		} else {
			System.out.println("Good");
		}

	}

}


Measured memory_bytes: 22228
#include <iostream>
#include <vector>
#include <utility>

using namespace std;
int main() {
    int N, K;
    cin >> N >> K;
    // max: (N-1)C2
    int maxK = (N-1) * (N-2) / 2;
    int diffK = maxK - K;
    if (diffK < 0) {
        cout << -1 << endl;
        return 0;
    }
    vector<pair<int, int>> E;
    for (int i=1; i<=N-1; i++) {
        E.push_back(make_pair(i, N));
    }
    int ea = 1;
    int eb = 2;
    for (int i=0; i<diffK; i++) {
        E.push_back(make_pair(ea, eb));
        eb++;
        if (eb == N) {ea++; eb = ea+1;}
    }
    cout << E.size() << endl;
    for (auto e:E) {
        cout << e.first << " " << e.second << endl;
    }
    return 0;
}



Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

int a;
int main(void){
    cin >> a;
    cout << a + a*a + a*a*a << endl;
    return 0;
}



Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MAX_N 300010

long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];

void getInv(){
  for (int i = 1; i < MAX_N; i++) {
    if (i == 1) inv[i] = 1;
    else {
      inv[i] = (mod - (mod / i) * inv[mod % i]) % mod;
      if (inv[i] < 0) inv[i] += mod;
    }
  }
}
void getFactorial(){
  factorial[0] = 1; inv_factorial[0] = 1;
  for (int i = 1; i < MAX_N; i++) {
    factorial[i] = factorial[i-1] * i;
    factorial[i] %= mod;
    inv_factorial[i] = inv_factorial[i-1] * inv[i];
    inv_factorial[i] %= mod;
  }
}

long long combination(int n, int r) {
  long long ret = factorial[n] * inv_factorial[r];
  ret %= mod;
  ret *= inv_factorial[n-r];
  return ret % mod;
}


int main(){
  getInv();
  getFactorial();
  long long n, a, b, k; cin >> n >> a >> b >> k;
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    long long u = k - a * i;
    if (u < 0) break;
    if (u % b != 0) continue;
    u /= b; if (u > n) continue;
    long long tmp = combination(n, i) * combination(n, u); tmp %= mod;
    ans += tmp;
    ans %= mod;
    //cout << i-j << " " << j << " " << u-j << " " << tmp << endl;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 7296
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <math.h> // sqrt
using namespace std;
typedef long long ll;

int main() {
    ll N, M, K;
    cin >> N >> M >> K;
    vector<ll> A(N);
    vector<ll> B(M);
    for (ll i = 0; i < N; i++) {
        cin >> A.at(i);
    }
    for (ll i = 0; i < M; i++) {
        cin >> B.at(i);
    }
    ll ka = 0;
    ll ans = 0;
    ll i = 0;
    while (i < N) {
        ka += A.at(i);
        if (K < ka) {
            ka -= A.at(i);
            break;
        }
        ans++;
        i++;
    }
    ll j = 0;
    while (j < M) {
        ka += B.at(j);
        if (K < ka) {
            ka -= B.at(j);
            break;
        }
        ans++;
        j++;
    }
    ll ansa = ans;
    for (ll c = i - 1; c >= 0; c--) {
        ka -= A.at(c);
        ansa--;
        while (j < M) {
            ka += B.at(j);
            if (K < ka) {
                ka -= B.at(j);
                break;
            }
            ansa++;
            j++;
        }
        ans = max(ans, ansa);
    } 
    cout << ans << endl;
}

Measured memory_bytes: 6324
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[101],ans=1e9,tt;
signed main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	scanf("%d",&a[i]);
	for(int i=1;i<=100;i++)
	{
		tt=0;
		for(int j=1;j<=n;j++)
		tt+=(a[j]-i)*(a[j]-i);
		ans=min(ans,tt);
	}
	printf("%d",ans);
    return 0;
}

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

int main() {
	int W, H, x, y, r, rig, lef, top, und;
	cin >> W >> H >> x >> y >> r;

	rig = x + r;
	lef = x - r;
	top = y + r;
	und = y - r;

	if (lef >= 0 && und >= 0 && top <= H && rig <= W) {
		cout << "Yes" << endl;
		}

		else {
			cout << "No" << endl;
		}
	return 0;
}

Measured memory_bytes: 3076
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


N = int(input())

i = 1
ans = [2]
while True:
    num = 2 + 5 * i
    if is_prime(num):
        ans.append(num)
    if len(ans) == N:
        print(*ans)
        exit()
    i += 1

Measured memory_bytes: 63476
n = int(input())
taro,hanako = 0,0
for i in range(n):
	t,h = input().split(' ')
	if t > h:
		taro += 3
	elif t < h:
		hanako += 3
	else:
		taro += 1
		hanako += 1
print('{0} {1}'.format(taro,hanako))

Measured memory_bytes: 7684
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
const ll p=1000000007;
int main(){
  int n;
  cin >> n;
  int ans=1000000000;
  rep(i,n/9+1){
    int o=i*9;
    int u=n-o;
    int l=0;
    while(o){
      l+=o%9;
      o/=9;
    }
    while(u){
      l+=u%6;
      u/=6;
    }

    ans=min(ans,l);
  }
  cout << ans << endl;
}


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


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int Rank = 0, ans = 0;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        if (a > Rank) {
            Rank = a;
            ans =  a + b;
        }
    }
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    static   Scanner scan = new Scanner(System.in);
 
    public static void main(String[] args) {
        int a,b,c=0;
        String op;

        while(true){
            a=scan.nextInt(); op=scan.next(); b=scan.nextInt();
            if("?".equals(op)){
                break;
            }
            
            if("+".equals(op)){
                c = a+b;
            }else if("-".equals(op)){
                c = a-b;
            }else if("*".equals(op)){
                c=a*b;
            }else if("/".equals(op)){
                c=a/b;
            }
            System.out.println(c);
        }
    }
}



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

int main(){
    string str;
    string ans;
    cin >> str;
    for(int i = 0; i < str.length(); i++){
        char c = str.at(i);
        switch(c){
            case '0':
            case '1':
            ans = ans + c;
            break;
            case 'B':
            if(ans.length() > 0) ans.erase(ans.length() - 1);
            break;
            default:
            break;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "vector"
#include "string"
#include "map"
#include "algorithm"
#include "functional"
#include "set"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	cin >> K;
	vector<string>ans;
	for (int loop = K; loop > 0; loop--) {
		cin >> N >> M >> L >> R;
		K = max(N, M) / (min(N, M)+1) + !!(max(N, M) % (min(N, M)+1));
		long long int l = 0;
		long long int r = min(M + 1, N / K + 1);
		while (r - l > 1) {
	//		cout << l << " " << r << endl;
			long long int mid = (r + l + 1) / 2;
			long long int n = N - mid * K;
			long long int m = M - mid;
			long long int box = min(m / K, n);
			long long int nn = n - box;
			long long int mm = m - box * K;
	//		cout << "! " << n << " " << m << " " << nn << " " << mm << endl;
			if (mm >= K)r = mid;
			else l = mid;
		}
		long long int n = N - l * K;
		long long int m = M - l;
		long long int box = min(m / K, n);
		long long int nn = n - box;
		long long int mm = m - box * K;
		string ret;
//		cout << K << " " << l << " " << box << endl;
//		cout << nn << " " << mm << endl;
		for (int i = L; i <= min(R, l*(K + 1)); i++) {
			if (i % (K + 1))ret.push_back('A');
			else ret.push_back('B');
		}
		for (int i = max(L, l*(K + 1) + 1); i <= min(R, l*(K + 1) + nn); i++) {
			ret.push_back('A');
		}
		for (int i = max(L, l*(K + 1) + 1 + nn); i <= min(R, l*(K + 1) + nn + mm); i++) {
			ret.push_back('B');
		}
		for (int i = max(L, l*(K + 1) + nn + mm + 1); i <= R; i++) {
			if ((i - (l*(K + 1) + nn + mm + 1)) % (K + 1))ret.push_back('B');
			else ret.push_back('A');
		}
		ans.push_back(ret);
	}
	for (auto i : ans)cout << i << endl;
	return 0;
}


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

int main(){
        int n;
        cin>>n;

        while(n--){
                int y,m,d;
                cin>>y>>m>>d;

                int day=0;

                int k;
                switch(y%3){
                        case 1: k=2;
                                        break;
                        case 2: k=1;
                                        break;
                        default:k=0;
                }

                // all big months
                if(y<999){
                        if(k==0){
                                day+=((1000-(y+k))/3)*(10*20);
                        }else{
                                day+=((1000-(y+k))/3+1)*(10*20);
                        }

                        // Except for big months
                        if(k==0){
                                day+=((1000-y-1)-((1000-(y+k))/3))*(5*19+5*20);
                        }else{
                                day+=((1000-y-1)-((1000-(y+k))/3+1))*(5*19+5*20);
                        }
                }

                if(y%3==0){
                        day+=(10-m)*20+(20-d)+1;
                }else{
                        if(m%2==0){
                                day+=((10-m)/2)*19+((10-m)/2)*20+(19-d)+1;
                        }else{
                                day+=(1+(10-m)/2)*19+((10-m)/2)*20+(20-d)+1;
                        }
                }
                cout<<day<<endl;

        }

        return 0;
}

Measured memory_bytes: 1160
input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
S = lines.shift()

a = 0
b = 0
for (i=0; i<S.length; i++) {
    if (S[i] != (i % 2 == 0 ? '0' : '1')) {
        a++
    }
    if (S[i] != (i % 2 == 1 ? '0' : '1')) {
        b++
    }
}

console.log(Math.min(a, b))

Measured memory_bytes: 7372
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

h1,m1,h2,m2,k = map(int, read().split())

t1 = h1*60+m1
t2 = h2*60+m2

t = t2-t1

print(max(t-k,0))








Measured memory_bytes: 9164
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF 1e18
#define INF 1e9
using namespace std;

#define fs first
#define sc second

using P = pair<ll,ll>;
using Pll = pair<P,ll>;
using PQ = priority_queue<P,vector<P>,greater<P>>;

const ll MOD = 1e9+7;

string ToColumnName(ll source){
    if (source< 1) return "";
    return ToColumnName((source- 1) / 26) + (char)('A' + ((source- 1) % 26));
}

signed main(){
    ll n;
    cin >> n;
    string s = ToColumnName(n);
    rep(i,0,s.size()){
        cout << (char)(s[i] + ('a' - 'A'));
    }
    cout << endl;

    return 0;
}


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

#define hell 1000000007
#define PI acos(-1.0)
#define S second
#define F first
#define lli long long int
#define li long int
#define ld long double
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

#define run(j, n) for(auto ii=j;ii!=n;ii++)
#define out(j, n) for(auto ii=j;ii!=n;ii++) cout<<(*ii)<<" ";
#define L_MAX 1e16


int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout << fixed << showpoint;
cout << setprecision(11);

/*
#ifndef ONLINE_JUDGE
freopen("inpute.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
*/

int t=1, x = 0;
//cin>>t;
while(t--)
{ 
  int n;cin>>n;
  if(n>=400 && n<=599) cout<<"8\n";
  else if(n>=600 && n<=799) cout<<"7\n";
  else if(n>=800 && n<=999) cout<<"6\n";
  else if(n>=1000 && n<=1199) cout<<"5\n";
  else if(n>=1200 && n<=1399) cout<<"4\n";
  else if(n>=1400 && n<=1599) cout<<"3\n";
  else if(n>=1600 && n<=1799) cout<<"2\n";
  else cout<<"1\n";
} 


return 0;
}


Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  if (N % 1111 == 0) {
    cout << "Yes" << endl;
  }
  else if (N % 1110 < 10)  {
    cout << "Yes" << endl;
  }
  else if ((N % 1000) % 111 == 0)   {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split() ) )
flag = True
ans = 0
while True:
	for i in range(len(A)):
		if A[i] % 2 != 0:
			flag = False
		A[i] = int(A[i] / 2)
	if flag == False:
		break
	ans += 1
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
const int INF = 1e9;
const int MODk = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define COUTDOUBLE(v) cout << std::setprecision(10)<<(v)<<endl;
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())
#define ENDL cout<<endl

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};


int main(){
    LCIN(A);LCIN(B);LCIN(K);
    REP(a,K){
        if(a%2==0){
            if(A%2 == 0){
                B += A/2;
                A/=2;
            }else{
                A--;
                B += A/2;
                A/=2;
            }
        }else{
            if(B%2 == 0){
                A += B/2;
                B/=2;
            }else{
                B--;
                A += B/2;
                B/=2;
            }
        }
    }
    cout<<A<<" "<<B<<endl;
    rt 0;
}


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

int main() {
  int x;
  cin >> x;
  int a = x / 500;
  int b = (x % 500) / 5;
  cout << 1000 * a + 5 * b << endl;
} 


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int  ll;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int nxt() {int x;scanf("%d", &x);return x;}


int main(){
    int a=nxt();
    int b=nxt();
    printf("%d", a*b);
    return 0;
}



Measured memory_bytes: 3804
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] a = new int[N];
        for (int i = 0; i < a.length; ++i) {
            a[i] = sc.nextInt();
        }

        System.out.println(solve(a));

        sc.close();
    }

    static String solve(int[] a) {
        Set<Integer> colors = new HashSet<>();
        int freeCount = 0;
        for (int ai : a) {
            if (ai <= 3199) {
                colors.add(ai / 400);
            } else {
                ++freeCount;
            }
        }

        int minColorNum = Math.max(1, colors.size());
        int maxColorNum = colors.size() + freeCount;

        return String.format("%d %d", minColorNum, maxColorNum);
    }
}

Measured memory_bytes: 21972
n=input()
a = list(map(int,input().split()))
dn=0

for item in a:
    if item % 2 ==0:
      if item % 5!=0 and item % 3!=0:
        dn=dn+1
        break
if dn>0:
  print('DENIED')
else:
  print('APPROVED')

Measured memory_bytes: 2940
import java.util.*;

public class Main {

	private class Edge implements Comparable<Edge> {

		int from;
		int to;
		int weight;

		public Edge(int a, int b, int c) {
			from = a;
			to = b;
			weight = c;
		}

		@Override
		public int compareTo(Edge other) {
			return this.weight - other.weight;

		}

	}

	static int vertex;
	static int edge;
	static ArrayList<Edge>[] graph;
	static boolean[] visited;

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Main obj = new Main();
		Scanner sc = new Scanner(System.in);
		vertex = sc.nextInt();
		edge = sc.nextInt();
		visited = new boolean[vertex];
		graph = new ArrayList[vertex];
		for (int i = 0; i < graph.length; i++) {
			graph[i] = new ArrayList<Edge>();
		}
		for (int i = 0; i < edge; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			graph[a].add(obj.new Edge(a, b, c));
			graph[b].add(obj.new Edge(b, a, c));
		}
		PriorityQueue<Edge> pq = new PriorityQueue<Edge>();
		for (Edge e : graph[0]) {
			pq.offer(e);
		}
		visited[0] = true;
		int sum = 0;
		while (!pq.isEmpty()) {
			Edge e = pq.poll();
			if (visited[e.to]) {
				continue;
			}
			visited[e.to] = true;
			sum += e.weight;
			for (Edge f : graph[e.to]) {
				if (!visited[f.to]) {
					pq.offer(f);
				}
			}
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 115140
/*                    ___          |\    /|           ____   ____   ____  ____
   |     |    /\    /    \ |     | | \  / |    /\    |    \ |    \ |     |    \
   |_____|   /__\   \____  |_____| |  \/  |   /__\   |____/ |____/ |__   |____/
   |     |  /    \       \ |     | |      |  /    \  |      |      |     |   \
   |     | /      \ \____/ |     | |      | /      \ |      |      |____ |    \
*/
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<pl, null_type,less<pl>, rb_tree_tag,tree_order_statistics_node_update>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define lb lower_bound
#define ub upper_bound
#define pf push_front
#define pb push_back
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define pld pair<long double,long double>
#define endl '\n'
#define loop(i,n) for(ll i=0;i<n;i++)
#define rep(i, begin, end) for (__typeof(begin) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define mod ((ll)(1e9+7))
#define in(x) scanf("%lld",&x)
#define in2(x,y) scanf("%lld %lld",&x,&y)
#define in3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define inv(v) for(auto&i:v) in(i)
#define all(x) x.begin(), x.end()
#define vl vector<ll>
#define ml unordered_map<ll,ll> 
#define vpl vector<pair<ll,ll>>
#define INF 0x3f3f3f3f
 
template<typename T, typename TT>
ostream& operator<<(ostream &os, const pair<T, TT> &t) { return os<<t.first<<" "<<t.second; }
template<typename T>
ostream& operator<<(ostream& os, const vector<T> &t) { for(auto& i: t) os<<i<<" "; return os; }

int main() {
    // fast;
    // int t; scanf("%d",&t);
    // while(t--) {
    // }
    string a,b;
    cin>>a>>b;
    b.pop_back();
    if(a==b) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    #ifdef LOCAL
        cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
ll A;
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	ll ret=0;
	map<ll,int> M;
	
	cin>>N;
	FOR(i,N) {
		cin>>A;
		ret+=M[i-A];
		M[i+A]++;
	}
	cout<<ret<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 26208
#include <bits/stdc++.h>
typedef long long lint;
using namespace std;

int main() {
    string a;
    cin >> a;
    lint n = a.size();
    unordered_map<char, lint> count;
    for (int i = 0; i < n; i++) {
        count[a[i]]++;
    }
    lint ans = n * (n - 1) / 2 + 1;
    for (auto itr = count.begin(); itr != count.end(); itr++) {
        auto now = (*itr).second;
        ans -= now * (now - 1) / 2;
    }
    cout << ans << endl;
}

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

int main(){
    int h,w,cnt;
    cin >> h >> w;
    string a[h];
    int b[h+2][w+2]={};
    
    for(int i=0;i<h;i++)
        cin >> a[i];
    for(int k=0;k<3;k++)
        for(int l=0;l<3;l++)
            for(int i=k;i<h+k;i++)
                for(int j=l;j<w+l;j++){
                    if(a[i-k].at(j-l)=='#')
                        b[i][j] += 1;
                    else
                        b[i][j] += 0;
                }

    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++)
            if(a[i].at(j)=='#')
                cout << '#';
            else
                cout << b[i+1][j+1];
    cout << endl;
    }
}

Measured memory_bytes: 256
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define maxn 10004
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;

ll countDiv(ll n){
    ll res = 1;
    for(ll i=2;i*i<=n;i++){
        if(n%i == 0){
            res ++;
            if(n/i != i) res++;
        }
    }
    return res;
}

ll cal(ll n, ll m){
    while(n%m == 0) n /= m;
    if(n%m == 1 || n == 1) return 1;
    return 0;
}


int main() {
    int tc = 1;
    while(tc--){
        ll n, res = 1;
        cin >> n;
        if(n == 2){
            cout << 1 << endl;
            continue;
        }
        res += countDiv(n-1);
        for(ll i=2;i*i<=n;i++){
            if(n%i == 0){
                res += cal(n/i, i);
            }
        }
        cout << res << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        D solver = new D();
        solver.solve(1, in, out);
        out.close();
    }

    static class D {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int h = in.nextInt();
            int w = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            ModComb mc = new ModComb(200005);
            mc.makeFac();
            ModInt res = new ModInt(0);
            for (int i = 0; i < h - a; i++) {
                res = res.add(mc.combFac(b - 1 + i, i).mul(mc.combFac(w - b - 1 + h - 1 - i, h - 1 - i).getVal()).getVal());
            }
            out.println(res.getVal());
        }

    }

    static class ModInt {
        int val;
        int MOD = (int) 1e9 + 7;

        public ModInt(long i) {
            this.val = (int) ((i + MOD) % MOD);
        }

        public ModInt add(long l) {
            return new ModInt(this.val + l);
        }

        public ModInt mul(long l) {
            return new ModInt(this.val * l);
        }

        public ModInt inv() {
            return this.pow(MOD - 2);
        }

        public ModInt pow(long l) {
            ModInt res = new ModInt(1);
            ModInt v = new ModInt(this.val);
            while (l > 0) {
                if (l % 2 != 0) {
                    res = res.mul(v.val);
                }
                v = v.mul(v.val);
                l /= 2;
            }
            return res;
        }

        public int getVal() {
            return val;
        }

    }

    static class ModComb {
        int size;
        ModInt[] fac;
        ModInt[] inv;

        public ModComb(int n) {
            size = n;
            fac = new ModInt[n + 1];
            inv = new ModInt[n + 1];
        }

        public void makeFac() {
            for (int i = 0; i <= size; i++) {
                if (i == 0) {
                    fac[i] = new ModInt(1);
                } else {
                    fac[i] = fac[i - 1].mul(i);
                }
                inv[i] = fac[i].inv();
            }


        }

        public ModInt combFac(int n, int k) {
            if (n < k) {
                return new ModInt(0);
            }
            return fac[n].mul(inv[k].getVal()).mul(inv[n - k].getVal());
        }

    }
}



Measured memory_bytes: 102484
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

data class Point(val x: Int, val y: Int)
data class Delta(val x: Int, val y: Int)

fun solve() {
    var n = readInteger()
    val aList = readLongList().sortedDescending()
    var ans = aList.first()
    n -= 2
    for (a in aList.drop(1)) {
        if (n == 0) break
        
        if (n >= 2) {
            ans += a * 2
            n -= 2
        } else {
            ans += a
            n--
        }
    }

    out.println(ans)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 66188
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 15 09:40:47 2019

@author: 17664
"""

s = input()

idxA = s.index('A')

searchZ = s[idxA:]

idxZ = 0

for i in range(len(searchZ)):
    if searchZ[i] == 'Z':
        idxZ = i

print(len(searchZ[:idxZ+1]))


Measured memory_bytes: 3560