akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr int MAX = 1100000;
constexpr int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
  int x, y;
  cin >> x >> y;

  if ((x + y) % 3 != 0) {
    cout << 0 << endl;
    return 0;
  }

  int d = (x + y) / 3;
  x -= d, y -= d;

  if (x < 0 || y < 0) {
    cout << 0 << endl;
    return 0;
  }

  COMinit();

  cout << COM(x + y, x) << endl;
  return 0;
} 

Measured memory_bytes: 25984
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

#define FOR(i,a,b) for(lint i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;

using namespace std;
lint p=1e9+7;
lint pow_mod(lint a,lint b,lint p){
  if(b==0)return 1;
  if(b%2==0){
    lint d=pow_mod(a,b/2,p);
    return (d*d)%p;
  }else{
    return (a*pow_mod(a,b-1,p))%p;
  }
}

//x / a mod p=x * inv_mod(a,p) 
lint inv_mod(lint a,lint p){
  return pow_mod(a,p-2,p);//(a^(p-2))mod p
}


int main(){
  int N,K;
  cin>>N>>K;
  lint P[K+1];
  P[0]=1;
  FOR(i,1,K+1)P[i]=(i*P[i-1])%p;
  vector<int> c[N];
  REP(i,N-1){
    int a,b;
    cin>>a>>b;
    a--;b--;
    c[a].push_back(b);
    c[b].push_back(a);
  }
  queue<int> q;
  int d[N];
  REP(i,N)d[i]=-1;
  d[0]=0;
  q.push(0);
  lint ans=K;
  while(!q.empty()){
    int pi=q.front();
    q.pop();
    lint n=K-min(d[pi]+1,2);
    lint k=c[pi].size()-(pi==0?0:1);
    if(k>n){
      cout<<0<<endl;
      return 0;
    }
    if(k>0){
      ans*=(P[n]* inv_mod(P[n-k],p))%p;
      ans%=p;
    }
    // cerr<<pi<<" "<<ans<<endl;
    for(auto e:c[pi]){
      if(d[e]>=0)continue;
      q.push(e);
      d[e]=d[pi]+1;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 7672
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// // 整数の入力
		// int a = sc.nextInt();
		// // スペース区切りの整数の入力
		// int b = sc.nextInt();
		// int c = sc.nextInt();
		// // 文字列の入力
		// String s = sc.next();
		// // 出力
    // System.out.println((a+b+c) + " " + s);
    int M = sc.nextInt();
    System.out.println(24 + 24 - M);
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using pdd = pair<double, double>;
using uint = unsigned int;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;
const ld PI = acosl(-1);

template <typename T>
struct BIT {
    int siz;
    vector<T> bit;

    BIT(int N) : siz(N + 1), bit(siz) {}

    void add(int k, T x) {
        while (k < siz) {
            bit[k] += x;
            k += (k & -k);
        }
    }

    T sum(int k) {
        T res(0);
        while (k > 0) {
            res += bit[k];
            k -= (k & -k);
        }
        return res;
    }
};

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

    string S;
    cin >> S;

    int N = S.length();
    vector<int> cnt(26);
    vector<deque<int>> que(26);
    for (int i = 0; i < N; ++i)
        cnt[S[i] - 'a']++, que[S[i] - 'a'].emplace_back(i);

    int ocnt = 0;
    for (int i = 0; i < 26; ++i)
        ocnt += cnt[i] & 1;
    if ((N & 1 && ocnt >= 2) || (!(N & 1) && ocnt >= 1)) {
        cout << -1 << endl;
        return 0;
    }

    vector<int> pos(N);
    vector<bool> seen(N);
    int pcnt = 0;
    for (int i = 0; i < N; ++i) {
        int num = S[i] - 'a';
        if (seen[i])
            continue;

        if (que[num].size() == 1) {
            pos[N / 2] = i;
            que[num].pop_back();
            seen[i] = true;
            continue;
        }

        pos[pcnt] = i;
        pos[N - 1 - pcnt] = que[num].back();
        seen[i] = seen[que[num].back()] = true;
        que[num].pop_back();
        que[num].pop_front();
        pcnt++;
    }

    ll ans = 0;
    BIT<int> bit(N);
    for (int i = 0; i < N / 2; ++i) {
        int idx = pos[i] - bit.sum(pos[i] + 1);
        int ridx = pos[N - 1 - i] - bit.sum(pos[N - 1 - i] + 1);
        ans += (idx - i) + (N - 1 - i - ridx);
        bit.add(pos[N - 1 - i] + 1, 1);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 5984
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include<time.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
#include<fstream>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 998244353;// 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max() / 2;
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
struct Fll { LL first, second, third, fourd; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Rrep(i,mf) for(LL i=mf-1;i>=0;i--)
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
struct Edge { LL to, cost; };
struct edge { LL from, to, cost; };
vector<vector<int>>g;
vector<edge>edges;
vector<Pll>v;
map<Pll, Pll>ma;
set<LL>st;
LL h, w, n, m, k, t, s, p, q, last, cnt, sum[100000], ans, a[210000], b[210000], dp[2100000];
string str, ss;
bool f;
char c;
template<typename T>
struct CHT {
	using Line = Pll;
	vector<Line>lines;
	CHT() {}
	void add(LL a, LL b) {
		Line cur(a, b);
		while (lines.size() > 1 && check(lines[lines.size() - 2], lines[lines.size() - 1], cur)) {
			lines.pop_back();
		}
		lines.push_back(cur);
	}
	bool check(Line p1,Line p2,Line p3) {
		return (p3.first - p2.first)*(p2.second - p1.second) <=
			(p2.second - p3.second)*(p1.first - p2.first);
	}
	LL f(Line a, LL x) {
		return a.first*x + a.second;
	}
	LL get(LL x) {
		LL low = -1, high = lines.size() - 1;
		while (high - low > 1) {
			LL mid = (high + low) / 2;
			if (f(lines[mid], x) > f(lines[mid + 1], x)) low = mid;
			else high = mid;
		}
		return (f(lines[high], x));
	}
};
int main() {
	CHT<LL> cht;
	cin >> n >> m;
	rep(i, n) {
		cin >> a[i];
	}
	dp[0] = 0;
	cht.add(-2 * a[0], dp[0] + a[0] * a[0]);
	for (int i = 1; i < n; i++) {
		dp[i] = a[i] * a[i] + m + cht.get(a[i]);
		cht.add(-2 * a[i], dp[i] + a[i] * a[i]);
	}
	cout << dp[n - 1] << endl;
	return 0;
}


Measured memory_bytes: 11888
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

#define ll long long
#define ull unsigned long long

using namespace std;

int n, W, w[105], val[105];
// val, weight
map<ll, ll>mp;

int main()
{
	map<ll, ll>temp;
	cin >> n >> W;
	for (int i = 0; i < n; i++)cin >> w[i] >> val[i];
	mp.insert({ 0,0 });
	if (w[0] <= W) mp.insert({ val[0],w[0] });
	for (int i = 1; i < n; i++)
	{
		for (auto it : mp)
		{
			ll v = it.first + val[i], weight = it.second + w[i];
			if (weight > W)continue;
			if (temp.find(v) != temp.end())
				temp[v] = min(temp[v], weight);
			else
				temp.insert({ v,weight });
		}
		for (auto it : temp)
		{
			if (mp.find(it.first) != mp.end())
				mp[it.first] = min(mp[it.first], it.second);
			else
				mp.insert({ it.first,it.second });
		}
		temp.clear();
	}
	map<ll, ll>::reverse_iterator it = mp.rbegin();
	while (it != mp.rend())
	{
		if (it->second <= W)
		{
			cout << it->first << '\n';
			break;
		}
		it++;
	}
	return 0;
}

Measured memory_bytes: 6656
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,k,f[21][1<<20],ans,l;
char s[2000005];
void print(int x,int l)
{
	for(int i=l-1;i>=0;i--)
	  printf("%d",(x>>i)&1);
}
int main()
{
	scanf("%d%d",&n,&k);
	for(int i=0;i<=n;i++)
	{
		scanf("%s",s);
		for(int j=0;j<(1<<i);j++)
		  if(s[j]=='1')f[i][j]=1;
	}
	for(int i=0;i<=n;i++)
	{
		for(int j=1;j<=n-i;j++)
		{
			for(int x=0;x<(1<<i);x++)
			for(int y=0;y<(1<<j);y++)
			{
				if(!f[j][(x<<j)+y])continue;
				f[0][x]+=f[j][(x<<j)+y];
//				print(x,i);
//				printf(" ");
//				print(y,j);
//				printf(" %d,val=%d\n",f[j][(x<<j)+y],f[0][0]);
			}
		}
		for(int x=(1<<i)-1;x>=0;x--)
		{
//				print(x,i);
//				printf(" %d\n",f[0][x]);
			if(f[0][x]>=k)ans=x,l=i; 
			f[0][x]=0;
		}
		for(int j=1;j<=n-i;j++)
		{
			for(int x=0;x<(1<<i);x++)
			for(int y=0;y<(1<<j);y++)
			{
				if(!f[j][(x<<j)+y])continue;
//				printf("f[");
//				print(x,i);
//				printf("][");
//				print(y,j);
//				printf("]=%d\n",f[j][(x<<j)+y]);
				int now=j-1,v=y;
				while(now>=0&&((1<<now)&y))v-=(1<<now),now--;
				if(now>=0)
				{
					f[now][(x<<(now+1))+v]+=f[j][(x<<j)+y];
//					print(x<<1,i+1);
//					printf(" ");
//					print(v,now);
//					printf("\n");
				}
				now=j-1,v=y;
				while(now>=0&&!((1<<now)&y))now--;
				if(now>=0)
				{
					f[now][(x<<(now+1))+v]+=f[j][(x<<j)+y];
//					print(x<<1|1,i+1);
//					printf(" ");
//					print(v,now);
//					printf("\n");
				}
//				printf("val=%d\n",f[0][0]);
				f[j][(x<<j)+y]=0;
			}
		}
	}
	for(int i=l-1;i>=0;i--)printf("%d",(ans>>i)&1);
	printf("\n");
	return 0;
}

Measured memory_bytes: 87168
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <complex>

using namespace std;

//#pragma GCC optimize("Ofast")
//#pragma GCC optimization("unroll-loops, no-stack-protector")
//#pragma GCC target("avx,avx2,fma")


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

	int n, m, c, i, j, k, x, y, ans;
	cin >> n >> m >> c;
	vector<vector<int>> v(n + 1);
	vector<int> ct(m + 1, 0), cx(n + 1, 0);
	for (i = 0; i < c; i++) {
		cin >> x >> y;
		v[x].push_back(y);
		ct[y]++;
		cx[x]++;
	}

	set<pair<int, int>> s;
	for (i = 1; i <= m; i++) s.insert({ ct[i], i });

	ans = 0;
	for (i = 1; i <= n; i++) {
		for (auto p : v[i]) {
			s.erase({ ct[p], p });
			ct[p]--;
			s.insert({ ct[p], p });
		}

		ans = max(ans, cx[i] + s.rbegin()->first);

		for (auto p : v[i]) {
			s.erase({ ct[p], p });
			ct[p]++;
			s.insert({ ct[p], p });
		}
	}

	cout << ans << "\n";

	return 0;
}



Measured memory_bytes: 35544
#include <stdio.h>
#include <math.h>

int main(void){
    long long int h, sum;
    scanf("%lld", &h);
    long long int count = 0;

    while(0 < h){
            h = h / 2;
            count++;
    }

    long long int n;
    n = pow(2, count);
    
    sum = n - 1;

    printf("%lld", sum);

}

Measured memory_bytes: 128
def main():
    n = int(input())
    s = [""] * n
    ans = 0
    for i in range(n):
        s[i] = SortString(input())
    sDictionary = {}
    for i in range(n):
        if sDictionary.get(s[i]):
            ans += sDictionary.get(s[i])
            sDictionary[s[i]] += 1
        else:
            sDictionary[s[i]] = 1
    print(ans)


def SortString(text):
    return "".join(sorted(list(text)))


if __name__ == '__main__':
    main()


Measured memory_bytes: 62424
#include <iostream>

using namespace std;

int main(){
    int N, X, l, tmp = 0;
    cin >> N >> X;
    int ans = 1;
    for(int i = 0; i < N; ++i){
        cin >> l;
        tmp += l;
        if(tmp <= X)
            ans++;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
//package code;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.StringTokenizer;

/**
 *
 * @author Milo
 */
public class Main {
    
    static FastReader in = new FastReader();
    public static void main(String[] args) {
        int t = 1; //in.nextInt();
        while (t-- > 0)
            solve();
    }
 
    public static void solve() {
        BigDecimal a = new BigDecimal(in.next());
        BigDecimal b = new BigDecimal(in.next());
        
        a = a.multiply(b);
        String ans = a.toString();
        System.out.println(ans.substring(0, ans.indexOf(".")));
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
 
    public static int max(int a, int b) {
        return a > b ? a : b;
    }
 
    public static int min(int a, int b) {
        return a < b ? a : b;
    }
 
    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


Measured memory_bytes: 33176
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);
	//const ll p = 1e9 + 7;
	//const ll p = 998244353;

	ll n;
	cin >> n;
	vector<vector<bool>> f(n, vector<bool>(10));
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < 10; j++) {
			ll x;
			cin >> x;
			f[i][j] = (x == 1);
		}
	}
	vector<vll> p(n, vll(11));
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < 11; j++) cin >> p[i][j];
	}

	vector<bool> v(10, false);
	v[9] = true;
	ll ans = -1e10;
	for (ll i = 0; i < 1023; i++) {
		ll subans = 0;
		for (ll j = 0; j < n; j++) {
			ll cnt = 0;
			for (ll k = 0; k < 10; k++) {
				if (f[j][k] && v[k]) cnt++;
			}
			subans += p[j][cnt];
		}
		ans = max(ans, subans);
		if (i == 1022) break;
		ll x = 9;
		while (x >= 0 && v[x]) {
			v[x] = false;
			x--;
		}
		v[x] = true;
	}
	cout << ans << endl;
}


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

//region Template
#include "ext/pb_ds/assoc_container.hpp"

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const int MOD = 1000000007;
using namespace std;
#define finish(x) cout << x; exit(0);
#define fastIO cin.tie(0); cin.sync_with_stdio(false);

void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

//const string USCAO_TAG = "mountains";
void usaco(const string& USACO_TAG) { setIn(USACO_TAG + ".in"); setOut(USACO_TAG + ".out"); }
/*
template<typename... Args>
void print(Args... args) {
	#ifdef LOCAL
	((std::cout << args << " "), ...);
	cout << endl;
	#endif
}
 */
//endregion

/* Notes:
 * Farah </3
 */

const int MAXN = 1e6 + 5;
const int INF = 2e9;

int main() {
	//usaco("milkvisits");

#ifdef LOCAL
	setIn("in.txt");
	setOut("out.txt");
#endif

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

	ll g = __gcd(a, b);
	set<int> ans;
	ans.insert(1);
	while (g % 2 == 0){
		g /= 2;
		ans.insert(2);
	}

	for (int i = 3; i <= sqrt(g); i += 2){
		while (g % i == 0){
			ans.insert(i);
			g /= i;
		}
	}

	if(g > 2){
		ans.insert(g);
	}

	cout << ans.size();
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


ll dp[202020][5];
int main(){
	int n;
	cin>>n;
	ll a[n];
	rep(i,n)cin>>a[i];
	rep(i,n){
		dp[i+1][0]=dp[i][0]+a[i];
		dp[i+1][1]=min(dp[i+1][0],min(dp[i][0],dp[i][1])+(a[i]==0)*2+a[i]%2);
		dp[i+1][2]=min(dp[i+1][1],min(dp[i][1],dp[i][2])+(a[i]+1)%2);
		dp[i+1][3]=min(dp[i+1][2],min(dp[i][2],dp[i][3])+(a[i]==0)*2+a[i]%2);
		dp[i+1][4]=min(dp[i+1][3],min(dp[i][3],dp[i][4])+a[i]);
	}
	cout<<dp[n][4]<<endl;
	return 0;
}

Measured memory_bytes: 9600
#include<iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

#define R 1000000007

using namespace std;

int main()
{
    int n;
    cin >> n;
    set<int> s;
    for(int i = 1; i <= 9; i++)
        for(int j = 1; j <= 9; j++)
            s.insert(i * j);
    if(s.find(n) != s.end())
        cout << "Yes\n";
    else 
        cout << "No\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  vector<string> s(3);
  rep(i, 3) cin >> s[i];
  string ans;
  ans.push_back(s[0][0]);
  ans.push_back(s[1][1]);
  ans.push_back(s[2][2]);
  cout << ans << endl;
  return 0;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  
   for(int i=0; i<M; i++) {
   int Ai;
   cin >> Ai;
   N -= Ai;
   }
  
  if(N >= 0){
  cout << N << endl;
  }
  else {
  cout << "-1" << endl;
  }
}


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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main(void){

  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  vint(A, N);

  int cnt = 0;
  REP(i, A.size()) if(A[i]%2==1) cnt++;
  if(cnt%2==0) cout << "YES" << endl;
  else cout << "NO" << endl;
  
  return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;

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

    int M;
    cin >> M;
    long long count = 0, sum = 0;

    for (int i = 0; i < M; i++) {
        int D;
        long long C;
        cin >> D >> C;
        count += C;
        sum += D * C;
    }

    cout << (count - 1) + (sum - 1) / 9 << '\n';
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using namespace std;


int main(){
  int X,Y,ans=0;
  cin>>X>>Y;
  
  if(X==1 && Y==1){
    co(1000000);
    return 0;
  }
  
  if(X==1) ans+=300000;
  if(Y==1) ans+=300000;
  if(X==2) ans+=200000;
  if(Y==2) ans+=200000;
  if(X==3) ans+=100000;
  if(Y==3) ans+=100000;
  
  co(ans);
}

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

int main() {
	int a,b;
	cin >> a >> b;
	if (a == 1 || b == 1) {
		if (a == b)
			cout << "Draw" << endl;
		else if (a == 1)
			cout << "Alice" << endl;
		else
			cout << "Bob" << endl;
	}
	else{
		if (a > b)
			cout << "Alice" << endl;
		else if (a < b)
			cout << "Bob" << endl;
		else
			cout << "Draw" << endl;
	}
}

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

cnt = 0

for num in range(a, b + 1):
    s = str(num)
    k = len(s) // 2
    isOk = True
    for c in range(k):
        if s[c] != s[-c-1]:
            isOk = False
            break
    
    if isOk:
        cnt += 1

print(cnt)

Measured memory_bytes: 3060
#define MYDEBUG
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>
#include <queue>
#include <set>
#include <cstdio>
#include <unordered_map>

#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
	out << "[";
	size_t last = v.size() - 1;
	for (size_t i = 0; i < v.size(); ++i) {
		out << v[i];
		if (i != last)
			out << ",";
	}
	out << "]";
	return out;
}

void solve() {
	int N, L;
	cin >> N >> L;
	string s[N];
	for (int i = 0; i < N; ++i) {
		cin >> s[i];
	}
	sort(s, s + N);
	string ans = "";
	for (int i = 0; i < N; ++i) {
		ans += s[i];
	}
	cout << ans << endl;
}
int main() {
	solve();
	return 0;
}


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

using namespace std;

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    for (int j = a; j % 2 == 0; j /= 2) {
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<complex>
using namespace std;

int main(){
  while(true){
    string x; cin >> x;
    if(x == "0") break;
    int ans = 0;
    for(int i = 0; i < x.size(); i++){
      ans += x[i] - '0';
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3132
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String T = sc.next();

        String sub = T.substring(0, T.length() - 1);

        if (S.equals(sub)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}




Measured memory_bytes: 35784
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  ll ans=1;
  ll div=INF+7;
  for(int i=1;i<N+1;i++){
    ans *= i;
    ans %= div;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Main main = new Main();
        main.solv();
    }
    
    private void solv() {
        Scanner input = new Scanner(System.in);
        while (true) {
            char[] cs = input.next().toCharArray();
            if (cs.length == 1 && cs[0] == '-') break;
            int m = input.nextInt();
            for (int i = 0; i < m; i++) {
                int h = input.nextInt();
                char[] temp = new char[h];
                for (int j = 0; j < h; j++) {
                    temp[j] = cs[j];
                }
                for (int j = h; j < cs.length; j++) {
                    cs[j - h] = cs[j];
                }
                for (int j = cs.length - h; j < cs.length; j++) {
                    cs[j] = temp[j - (cs.length - h)];
                }
            }
            System.out.println(cs);
        }
    }
}

Measured memory_bytes: 18096
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

cnt = {}
for ai in a:
    for c in ai:
        if c in cnt:
            cnt[c] += 1
        else:
            cnt[c] = 1
c1 = 0
c2 = 0
c4 = 0
for k, v in cnt.items():
    c4 += (v // 4) * 4
    c2 += ((v % 4) // 2) * 2
    c1 += v % 2

ans = "No"
if h % 2 == 0:
    if w % 2 == 0:
        if c4 == h * w:
            ans = "Yes"
    else:
        if c2 <= h and c1 == 0:
            ans = "Yes"
else:
    if w % 2 == 0:
        if c2 <= w and c1 == 0:
            ans = "Yes"
    else:
        if c2 <= h + w - 1 and c1 == 1:
            ans = "Yes"
print(ans)

Measured memory_bytes: 39280
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define FOR(i, s, n) for (int i = (s); i < (n); i++)
#define rep(i, n) FOR(i, 0, n)
#define repi(i, n) FOR(i, 1, n + 1)
#define pp(v) cout << #v "=" << (v) << endl;
#define ppa(v) cout << "----\n"; rep(i,v.size()) cout << #v << "[" << i << "] = " << v[i] << endl;
#define div_ceil(a,b) ((a) + ((b) - 1)) / (b)
using namespace std;
using Graph = vector<vector<int>>;
using Int = long long;

int main() {
  int a,b;cin>>a>>b;
  string s;cin>>s;
  bool ans = true;
  rep(i,s.size()) {
    if (i == a && s[i] != '-') ans = false;
    if (i != a && (s[i] < '0' || '9' < s[i])) ans = false;
  }
  cout << (ans?"Yes":"No") << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n;
ll a[200004],b[200004];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n+1;i++)scanf("%lld",&a[i]);
	for(int i=1;i<=n;i++)scanf("%lld",&b[i]);
    ll sum=0;
	for(int i=1;i<=n;i++){
        sum+=min(b[i],a[i]+a[i+1]);
        int g=min(a[i],b[i]);
        a[i]-=g;b[i]-=g;
        a[i+1]=max(a[i+1]-b[i],0LL);
	}
    printf("%lld\n",sum);
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
struct node{
	long long x;
	long long y;
};
node v[200010];long long n;long long sum,ans=1999999999,cnt;
long long a[200010],b[200010];long long maxn=-1,minn=1999999999;
long long minr=1999999999,minl=1999999999,maxl=-1,maxr=-1;
long long cmp(node a,node b)
{
	return a.x<b.x;
}
int main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	scanf("%lld%lld",&a[i],&b[i]);
	for(long long i=1;i<=n;i++)
	{
		if(a[i]>b[i])
		swap(a[i],b[i]);
		v[i].x=a[i];v[i].y=b[i];
		minl=min(a[i],minl);
		minr=min(b[i],minr);
		maxl=max(a[i],maxl);
		maxr=max(b[i],maxr);
	}
	sum=(maxl-minl)*(maxr-minr);
	minr=minl;
	sort(v+1,v+1+n,cmp);
	minn=maxn=v[1].y;
	for(long long i=2;i<=n;i++)
	{
		maxn=max(maxn,v[i].y);
		minn=min(minn,v[i].y);
		if(i!=n)
		ans=min(ans,max(maxn,v[n].x)-min(minn,v[i+1].x));
	}
	ans=ans*(maxr-minr);
	cnt=min(sum,ans);
	cout<<cnt;
	return 0;
} 

Measured memory_bytes: 6528
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
//		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
////		String line = reader.readLine();
//		String[] str = reader.readLine().split(" ");
//		int[] ab = new int[str.length];
//		for (int i = 0; i < str.length; i++) {
//			ab[i] = Integer.parseInt(str[i]);
//		}
//		if ((ab[0] > ab[2] && ab[2] > ab[1]) || (ab[0] < ab[2] && ab[2] < ab[1])) {
//			System.out.println("Yes");
//		}
//		else {
//			System.out.println("No");
//		}
		
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		int N = Integer.parseInt(line);
		String[] str = reader.readLine().split("");
		line = reader.readLine();
		int K = Integer.parseInt(line) -1;
		String[] re = new String[N];
		for (int i = 0; i < N; i++) {
			if (!str[i].equals(str[K])) {
				re[i] = "*";
			}
			else {
				re[i] = str[i];
			}
		}
		for (int i = 0; i < N; i++) {
			System.out.print(re[i]);
		}
		System.out.println();
	}
}

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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;

const int INT_INF = 2147483646;
const ll LL_INF = 9223372036854775807;

bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}

ll minll(ll a, ll b){
    if(a >= b)  return b;
    else    return a;
}

ll maxll(ll a, ll b){
    if(a >= b)  return a;
    else    return b;
}

ll n;
const int SIZE = 2e5+10;
ll a[SIZE],b[SIZE];
pair<ll,ll> ba[SIZE];

int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
        ba[i].first = b[i];
        ba[i].second = a[i];  
    }

    sort(ba,ba+n);
    ll tim = 0;
    for(int i = 0; i < n; i++){
        tim += ba[i].second;
        if(ba[i].first < tim){
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
}

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

int main(){
    int flag=1;
    int a,b;
    int di[5];
    int n,p,j;
    int ans=0;

    cin >>a>>b;
    
    for (int i = a; i <= b; i++){
        j=0;
        p=i;

        while (p>0){
            di[j] = (p%10);
            p /= 10;
            j++;
        }

        flag=1;
        for (int k = 0; k < 5; k++){
            if(di[k] != di[4-k])flag=0;
        }

        if(flag==1)ans++;
    }

    
    cout << ans <<endl;
    //cout <<fixed<<setprecision(16)<< ans <<endl;
    //if(flag==1)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


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

int main(){
	int a,b;
	while(cin>>a>>b){
		
		if( a<0||b<0||1000000<a||1000000<b)
			break;
		cout<<(int(log10(a+b))+1)<<endl;
	}
	return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vec<string> S(N);
    vec<int> T(N),A(N);
    int sum = 0;
    for(int i=0;i<N;i++){
        cin >> S[i] >> T[i];
        sum += T[i];
    }
    string X;
    cin >> X;
    int now = 0;
    for(int i=0;i<N;i++){
        now += T[i];
        if(S[i]==X) break;
    }
    cout << sum-now << endl;
}

Measured memory_bytes: 892
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N + 1), B(N + 1);
  for (int i = 0; i < N + 1; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < N; i++) {
    cin >> B[i];
  }
  ll score, attack;
  ll ans = min(A[0], B[0]);
  ll res = max(B[0] - A[0], 0LL);
  B[N] = 0;
  for (int i = 1; i < N + 1; i++) {
    if (A[i] <= res) {
      score = A[i];
      res = B[i];
    } else if (A[i] < B[i] + res) {
      score = A[i];
      res = max(B[i] - (A[i] - res), 0LL);
    } else {
      score = B[i] + res;
      res = 0;
    }
    ans += score;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,ans;
struct A{
	int id,val;
}a[100000+10];
bool cmp(A a,A b){
	return a.val<b.val;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i].val),a[i].id=i;
	sort(a+1,a+n+1,cmp);
//	for(int i=1;i<=n;i++)a[i].id=i;
	for(int i=1;i<=n;i++){
		if(abs(i-a[i].id)&1)ans++;
	}
	ans/=2;
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <vector>
using namespace std;
typedef long long LL;

int main(){
	LL a,b;
	cin >> a >> b;
	for(LL i = 0;i <= 200000;i ++){
		if(((i * 8) / 100 == a) && ((i * 10) / 100 == b)){
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n - 1; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define RFOR(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using namespace std;
const int INF32       = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7        = 1'000'000'007;
const int MOD9        = 1'000'000'009;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}

void fprint() { std::cout << '\n'; }
template <class H, class... T> void fprint(H &&head, T &&... args) {
    std::cout << std::fixed << std::setprecision(10) << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    fprint(std::forward<T>(args)...);
}

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

    int W, H, x, y;
    cin >> W >> H >> x >> y;

    double ans = (double)W * H / 2;
    int ok     = (2 * x == W && 2 * y == H) ? 1 : 0;
    fprint(ans, ok);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
using namespace std;


ll n,a,b;
vector<ll> h;



int check(ll t){
  vector<ll> v1 = h;
  ll ans;
  for(ll i = 0;i < n;i++)v1[i] -= b*t;
  for(ll i = 0;i < n;i++){
    if(v1[i] > 0){
      ans = v1[i]/(a-b);
      if(v1[i] % (a-b) != 0)ans++;
      t -= ans;
    }
  }
  if(t >=0)return 1;
  return 0;
}
int main(){
  ll inp;
  ll l,m,r;//left,middle,right
  
  cin >> n >> a >> b;
  for(ll i = 0;i<n;i++){
    cin >> inp;
    h.push_back(inp);
  }
  sort(h.begin(),h.end());

  l=0;
  r=h[n-1];


  while(l<r){
    m=(l+r)/2;
    if(check(m)==1)r=m;
    else l=m+1;
  }
  cout << l << endl;
  
  
}


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

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

    if(n == 25) cout << "Christmas" << endl;
    if(n == 24) cout << "Christmas Eve" << endl;
    if(n == 23) cout << "Christmas Eve Eve" << endl;
    if(n == 22) cout << "Christmas Eve Eve Eve" << endl;
    return 0;
}

Measured memory_bytes: 256
program main
  implicit none
  integer :: n, k, i, l(50), res
  read(*, *) n, k
  read(*, *) l(1:n)
  call insertion_sort(l(1:n))
  res = 0
  do i = n - k + 1, n
    res = res + l(i)
  end do
  write(*, "(i0)") res
  contains
  subroutine insertion_sort(s)
    implicit none
    integer, intent(inout) :: s(:)
    integer :: i, j, tmp
    do i = 2, size(s)  ! ループ終了時に [1, i] が昇順
      do j = i, 2, -1  ! i の位置にあった新要素が適切な位置に来るまで隣同士 swap
        if (s(j) >= s(j - 1)) exit
        tmp = s(j)
        s(j) = s(j - 1)
        s(j - 1) = tmp
      end do
    end do
  end subroutine insertion_sort
end program main


Measured memory_bytes: 256
#include <stdio.h>

 int main(void){
 int a, b, c;

 scanf("%d%d%d", &a, &b, &c);

int ispoor = 0;
 if (a == b && b != c) ispoor = 1;
 if (b == c && c != a) ispoor = 1;
 if (c == a && a != b) ispoor = 1;

if (ispoor) {puts("Yes");
} else {
 puts("No");
}

 return 0;
 }

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let m1 = (read::<usize>(), read::<usize>());
    let m2 = (read::<usize>(), read::<usize>());
    if m1.0 == m2.0 {
        println!("0");
    } else {
        println!("1");
    }
}



Measured memory_bytes: 4352
import re
s = input()
pattern = 'A[a-z]+C[a-z]+'

result = re.fullmatch(pattern, s)
# print(result)

if result == None:
    print('WA')
else:
    print('AC')

# if s[0] != 'A':
#     print('WA')
# elif s[1].isupper or s[-1].isupper:
#     print('WA')
# elif s.count('C') != 1:
#     print('WA')
# elif :


Measured memory_bytes: 9740
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7

bool but[20];


int main() {

	char S[20];
	scanf("%s", S);

	for (int i = 0; i < strlen(S); i++) {
		but[i] = true;
	}


	for (int i = 0; i < strlen(S) ; i++) {
		if (S[i] == 'B') {
			but[i] = false;
		}
	}

	for (int i = strlen(S) - 1; i > 0; i--) {
		if (S[i] == 'B') {
			for (int j = 1; i - j >= 0; j++) {
				if (but[i - j]) {
					but[i - j] = false;
					break;
				}
			}
		}
	}

	for (int i = 0; i < strlen(S); i++) {
		if (but[i]) {
			printf("%c", S[i]);
		}

	}







}



Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define forn(i,n) for(int i=0; i<(int)n; i++)
ll power(ll x,ll n);
bool isprime(ll n);

void test_case()
{
    ll n,q,b,c;
    cin>>n;
    ll a[n],sum=0;
    map<ll,ll> mp;
    for(ll i=0;i<n;i++) {
        cin>>a[i];
        sum+=a[i];
        mp[a[i]]++;
    }
    cin>>q;
    while(q--) {
        cin>>b>>c;
            sum=sum-b*mp[b]+c*mp[b];
            mp[c]+=mp[b];
            mp[b]=0;
            cout<<sum<<"\n";

    }
}

int main()
{
    fastio
//    int t;
//    cin>>t;
//    while(t--)
    test_case();
}
ll power(ll x,ll n)
{
    ll ans=1;
    while(n>0) {
        if(n&1)
            ans*=x;
        n>>=1;
        x*=x;
    }
    return ans;
}

bool isprime(ll n)
{
    if(n==2 || n==3)
        return true;
    if(n<=1 || n%2==0 || (n%6!=1 && n%6!=5))
        return false;
    for(int i=3;i*i<=n;i+=2) {
        if(n%i==0)
            return false;
    }
    return true;
}


Measured memory_bytes: 10300
#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 FOR(i, m, n) for(int i = m; i < n; i++)
#define MOD 1000000007
#define ll long long
#define MAX 1000010
using namespace std;

//fac=n!, finv=1/n!
ll fac[MAX], finv[MAX], inv[MAX];
 
void facmod() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

int main(){
  ll n,k;
  cin >> n >> k;
  ll a[n];
  REP(i,n) cin >> a[i];
  sort(a,a+n);
  ll ans = 0;
  ll max = 0;
  ll min = 0;
  
  facmod();
  FOR(i,k-1,n){
    max += a[i] * (fac[i] * (finv[k-1] * finv[i-k+1] % MOD) % MOD) % MOD;
    max %= MOD;
  }
  FOR(i,k-1,n){
    min += a[n-1-i] * (fac[i] * (finv[k-1] * finv[i-k+1] % MOD) % MOD) % MOD;
    min %= MOD;
  }
  //cout << min << " " << max << endl;
  
  ans = (max - min) % MOD;
  cout << ans;
  return 0;
}

Measured memory_bytes: 24448
n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort(reverse=True)

if n >= m:
    print(0)
    exit()

b = []
for i in range(m-1):
    b.append(abs(a[i+1]-a[i]))
b.sort(reverse=True)

for i in range(n-1):
    b.pop(0)

print(sum(b))

Measured memory_bytes: 13968
#include <iostream>
 
using namespace std;
 
int main(){
    int h, w;
    while (cin >> h >> w) {
        for (int i=0; i<h; i++) {
            for (int j=0; j<w; j++)
                cout << '#';
            cout << endl;
        }
        if (h) cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3080
import math
N = int(input())
capa = [0]*5
for i in range(5):
    capa[i] = int(input())

P = [0]*5
P[0] = capa[0]
No_G = [0]*5
No_G[0] = math.ceil(N/capa[0])
time = 4 + No_G[0]
for j in range(4):
    if capa[j+1]<capa[j] and P[j]>capa[j+1]:
        No_G[j+1] = math.ceil(N/capa[j+1])
        P[j+1] = capa[j+1]
        time += No_G[j+1] - No_G[j]
    else:
        P[j+1] = P[j]
        No_G[j + 1] = No_G[j]
print(time)

Measured memory_bytes: 3064
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))


n = int(input())

a = list(map(int, input().split()))

temp = 0
for i in range(n):
    temp += 1/a[i]
print(1/temp)





Measured memory_bytes: 9080
#include <iostream>
#include <bits/stdc++.h>
#include<vector>
#include<queue>

using namespace std;

int main()
{
    int n,m,a;
    long long sum=0,x;
    cin>> n >> m;
    for(int i =0; i< m;i++)
    {
        cin>>a;
        sum +=a;
    }
   x=n-sum;
   if(x < 0)
        cout << -1;
   else
    cout<< x;
  
    
	return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define FOR(i,n,m) for(int i=n; i<(int)m; i++)
#define ROF(i,n,m) for(int i=n; i>(int)m; i--)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define ri(a) scanf("%d",&a)
#define rii(a,b) ri(a),ri(b)
#define riii(a,b,c) rii(a,b),ri(c)
#define lri(a) scanf("%lld",&a)
#define lrii(a,b) lri(a),lri(b)
#define ms(obj,val) memset(obj,val,sizeof(obj))
#define all(x) x.begin(),x.end()
#define debug true
#define dprintf debug && printf

const int INF = 0x3f3f3f3f;
const ll INFLL = 1e18;
const int MOD = 1e9+7;
const int MAXN = 2e5+5;

int n, k;
int a[MAXN];

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

    rii(n,k);
    FOR(i,0,n) ri(a[i]);

    printf("%d\n", (n - 2) / (k-1) + 1);


    return 0;
}


Measured memory_bytes: 640
#include"bits/stdc++.h"
using namespace std;
int main(){
  map<string,int>Red,Blue;
  
  int n;cin >>n;
  vector<string> s(n);
  for(int i=0;i<n;i++){
    cin >> s[i];
    Red[s[i]]++;
  }
  int m;cin >> m;
  vector<string> t(m);
  for(int i=0;i<m;i++){
    cin >> t[i];
    Blue[t[i]]++;}
  int ans=0;
  for(int i=0;i<n;i++){
    int score=0;
    if(Red[s[i]]>0){
    score=Red[s.at(i)]-Blue[s.at(i)];
    }
    else{
      score=Red[s.at(i)];
    }
    if(ans<score){
      ans=score;
    }}
  cout << ans << endl;
  }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n, k;
    cin >> n >> k;
    vector<int> a(200000);
    int nums = 0;
    for (int i=0; i<n; i++) {
        int num;
        cin >> num;
        a.at(num-1)++;
    }
    
    sort(a.begin(), a.end());
    for (int i=0; i<a.size(); i++) {
        if (a.at(i) != 0) nums++;
    }
    int index = 0;
    int ans = 0;
    while (nums > k) {
    if (a.at(index) == 0) {
        index++;
        continue;
    }
      nums--;
      ans += a.at(index);
      index++;
    }
    
    cout << ans << endl;
    
    
    
    
}


Measured memory_bytes: 4044
N = int(input())
A = [int(input()) for i in range(N)]
maximum = max(A)
if A.count(maximum) != 1:
    for i in range(N):
        print(maximum)
else:
    B = A[:]
    B.remove(maximum)
    maximum_ne = max(B)
    for i in range(N):
        if A[i] == maximum:
            print(maximum_ne)
        else:
            print(maximum)

Measured memory_bytes: 14104
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

X = int(input())

costs = [105, 104, 103, 102, 101, 100]
for x in range(X):
    if 100 * x <= X <= 105 * x:
        print(1)
        quit()
print(0)

Measured memory_bytes: 9120