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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  string s;
  cin >> s;
  sort(all(s));
  if (s == "abc") {
    yes();
  } else {
    no();
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;

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

int main(){
    long long K, N;
    cin >> K >> N;

    long long A[N];
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }

    long long B[N] = {0};
    for(long long i = 1; i < N; i++){
        B[i] = A[i] - A[i-1];
    }
    B[0] = K + A[0] - A[N-1];

    sort(B, B + N);

    cout << K - B[N-1] << endl;

    return 0;
    
}

Measured memory_bytes: 3328
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(x: int):
    ret = (x // 11) * 2
    if (x % 11) <= 0:
        ret += 0
    elif (x % 11) <= 6:
        ret += 1
    else:
        ret += 2
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    x = int(next(tokens))  # type: int
    solve(x)

if __name__ == '__main__':
    main()


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

int main() {
  int N,B[1000005],sum = 0;
  cin >> N;
  int a;
  for(int i = 0;i<N-1;i++){
    cin >> a;
    B[i] = a;
    if(i == 0) sum+=B[i];
    else if(B[i] <= B[i-1]) sum+=B[i];
    else sum+=B[i-1];
  }
  sum += a;
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
const int inf = 1e5;
//typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
int main(){
  int n;  cin >> n;
  vector<pii> r(n), b(n);
  rep(i,0,n){
    int x,y;  cin >>x>>y;
    r[i] = mp(x,y);
  }
  rep(i,0,n){
    int x,y;  cin>>x>>y;
    b[i] = mp(y,x);
  }
  sort(all(r));
  sort(all(b));
  int cnt=0;
  bool used[n];
  rep(i,0,n){
    used[i] = false;
  }
  rep(i,0,n){
    for(int j=n-1 ; j>=0 ; j--){
      if(!used[j] && r[j].fi<b[i].se && r[j].se<b[i].fi){
        used[j] = true;
        cnt++;
        break;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
# だるいので強引

n = int(input())
d = {}
dd = {"M": 0, "A": 0, "R": 0, "C": 0, "H": 0}
for _ in range(n):
    s = input()
    if s[0] in list("MARCH") and s not in d:
        d[s] = True
        dd[s[0]] += 1

ans = 0
ans += dd["M"] * dd["A"] * dd["R"]
ans += dd["M"] * dd["A"] * dd["C"]
ans += dd["M"] * dd["A"] * dd["H"]
ans += dd["M"] * dd["R"] * dd["C"]
ans += dd["M"] * dd["R"] * dd["H"]
ans += dd["M"] * dd["C"] * dd["H"]
ans += dd["A"] * dd["R"] * dd["C"]
ans += dd["A"] * dd["R"] * dd["H"]
ans += dd["A"] * dd["C"] * dd["H"]
ans += dd["R"] * dd["C"] * dd["H"]
print(ans)


Measured memory_bytes: 22116
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
using namespace std;

//ABC 142B
int main() {
	int n, k;
	int a[100010];
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int count = 0;
	for (int i = 0; i < n; i++) {
		if (a[i] >= k) {
			count += 1;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 640
from operator import mul
from functools import reduce
from itertools import combinations, product

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

S_len = len(S)
N_first = int(S[0])

def combinations_count(n, r):
  if n < r:
    return 0
  r = min(r, n - r)
  numer = reduce(mul, range(n, n - r, -1), 1)
  denom = reduce(mul, range(1, r + 1), 1)
  return numer // denom

if K > S_len:
  print(0)
else:
  count = 0
  if K > 1:
    for l in combinations(range(1, S_len), K-1):
      for m in product('123456789', repeat=K-1):
        s = S[0] + '0' * (S_len - 1)
        for i in range(K-1):
          s = s[:l[i]] + m[i] + s[l[i]+1:]
        if int(s) <= N:
          count += 1
  else:
    count += 1
  count += (N_first-1) * combinations_count(S_len-1, K-1) * (9 ** (K-1))
  count += combinations_count(S_len-1, K) * (9 ** K)
  print(count)


Measured memory_bytes: 3572
#include<stdio.h>
int main(void)
{
    char o[51],e[51],s[101];
    int i=0,j=0;
    scanf("%s%s",o,e);
    while(1){
        s[j]=o[i];
        j++;
        if(o[i]=='\0')
            break;
        s[j]=e[i];
        if(e[i]=='\0')
            break;
        j++;
        i++;
    }
    s[j]='\0';
    printf("%s\n",s);
    return 0;
}

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
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;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// a^b mod M
long myPow(long a,long b,int M) {
    long ret = 1;
    long tmp = a;
    while(b>0) {
        if((b&1)==1) ret = (ret * tmp) % M;
        tmp = (tmp * tmp) % M;
        b = b>>1;
    }
    return ret;
}

 // nCk mod M
int nCk(int n,int k,int M) {
    long ret = 1;
    int mi = min(k, n-k);
    for(int i=1;i<=mi;i++) {
        ret = (ret * myPow(i,M-2,M)) % M;
    }
    for(int i=n-mi+1;i<=n;i++) {
        ret = (ret * i) % M;
    }
    return (int)ret;
};

int main() {
    ll X,Y;cin >> X >> Y;

    bool flg = true;
    if(X % Y == 0) {
        pl(-1)
        flg = false;
    } else {
        ll i = 1;
        while(i*X < (ll)1e18){
            if(i*X % Y != 0){
                pl(i*X)
                flg = false;
                break;
            }
            i++;
        }
    }

    if(flg) pl(-1)

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main() {
  constexpr ll mod = 1e9 + 7, lim = 1e5;
  ll n, m; cin >> n >> m;
  vector<ll> fac(lim+1, 0);

  fac[0] = 1;
  FOR(i, 1, lim+1) fac[i] = i * fac[i-1] % mod;

  if(n > m+1 || m > n+1){
    cout << 0 << endl;
    return 0;
  } else if(n == m){
    cout << 2 * fac[n] * fac[m] % mod << endl;
  } else {
    cout << fac[n] * fac[m] % mod << endl;
  }

  return 0;
}


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

int main() {
  ll a,b,n;
  cin>>a>>b>>n;
  ll ans;
  if(b>n){
    ans=(a*n)/b - a*(n/b);
  }else{
    ans=(a*(b-1))/b - a*((b-1)/b);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define ll long long
#define EPS 1e-9
#define rank asadf
using namespace std;

const int MAXN = 3e5 + 111;
const int MOD = 1e9 + 7;



int main() {
#ifdef LOCAL
    freopen("xxx.in", "r", stdin);
    freopen("xxx.out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    if (s[(int)s.size() - 1] == 's') {
        cout << s;
        cout << "es";
    } else {
        cout << s << "s";
    }
    return 0;
}


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

#pragma region datastructure binary indexed tree
/**
* @brief Binary Indexed Tree
* @docs docs/datastructure/binaryindexedtree.md
*/

template<typename T> struct BinaryIndexedTree {
    vector< T > data;
    BinaryIndexedTree(int sz) { data.assign(++sz, 0); }
    T sum(int k) {
        if (k < 0) return T(0);
        T ret = 0;
        for (++k; k > 0; k -= k & -k) ret += data[k];
        return (ret);
    }
    T sum(int l, int r) {
        assert(l <= r);
        return sum(r - 1) - sum(l - 1);
    }
    void add(int k, T x) {
        for (++k; k < data.size(); k += k & -k) data[k] += x;
    }
    int lower_bound(T w) {
        if (w <= 0) return 0;
        int n = data.size(), x = 0, r = 1;
        while (r < n) r <<= 1;
        for (int k = r; k > 0; k >>= 1) {
            if (x + k <= n and data[x + k] < w) {
                w -= data[x + k];
                x += k;
            }
        }
        return x + 1;
    }
};
#pragma endregion

const int INF = 1 << 30;
int N, A, B;

void end() {
    cout << -1 << endl;
    exit(0);
}

int LIS(const vector<int> &v) {
    int n = v.size();
    vector<int> dp(300010, INF);
    for (int i = 0; i < n; ++i) {
        *lower_bound(dp.begin(), dp.end(), v[i]) = v[i];
    }
    return lower_bound(dp.begin(), dp.end(), INF) - dp.begin();
}

int LDS(const vector<int> &v) {
    vector<int> tmp(v);
    for (auto& e: tmp) e *= -1;
    return LIS(tmp);
}

signed main() {
    cin >> N >> A >> B;
    if (A + B > N + 1) end();
    if (A == 1 and B < N) end();
    if (B == 1 and A < N) end();
    vector<vector<int>> v;
    for (int i = N - A + 1; i >= 1; i -= A) {
        vector<int> tmp;
        for (int j = i; j < i + A; ++j) {
            tmp.emplace_back(j);
        }
        v.emplace_back(tmp);
    }
    if (N % A) {
        vector<int> tmp;
        for (int i = 1; i <= N % A; ++i) {
            tmp.emplace_back(i);
        }
        v.emplace_back(tmp);
    }
    vector<int> up;
    for (int i = (int)v.size() - 1; i > 0; --i) {
        for (int j = 0; j + 1 < v[i].size(); ++j) {
            up.emplace_back(v[i][j]);
        }
    }
    int idx = B - 1 - (int)v.size();
    int num = idx == -1 ? -1 : up[idx];
    vector<int> res;
    for (auto& a: v) {
        for (auto& e: a) {
            if (e > num) {
                res.emplace_back(e);
            }
        }
    }
    for (int i = num; i >= 1; --i) {
        res.emplace_back(i);
    }
    if (LIS(res) != A) end();
    if (LDS(res) != B) end();
    for (int i = 0; i < N; ++i) {
        cout << res[i] << " \n"[i == N - 1];
    }
}


Measured memory_bytes: 13292
#include<stdio.h>
#define MAX 101

int count = 0;

void bubble_sort(int n,int *A){
  int i,j,tmp;
  for(i=0;i<n-1;i++){
    for(j=n-1;j>i;j--){
      if(A[j]<A[j-1]){
        tmp = A[j];
        A[j] = A[j-1];
        A[j-1] = tmp;
        count++;
      }
    }
  }
}

int main(){
  int n,i,j,tmp;
  int A[MAX];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]);
  bubble_sort(n,A);
  for(i=0;i<n-1;i++)
    printf("%d ",A[i]);
  printf("%d\n",A[i]);
  printf("%d\n",count);
  return 0;
}



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

using namespace std;

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a > b + c || b > a + c || c > a + b) {
		cout << "No" << endl;
	} else {
		if (a == b && b == c) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
function Main(input){
  const [W, H, x, y, r] = input.split(' ').map(Number);
  x + r <= W &&
  x - r >= 0 &&
  y + r <= H &&
  y - r >= 0 ? console.log('Yes') : console.log('No');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 19208
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;


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

	string S;
	cin >> S;
	map<char, bool> mp;
	rep(i,S.size()){
		mp[S[i]] = true;
	}
	if(mp['N'] == mp['S'] && mp['W'] == mp['E']) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#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;

int main() {
  ll q, h, s, d;
  cin >> q >> h >> s >> d;
  ll n;
  cin >> n;
  ll x = min({q * 8, h * 4, s * 2, d});
  ll y = min({q * 4, h * 2, s});
  cout << n / 2 * x + (n % 2) * y << endl;
  return 0;
} 

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

int main(){
    int N,W;
    cin >> N >> W;

    int dp[N+1][W+1];
    int w[N],v[N];
    for(int i=0;i<N;i++){
        cin >> v[i] >> w[i];
    }

    for(int i=0;i<=W;i++)   dp[N][i] = 0;

    for(int i=N-1;i>=0;i--){
        for(int j=0;j<=W;j++){
            if(j<w[i]){
                dp[i][j] = dp[i+1][j];
            }else{
                if(dp[i+1][j]>dp[i+1][j-w[i]]+v[i])
                    dp[i][j] = dp[i+1][j];
                else
                    dp[i][j] = dp[i+1][j-w[i]]+v[i];
            }
        }
    }

    cout << dp[0][W] << endl;

    return 0;
    
}


Measured memory_bytes: 7032
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int N=1e7+9;
ll d[N];
int main()
{
    FASTINOUT;
    for (int i=1; i<=1e7; i++)
    {
        for (int j=i; j<=1e7; j+=i)
            d[j]++;
    }
    ll x;
    cin>>x;
    ll ans=0;
    for (ll i=1; i<=x; i++)
        ans=ans+i*d[i];

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


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

int main() {
	int n,cnt=0;
	bool f=true;
	cin>>n;
	vector<int>v(n);
	for(int i=0;i<n;i++)cin>>v.at(i);
	while(f){
		for(int i=0;i<n;i++){
			if(v.at(i)%2!=0){
				f=false;
			}
		}
		if(f){
			for(int i=0;i<n;i++){
				v.at(i)/=2;
			}
			cnt++;
		}
	}
	cout<<cnt<<endl;
	return 0;
}



Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n = int(input())
s = [0] * n
t = [0] * n
for i in range(n):
    s[i], t_ = [x for x in input().strip().split()]
    t[i] = int(t_)
m = input().strip()
print(sum(t[s.index(m)+1:]))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
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;
}
int main() {
  cout << fixed << setprecision(10);
  int x,n;
  cin >> x >> n;
  map<int,int> mp;
  rep(i,n){
    int a;
    cin >> a;
    mp[a]++;
  }
  int ans = INF;
  int res;
  for(int i=0; i<=1000; i++){
    if(mp[i])continue;
    if(chmin(ans,abs(x-i))){
      res=i;
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 3676
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll A,B,C;
    cin >>A>>B>>C;
    if(A+B>=C){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }



    return 0;
    

}

Measured memory_bytes: 3612
// Crt. 2019-12-17  12:14:28
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <vector>
#define N 500005
using namespace std;
const int Mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

inline int fsp(int x, int p = Mod - 2) {
    int res = 1;
    while (p) {
        if (p & 1) res = 1ll * res * x % Mod;
        x = 1ll * x * x % Mod, p >>= 1;
    }
    return res;
}

int n, x, y, fa[N], d[N], fac[N], ifac[N];
vector<int> c[N], G[N];

inline int find(int u) {
    return fa[u] == u ? u : fa[u] = find(fa[u]);
}

inline void addE(int a, int b) {
    fa[find(a)] = find(b);
}

inline void check(int &a, int &ai, int &b, int &bi, int z, int zi) {
    if (z < b) swap(z, b), swap(zi, bi);
    if (b < a) swap(b, a), swap(bi, ai);
    if (z < b) swap(z, b), swap(zi, bi);
}

int main() {
#ifdef LOCAL_JUDGE
    freopen("work.in", "r", stdin);
    freopen("work.out", "w", stdout);
#endif

    cin >> n >> x >> y;
    
    for (int i = fac[0] = 1; i <= n; ++i)
        fac[i] = 1ll * fac[i - 1] * i % Mod, fa[i] = i;
    ifac[n] = fsp(fac[n]);
    for (int i = n; i >= 1; --i)
        ifac[i - 1] = 1ll * ifac[i] * i % Mod;

    for (int i = 1, u, v; i <= n; ++i)
        scanf("%d%d", &u, &v), c[u].push_back(v);

    int a = INF, b = INF, ai = 0, bi = 0, cnt = 0;
    for (int i = 1, tmp; i <= n; ++i) {
        if (!c[i].size()) continue;
        sort(c[i].begin(), c[i].end());
        check(a, ai, b, bi, c[i][0], (tmp = ++cnt)); d[cnt] = i;
        for (int j = 1, sz = c[i].size(); j < sz; ++j) {
            d[++cnt] = i;
            if (c[i][j] + c[i][0] <= x)
                addE(tmp, cnt);
        }
    } 
    

    cnt = 0;
    for (int i = 1, t, ti; i <= n; ++i) {
        if (!c[i].size()) continue;
        if (d[ai] == i) t = b, ti = bi;
        else t = a, ti = ai;
        for (int j = 0, sz = c[i].size(); j < sz; ++j) {
            ++cnt; if (c[i][j] + t <= y) addE(ti, cnt);
        }
    }

    for (int i = 1; i <= cnt; ++i)
        G[find(i)].push_back(d[i]);

    int ans = 1;

    for (int i = 1; i <= cnt; ++i) {
        if (!G[i].size()) continue;
        sort(G[i].begin(), G[i].end());
        int now = 0; ans = 1ll * ans * fac[G[i].size()] % Mod;
        for (int j = 0, sz = G[i].size(); j < sz; ++j) {
            if (j && G[i][j] != G[i][j - 1]) ans = 1ll * ans * ifac[now] % Mod, now = 1;
            else ++now;
        } ans = 1ll * ans * ifac[now] % Mod;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 40960
#[allow(unused_imports)]
use std::cmp;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    #[allow(unused_mut)]
    let mut s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  input! {
    n: usize,
    ab: [(i64, i64); n],
  }
  let sum = ab.iter().map(|&(a, _)| a).sum();
  let rem = ab.iter().filter(|&&(a, b)| a > b).fold(sum, |m, &(_, b)| cmp::min(m, b));

  println!("{}", sum - rem);
}


Measured memory_bytes: 4352
import java.util.Scanner;
 
public class Main {
 
	public static final MyScanner in = new MyScanner();
 
	public static void main(String[] args) {
 
		int N = in.nextInt();
		int M = in.nextInt();
		int[] A = new int[N];
		long total  = 0;
		for(int i=0;i<N;i++) {
			A[i] = in.nextInt();
			total += A[i];
		}
 
		int cnt = 0;
		double th = ((double)total) / (4*M);
		for(int i=0;i<N;i++) {
			if(A[i] >= th) cnt++;
		}
 
		System.out.println(cnt >= M ? "Yes" : "No");
	}
 
	public static class MyScanner {
		Scanner sc = new Scanner(System.in);
		String next() { return sc.next();}
		int nextInt() { return Integer.valueOf(sc.next());}
		long nextLong() { return Long.valueOf(sc.next()); }
	}
}

Measured memory_bytes: 22608
n = int(input())
a = [int(i) for i in input().split()]

b = {}
for i in a:
    if i in b:
        b[i] += 1
    else:
        b[i] = 1

c = 0
for i in b:
    c += b[i] * (b[i] - 1) // 2

for i in a:
    print(c-b[i]+1)

Measured memory_bytes: 86476
#include <bits/stdc++.h> 
#define FOR(i,a,b) for(int i=(a);i<=(b);++i) 
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i) 
#define REP(i,n) for(int i=0;i<(n);++i)
#define RREP(i,n) for(int i=(n);i>0;--i)
#define CI cin>> 
#define CO cout<<
#define EN <<endl 
#define all(x) (x).begin(),(x).end() 
#define asn ans
using namespace std;
template <typename T> istream& operator >> (istream& is, vector<T>& vec) { for (T& x : vec) is >> x; 	return is; }
using ll = long long;

int main() {
	int a, b, c; CI a >> b >> c;
	if (a == b)CO c EN;
	else if (a == c)CO b EN;
	else CO a EN;
	return 0;
}

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

ans = 0
if a<k:
    ans+=a
    k-=a
else:
    ans+=k
    k = 0

if b<k:
    k-=b
else:
    k = 0

if c<k:
    ans-=c
    k-=c
else:
    ans-=k
    k = 0

print(ans)

Measured memory_bytes: 9084
/*
	submission # - User: herp_sy
	https://atcoder.jp/contests/
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
#define TBMod 1000000007

// fact(n)
int fact(int n){
	if(n == 1)	return 1;
	else return (n * fact(n - 1));
}

// nCr(n,r)
TLong v[5003][5003];
TLong nCr(TLong n, TLong r){
	for(TLong i = 0; i <= n; ++i){
		for(TLong j = 0; j <= i; ++j){
			if(j == 0)  v[i][j] = 1;
			else  v[i][j] = v[i - 1][j - 1] + v[i - 1][j];
		}
	}
	return v[n][r];
}

// gcd(a,b)
int gcd(int a,int b){
	if(a == 0) return b;
	else if(b == 0) return a;
	else return gcd(b,a % b);
}

// lcm(a,b)
int lcm(int a,int b){
	return (a * b) / gcd(a,b);
}

// swap(&a, &b);
void swap(int *a,int *b){
	int tmp;
	tmp = *a;	*a = *b;	*b = tmp;
	return;
}

// qsort(array, size, sizeof(int),comp);
int ASC(const int *a,const int *b){
	return (*a - *b);
}

int DESC(const int *a,const int *b){
	return (*b - *a);
}

// append(array,*size,addNum)
void append(int *array,int *size,int num){
	realloc(array, sizeof(int) * (*size + 1));
	array[(*size)] = num;
	++(*size);
}

// pop(array,*size) & nongetpop(array,*size)
int pop(int *array,int *size){
	int temp = array[(*size - 1)];
	nongetpop(array,&(*size));
	return temp;
}

int nongetpop(int *array,int *size){
	realloc(array,sizeof(int) * (*size - 1));
	--(*size);
}

int main(int argc, char const *argv[])
{
	TLong n,p,a[50];
	TLong ans = 0;
	TLong odd = 0,even = 0;
	scanf("%lld%lld",&n,&p);
	for (TLong i = 0; i < n; ++i){
		scanf("%lld",&a[i]);
		if(a[i] % 2)	++odd;
		else ++even;
	}
	for (TLong i = p; i <= odd; i += 2)
	{
		for (TLong j = 0; j <= even; ++j)	ans += nCr(odd, i) * nCr(even, j);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int[] c = new int[26];
    for(int i = 0; i < s.length(); i++) {
      c[s.charAt(i) - 'a']++;
    }
    int a = 26;
    for(int i = 0; i < 26; i++) {
      if(c[i] == 0) {
        a = i;
        break;
      }
    }
    String ans = "None";
    if(a < 26) ans = String.valueOf((char)('a' + a)); 
    System.out.println(ans);
  }
}

Measured memory_bytes: 23508
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <set>
#define fast ios_base::sync_with_stdio(false)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vpi vector<pi >
#define vc vector<char>
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define fs first
#define se second
#define print(v) for(ll it=0;it<v.size();it++) cout<<v[it]<<" ";cout<<endl
#define printp(v) for(ll it=0;it<v.size();it++) cout<<v[it].first<<" "<<v[it].second<<endl
using namespace std;
int main(){
	ll m,k,n,i;
	cin>>m>>k;
	n=(1<<m);
	if(k>=n) return cout<<"-1\n",0;
	if(!m) return cout<<"0 0\n",0;
	if(m==1){
		if(k) return cout<<"-1\n",0;
		return cout<<"0 0 1 1\n",0;
	}
	for(i=0;i<n;i++) if(i-k) cout<<i<<" ";
	cout<<k<<" ";
	for(i=n-1;i>=0;i--) if(i-k) cout<<i<<" ";
	cout<<k<<endl;
}


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

#define fname ""
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define next dfg

using namespace std;

typedef long double ld;
typedef long long ll;
const int maxn = (2e5) + 10;
const int INF = (1e9);
const ll inf = (1e18);
const double eps = (1e-9);
const ld pi = acos(-1);
const ll mod=(ll)(1e9)+7;
ll a,b,c,d,n,ans;
int main() {    
	ios_base::sync_with_stdio(false);
 	cin.tie(0);
//	freopen(fname".in", "r", stdin);
//	freopen(fname".out", "w", stdout);
	cin>>a>>b>>c>>d>>n;
	a*=4;
	b*=2;
	if(d<2*c&&d<2*a&&d<2*b){
		ans+=(n/2)*d;
		n%=2;
		if(n)
		ans+=min(a,min(b,c));
	}else{
		ans+=n*(min(a,min(b,c)));
	}
	cout<<ans;
	return 0;
}






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

int main() {
  ll n,m; cin >> n >> m;
  vector<ll>v(m);
  for(ll i = 0; i<m; i++){
    cin >> v[i];
  }
  ll sum = accumulate(v.begin(),v.end(),0);
  if(n>=sum) cout << n-sum << endl;
  else cout << "-1" << endl;
  
    
  
  return 0;
}

Measured memory_bytes: 3664
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A <= B:
    maxA = A + V * T
    maxB = B + W * T
    if maxA >= maxB:
        print("YES")
    else:
        print("NO")
else:
    maxA = A - V * T
    maxB = B - W * T
    if maxA <= maxB:
        print("YES")
    else:
        print("NO")


Measured memory_bytes: 9184
#include <stdio.h>

char room[100][100 + 1];
int n, m, d;

int solve_eew(){
	int i, j;
	int chain;
	int x = 0;
	
	for (i = 0; i < n; i++) {
		chain = 0;

		for (j = 0; j < m; j++) {
			if (room[i][j] == '.') {
				chain++;
			} else {
				chain = 0;
			}
			if (chain >= d) x++;
		}
	}
	return x;
}

int solve_nns(){
	int i, j;
	int chain;
	int x = 0;

	for (j = 0; j < m; j++) {
		chain = 0;

		for (i = 0; i < n; i++) {
			if (room[i][j] == '.') {
				chain++;
			} else {
				chain = 0;
			}
			if (chain >= d) x++;
		}
	}
	return x;
}

int main(void){
	int i;
	scanf("%d%d%d", &n, &m, &d);
	for (i = 0; i < n; i++) {
		scanf("%s", room[i]);
	}
	printf("%d\n", solve_nns() + solve_eew());
	return 0;
}

Measured memory_bytes: 608
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


int distance(int x1,int y1,int x2,int y2) {
	return abs(x1-x2) + abs(y1-y2);	
}
int gen_x(int x,int i) {
	if (x % (i) == 0) {
		return i;
	}else {
		return x % (i);
	}
}
int gen_y(int y,int i) {
	if (y % i == 0) {
		return y / i;
	}else {
		return (y / i) + 1;
	}
}
int main() {

	int n; cin >> n;
	int a,b,c,d; cin >> a >> b >> c >> d;
	int ans = n * n;

	for (int i = 1; i <= n; i++) { //i : i 番目で段ずれ
		//int w = i;
		//int h = (n/i)+(n%i);
		int ax = gen_x(a ,i),ay = gen_y(a , i);
		int bx = gen_x(b ,i),by = gen_y(b , i);
		int cx = gen_x(c ,i),cy = gen_y(c , i);
		int dx = gen_x(d ,i),dy = gen_y(d , i);
		//cout << dx << " " << dy << endl;
		//cout << ax << " " << bx << " " << cx << " " << dx << endl;
		//cout << ay << " " << by << " " << cy << " " << dy << endl;
		ans = min(ans , distance(ax,ay,bx,by) + distance(cx,cy,dx,dy));
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3128
#include <iostream>
#include<vector>
using namespace std;
typedef pair<int,int> P;
vector<P> v;
int n,N;
int main(void){
    cin>>n;
    N=n/2*2+1;
    for(int i=1;i<n;i++){
        for(int j=i+1;j<=n;j++){
            if(i+j!=N)v.push_back({i,j});
        }
    }
    cout<<v.size()<<endl;
    for(auto x:v)cout<<x.first<<" "<<x.second<<endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
   int N,D;
   cin>>N>>D;

   vector<vector<int>> X(N,vector<int>(D));
   for(int i=0;i<N;i++){
      for(int j=0;j<D;j++){
         int k;
         cin>>k;
         X.at(i).at(j)=k;
      }
   }

   int count=0;
   for(int i=0;i<N-1;i++){
      for(int j=i+1;j<N;j++){
         double dis=0;
         for(int d=0;d<D;d++){
            int a=(X.at(j).at(d) - X.at(i).at(d));
            a*=a;
            dis+=a;
         }
         dis=sqrt(dis);
         if(floor(dis)==dis)
            count++;
      }
   }
   cout<<count<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/detail/standard_policies.hpp>
 
    using namespace std;
    using namespace __gnu_pbds;
 
    #define endl "\n"
    #define fi first
    #define se second
    #define pb push_back
    #define int long long 
    #define ll long long
    #define ld long double
    #define pii pair<ll,ll>
 
    #define read(t) ll t;cin>>t;
    #define all(x) x.begin(),x.end()
    #define f(a,b,c) for(ll a=b;a<c;a++)
    #define For(i,n) for(ll i=0;i<n;i++)
 
    #define what(x) cerr << #x << " is " << x << endl;
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) ;
 
    typedef tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> omultiset;
    typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> oset;
    typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> oset1;
 
/*.....................................................................................................................*/
 
    const ll mod=(ll)1e9+ 7;
 
    ll add(ll x,ll y) {return (x+y)%mod;}
    ll mult(ll x, ll y){return ((x%mod )* (y%mod)) % mod;}
 
    long long binpow(long long x, long long p) 
    {
        if (p == 0) {return 1;} 
    	if (p == 2 || (p & 1)) {return mult(x, binpow(x, p - 1));}
    	return binpow(binpow(x, p / 2), 2);
    }
    ll modinv(ll a) {return binpow(a,mod-2);}
 
    //A.erase(unique(A.begin(),A.end()),A.end());
    double pi=3.141592653589793238462641;
    ll dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
    const ll  man  =   (int)200005   ,  inf   =   1e18;
 
 
/*......................................................................................................................*/



signed main()
{
    fast;
    int n;
    cin>>n;
    ll sum=0, a[n];
    for(ll i=1-1;i<=n-1;i++)cin>>a[i],sum+=a[i];
    vector<vector<ll>>dp(n,vector<ll>(n));
    for(int i=n-1;i>=0;i--)
    {
        for(int j=i;j<=n-1;j++)
        {
            if(i==j)
            {
                dp[i][i]=a[i];
            }
            else
            {
                dp[i][j]=max(-dp[i][j-1]+a[j],-dp[i+1][j]+a[i]);
            }
        }
    }
    cout<<(dp[1-1][n-1])<<endl;
}   

Measured memory_bytes: 73684
N = int(input())
A = sorted([(i, int(a)) for i, a in enumerate(input().split())], key=lambda x: x[1])[::-1]
dp = [[0] * (N+1) for _ in range(N+1)]  # 先頭からi+j人使ったときに(左にi人, 右にj人) => 最大の嬉しさ
cnt = 0
for k, a in A:
    for i in range(N):
        j = cnt - i
        if j < 0:
            continue
        # 左に移動
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] + a*max(0, k-i))
        # 右に移動
        dp[i][j + 1] = max(dp[i][j + 1], dp[i][j] + a * max(0, (N - 1) - j - k))
    cnt += 1
ans = 0
for i in range(N+1):
    ans = max(ans, dp[N-i][i])

print(ans)


Measured memory_bytes: 105840
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var n int
	fmt.Scan(&n)

	s := strconv.Itoa(n)

	for _, v := range s {
		if v == '9' {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}


Measured memory_bytes: 1772
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

//#include <tuple>

//#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int main() {
  int N, M;
  cin >> N >> M;

  if (N==M) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
#define all(a) (a).begin(),(a).end()
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  cout << c << " " << a << " " << b << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cout << #x " => " << (x) << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 28;
constexpr lint   INFL = 1LL << 60;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

vector<vector<vector<lint>>> dp;
int main(void) {
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  rep (i, n) cin >> h[i];
  h.insert(h.begin(), 0);
  // dp[i個目まで見た][現在の高さがh2[j]][l個選んだ]
  dp.assign(n + 1, vector<vector<lint>>(n + 1, vector<lint>(n + 1, LLONG_MAX)));
  dp[0][0][0] = 0;
  rep (i, n) {
    rep (j, i + 1) {
      rep (l, i + 1) {
        if (l > k) break;
        lint now = dp[i][j][l];
        if (now == LLONG_MAX) continue;
        dp[i + 1][j][l + 1] = min(dp[i + 1][j][l + 1], now);
        dp[i + 1][i + 1][l] = min(dp[i + 1][i + 1][l], now + max(0, h[i + 1] - h[j]));
      }
    }
  }
  lint mini = LLONG_MAX;
  rep (i, n + 1) {
    rep (j, k + 1) {
      lint tmp = dp[n][i][j];
      mini = min(mini, tmp);
    }
  }
  cout << mini << endl;
  return 0;
}

Measured memory_bytes: 216960
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int n,m;

    cin >> n >> m;


    if(m < n){
        cout << "No" <<endl;
    }else {
        cout <<"Yes" <<endl;
    }

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import numpy as np

def pair(N):
    b=int(N)%10
    a=int(N)
    k=a//10
    while k!=0:
        a=k%10
        k=k//10
    return a,b
N=int(input())
P=np.zeros((10,10),dtype=np.int32)
ans=0
for i in range(1,N+1,1):
    a,b=pair(i)
    P[a][b]+=1
for i in range(1,10,1):
    for j in range(1,10,1):
        ans+=P[i][j]*P[j][i]
print(ans)


Measured memory_bytes: 14424
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    rep(i,n){
        cin>>a[i];
    }
    int max=0;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            int sa = abs(a[i]-a[j]);
            if(sa>max){
                max = sa;
            }
        }
    }
    cout<<max<<endl;
}

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

using namespace std;

using int64 = long long;
const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int64 N, A, B;
  cin >> N >> A >> B;

  N %= 12;
  for(int i = 0; i < N; i++) {
    if(i & 1) {
      int64 X = A + B;
      B = X;
    } else {
      int64 X = A - B;
      A = X;
    }
  }
  cout << A << " " << B << endl;
}


Measured memory_bytes: 3212
from itertools import permutations
import math

def dist(x1, y1, x2, y2):
  ans = math.sqrt((x1-x2)**2 + (y1-y2)**2)
  return ans

N = int(input())
town = [list(map(int, input().split())) for i in range(N)]
p_town = list(permutations(town, N))
d = [0]*(len(p_town))

#print(p_town)
for i in range(len(p_town)):
  for j in range(N-1):
    dick = p_town[i][j] + p_town[i][j+1]
    d[i] += dist(*dick)
#print(d)

avg = sum(d)/len(d)
print(avg)

Measured memory_bytes: 9252
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    int N;
    cin >> N;
    long A[N];
    for(int i=0; i<N; i++) cin >> A[i];
    long l = *max_element(A, A + N);
    long r = 0;
    long ans;
    for(int i=0; i<N; i++){
        if (r < min(l-A[i], A[i])){
            ans = A[i];
            r = min(l-A[i], A[i]);
        }
    }
    cout << l << " " << ans << endl;
    return 0;
}

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

int main() {
  int N,K;
  cin >> N >> K;
  int d = 0;
  
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    if (x < (K-x) || x < (x -K )){
      d += 2*x;
    }
    else if ((K-x) >= 0){
      d += 2*(K-x);
    }
    else
      d += 2*(x-K);
  }
  cout << d << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <bitset>
using namespace std;

const int MAX_N = 3000 + 1;
double dp[MAX_N][MAX_N];
double p[MAX_N];

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

  int N;
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> p[i];

  dp[0][0] = 1.0;
  
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= N; j++) {
      dp[i][j] += dp[i - 1][j - 1] * p[i];
      dp[i][j] += dp[i - 1][j] * (1.0 - p[i]);
    }
  }

  double ans = 0.0;
  for (int j = N/2 + 1; j <= N; j++) ans += dp[N][j];
  printf("%0.12lf\n", ans);
  
  return 0;
}







Measured memory_bytes: 73512
using System;

namespace abc167A
{
  public class MainClass
  {
    public static void Main()
    {
      string S,T,ans;
      S = Console.ReadLine();
      T = Console.ReadLine();
      T = T.Remove(T.Length - 1,1);
      if(S == T){Console.WriteLine("Yes");}
      else{Console.WriteLine("No");}
    }
  }
}

Measured memory_bytes: 25852
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

int main() {
    ll k,sum = 0,ans = 0;
    cin >> k;
    for (int i = 1; i <= k; ++i) {
        for (int j = 1; j <= k; ++j) {
            for (int l = 1; l <= k; ++l) {
                ans = gcd(ans,l);
                ans = gcd(ans,j);
                ans = gcd(ans,i);
                sum += ans;
                ans = 0;
            }
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    string s;
    int q;
    cin >> s >> q;
    string c, l;
    int t, f;
    bool flag = false;
    for (int i = 0; i < q; i++) {
        cin >> t;
        if (t == 1) {
            if (flag) flag = false;
            else flag = true;
        } else {
            cin >> f >> c;
            if (f == 1) {
                if (flag) s += c;
                else {
                    l += c;
                }
            } else {
                if (flag) {
                    l += c;
                } else s += c;
            }
        }
    }
    reverse(l.begin(), l.end());
    l += s;
    if (flag) reverse(l.begin(), l.end());
    cout << l << endl;
}

Measured memory_bytes: 1128
#include <bits/stdc++.h>
using namespace std;
int dp[100005];
vector<int> adj[100005];
bool vis[100005];

int depth(int node) {
    
    if(dp[node]!=0) return dp[node];
    
    vis[node] = true;
    
    int mx = 0;
    
    for(int v:adj[node]){
        mx = max(mx,depth(v));    
    }
    
    return dp[node] = 1 + mx;
}

int main() 
{
    int n, m, x, y;
    cin >> n >> m;
    
    for(int i=0;i<m;i++){
        cin >> x >> y;
        adj[x].push_back(y);
    }
    
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            depth(i);
        }
    }
    
    int ans = 0;
    
    for(int i=1;i<=n;i++) ans = max(ans, dp[i]);
    
    cout<<ans-1<<endl;
	return 0;
}

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

typedef long long lint;

int main(){
    int N;
    lint A[200001],I[200001],L[200001],R[200001];
    set<lint> S;
    cin >> N;
    for(int i=1;i<=N;i++){
        cin >> A[i];
        I[A[i]]=i;
    }
    S.insert(0);
    S.insert(N+1);
    for(int i=1;i<=N;i++){
        S.insert(I[i]);
        auto it=S.find(I[i]);
        L[i]=*(--it)+1;
        R[i]=*(++(++it))-1;
    }
    lint sum=0;
    for(int i=1;i<=N;i++){
        sum+=(I[i]-L[i]+1)*(R[i]-I[i]+1)*i;
    }
    cout << sum << endl;

    return 0;
}//

Measured memory_bytes: 15872