akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <math.h>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

int main(void)
{
    int w[10], k[20],W,K,w1,w2,w3,k1,k2,k3;

    for (int i = 0; i < 10; i++)
    {
        cin >> w[i];
    }

    for (int i = 0; i < 10; i++)
    {
        cin >> k[i];
    }

    k1 = 0; k2 = 0; k3 = 0;
    w1 = 0; w2 = 0; w3 = 0;

    for (int i = 0; i < 10; i++)
    {
        if (w[i] >= w1)
        {
            w3 = 0; 
            w3 = w2;
            w2 = 0;
            w2 = w1;
            w1 = 0;
            w1 = w[i];
        }
        else if (w[i] >= w2)
        {
            w3 = 0;
            w3 = w2;
            w2 = 0;
            w2 = w[i];
        }
        else if (w[i] >= w3)
        {
            w3 = 0;
            w3 = w[i];
        }
        if (k[i] >= k1)
        {
            k3 = 0; 
            k3 = k2;
            k2 = 0; 
            k2 = k1;
            k1 = 0;
            k1 = k[i];
        }
        else if (k[i] >= k2)
        {
            k3 = 0;
            k3 = k2;
            k2 = 0;
            k2 = k[i];
        }
        else if (k[i] >= k3)
        {
            k3 = 0;
            k3 = k[i];
        }

    }
        cout << w1 + w2 + w3 << " " << k1 + k2 + k3 << endl;
}

Measured memory_bytes: 3084
using System;
using System.Collections.Generic;
using System.Linq;
    class Program
    {
        static void Main(string[] args)
        {
            var ABC = Console.ReadLine().Split(' ').Select(s=>int.Parse(s)).ToList();
            Console.WriteLine(Solve(ABC, 0));
        }

        static private int Solve(List<int> inputs,int count)
        {
            if (inputs[0] == inputs[1] && inputs[0] == inputs[2]) return count;
            var sorted = inputs.OrderBy(i => i).ToList();
            if(sorted[0]==sorted[1])
            {
                sorted[0]++;
                sorted[1]++;
                return Solve(sorted, count+1);
            }
            sorted[0] += 2;
            return Solve(sorted, count + 1);
        }
    }

Measured memory_bytes: 13396
#include <cstdio>
#include <vector>
#include <numeric>

using namespace std;

int main() {
    char c;
    vector<int> d(4);
    for (int i = 0; i < 4; ++i) {
        scanf("%c", &c);
        d.at(i) = c - '0';
    }
    int t = (accumulate(d.begin(), d.end(), 0) - 7) / 2;
    printf("%d", d.at(0));
    for (int i = 0; i < (1 << 3); ++i) {
        int sum = 0;
        for (int j = 1; j < 4; ++j) if (i & (1 << (j - 1))) sum += d.at(j);
        if (sum == t) {
            for (int j = 1; j < 4; ++j) printf("%c%d", (i & (1 << (j - 1))) ? '-' : '+', d.at(j));
            printf("=7\n");
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c,d,e,f;
    while(cin>>a>>b)
    {
        c=a/500;
        if((c*500)+b>=a)
        {
            cout<<"Yes"<<endl;
        }
        else
        {
            cout<<"No"<<endl;
        }



    }




    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>

using namespace std;
int main(){
  int s;
  cin>>s;
  int result=1;
  set<int> st;
  while(true){
    if(st.count(s)>=1) break;
    st.insert(s);
    result++;
    if(s%2==0)s/=2;
    else s=3*s+1;
  }
  cout<<result<<endl;
  return 0;
}

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

def f():
    global a
    cnt = 1 + (n%2)
    if n%2 == 1:
        if a[0] != 0:
            return 0
        a = a[1:]

    # check
    for i in range(len(a)):
        if a[i] != cnt:
            return 0

        if i%2 == 1:
            cnt+=2

    return 2**(n//2)

print(f()%(10**9+7))



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

const int maxn = 0x7fffffff;
const int maxnode = 1 << 19;
const int INF = 1000000000;

int y1, y2, x, v;

struct IntervalTree
{
    int sumv[maxnode], setv[maxnode];

    // 维护信息
    void maintain(int o, int L, int R)
    {
        int lc = o * 2, rc = o * 2 + 1;
        if(R > L)
        {
            sumv[o] = sumv[lc] + sumv[rc];
        }
        if(setv[o] >= 0)
        {
            sumv[o] = setv[o] * (R - L + 1);
        }
    }

    // 标记传递
    void pushdown(int o)
    {
        int lc = o * 2, rc = o * 2 + 1;
        if(setv[o] >= 0)
        {
            setv[lc] = setv[rc] = setv[o];
            setv[o] = -1; // 清除本结点标记
        }
    }

    void update(int o, int L, int R)
    {
        int lc = o * 2, rc = o * 2 + 1;
        if(y1 <= L && y2 >= R)   // 标记修改
        {
            setv[o] = v;
        }
        else
        {
            pushdown(o);
            int M = L + (R - L) / 2;
            if(y1 <= M) update(lc, L, M);
            else maintain(lc, L, M);
            if(y2 > M) update(rc, M + 1, R);
            else maintain(rc, M + 1, R);
        }
        maintain(o, L, R);
    }

    void query(int o, int L, int R, int &ssum)
    {
        int lc = o * 2, rc = o * 2 + 1;
        maintain(o, L, R); // 处理被pushdown下来的标记
        if(y1 <= L && y2 >= R)
        {
            ssum = sumv[o];
        }
        else
        {
            pushdown(o);
            int M = L + (R - L) / 2;
            int lsum = 0;
            int rsum = 0;
            if(y1 <= M) query(lc, L, M, lsum);
            else maintain(lc, L, M);
            if(y2 > M) query(rc, M + 1, R, rsum);
            else maintain(rc, M + 1, R);
            ssum = lsum + rsum;
        }
    }
};
/*
3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0
1 1
*/
int n, q;
IntervalTree tree;


int main()
{
	scanf("%d %d", &n, &q);
	tree.setv[1] = maxn;
	for (int i = 0; i < q; ++i)
	{
		int op;
		scanf("%d", &op);
		if (!op)
		{
			scanf("%d %d %d", &y1, &y2, &v);
			++y1;
			++y2;
			tree.update(1, 1, n);
		}
		else
		{
			int loc;
			scanf("%d", &loc);
			++loc;
			y1 = y2 = loc;
			int gsum = 0;
            int ssum;
            tree.query(1, 1, n, ssum);
            gsum += ssum;
            printf("%d\n", gsum);
		}
	}
	return 0;
}


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

int n;

int main() {
  cin >> n;
  int res = 1, sum = 1;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    res *= 2 - (a & 1);
    sum *= 3;
  }
  cout << sum - res << endl;
  return 0;
}


Measured memory_bytes: 3612
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce



sys.setrecursionlimit(2147483647)
INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007



def fib(n):
    a, b = 1, 1
    fib_list = [1] * n
    for i in range(n - 2):
        a, b = a + b, a
        fib_list[i + 2] = a
    return fib_list



h, w, k = LI()
L = [0] + fib(w + 1)
dp = [[0] * w for _ in range(h + 1)]
dp[0][0] = 1
for i in range(h):
    for j in range(w):
        dp[i + 1][j - 1] = (dp[i + 1][j - 1] + dp[i][j] * L[j] * L[w - j]) % mod
        if j + 1 < w:
            dp[i + 1][j + 1] = (dp[i + 1][j + 1] + dp[i][j] * L[j + 1] * L[w - j - 1]) % mod
        dp[i + 1][j] = (dp[i + 1][j] + dp[i][j] * L[j + 1] * L[w - j]) % mod



print(dp[-1][k - 1])



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



int main() {
    int N;
    cin >> N;
    int num = 0;
    for (int i = 0; i <= 10; i++) {
        if (1000*i >= N) {
            num = i;
            break;
        }
    }
    cout << num*1000 - N << endl;
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#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 REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))

using namespace std;

int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


ll m = 1000000007;

const int MOD = 1000000007;

ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

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



long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}



int main() {
	ll X,Y;cin>>X>>Y;
	if(abs(X-Y)<=1){
		cout<<"Brown"<<endl;
	}
	else cout<<"Alice"<<endl;
}


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

using namespace std;
int main(int argc, const char * argv[]) {
    vector<int> dishes(5, 0);
    for(int i = 0; i < 5; i++) {
        cin >> dishes[i];
    }
    
    int max_wait = 0;
    int max_wait_i = 0;
    for(int i = 0; i < 5; i++) {
        if(dishes[i] % 10 == 0) {
            continue;
        }
        int wait = 10 - (dishes[i] % 10);
        if(max_wait < wait) {
            max_wait = wait;
            max_wait_i = i;
        }
    }
    
    int temp = dishes[4];
    dishes[4] = dishes[max_wait_i];
    dishes[max_wait_i] = temp;
    
    int t = 0;
    for(int i = 0; i < 5; i++) {
        int v = dishes[i];
        t += v;
        if(i == 4) {
            break;
        }
        int t_mod = t % 10;
        if(t_mod != 0) {
            t += (10-t_mod)
            ;
        }
    }
    cout << t << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n,c=map(int,input().split())
    X=[0]*n; V=[0]*n
    for i in range(n):
        X[i],V[i]=map(int,input().split())

    revX=[c-x for x in X]
    revV=V[:]

    for i in range(n-1):
        V[i+1]+=V[i]
    for i in range(n):
        V[i]-=X[i]

    maxV=V[:]
    for i in range(n-1):
        maxV[i+1]=max(maxV[i+1],maxV[i])


    for i in range(n-1,0,-1):
        revV[i-1]+=revV[i]
    for i in range(n-1,-1,-1):
        revV[i]-=revX[i]

    maxrevV=revV[:]
    for i in range(n-1,0,-1):
        maxrevV[i-1]=max(maxrevV[i-1],maxrevV[i])

    # 片方向だけ使った場合の最大を取っておく
    ans=max(max(maxV),max(maxrevV),0)

    # forward に i, backwardに最大 i+1 まで行く時の場合を試す
    for i in range(n-1):
        ans=max(ans,V[i]+maxrevV[i+1]-X[i])

    # backward に i, forwardに最大 i-1 まで行く時の場合を試す
    for i in range(1,n):
        ans=max(ans,revV[i]+maxV[i-1]-revX[i])

    print(ans)
resolve()

Measured memory_bytes: 49628
#include <atcoder/convolution>
#include <atcoder/modint>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using mint = atcoder::modint998244353;

int main(void) {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<mint> A(N);
  rep(i, N) {
    int a;
    cin >> a;
    A[i] = a;
  }
  vector<mint> B(M);
  rep(i, M) {
    int b;
    cin >> b;
    B[i] = b;
  }

  vector<mint> C = atcoder::convolution(A, B);
  rep(i, N + M - 1) {
    if (i != 0) cout << " ";
    cout << C[i].val();
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 19020
N=[int(e) for e in input().split()]

A=[int(e) for e in input().split()]

flg=0

for i in A:
  if i%2==0:
    if (i%3!=0) and (i%5!=0):
      flg=1
      
if(flg==1):
  print("DENIED")
else:
  print("APPROVED")  

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

int main(){
  string S;
  cin>>S;
  int count=0;
  for(int i=0;i<S.size();i=i+2){
    if(S.at(i)=='R' || S.at(i)=='U' || S.at(i)=='D'){
      ++count;
    }
  }
  for(int i=1;i<S.size();i=i+2){
    if(S.at(i)=='L' || S.at(i)=='U' || S.at(i)=='D'){
      ++count;
    }
  }

  if(count==S.size()){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

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

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

using namespace std;

bool check(string s) {
  int sum = 0;
  rep(i,(int)s.size()-1) {
    int n = 11 - i;
    int Q = ((1<=n&&n<=6)?n+1:n-5);
    int P = s[i] - '0';
    sum += ( P * Q );
  }
  sum %= 11;
  int v = 11 - sum;
  if( sum <= 1 ) v = 0;
  return (s[(int)s.size()-1]-'0') == v;
}


int main() {
  string s;
  cin >> s;
  int cnt = 0, succ;
  rep(i,(int)s.size()) if( s[i] == '?' ) {
    rep(v,10) {
      s[i] = (char)('0'+v);
      if( check(s) ) {
        ++cnt;
        succ = v;
      }
    }
    break;
  }
  if( cnt == 1 ) cout << succ << endl;
  else           cout << "MULTIPLE" << endl;
  return 0;
}

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

void solve()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    int ans = 0;
    rep(i, n)
    {
        while (a[i] % 2 == 0)
        {
            a[i] /= 2;
            ans++;
        }
    }
    cout << ans << endl;
}

int main()
{
    solve();
    return 0;
}

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

int h, w;
vector<vector<char>> maze(51, vector<char>(51));
vector<vector<bool>> reached(51, vector<bool>(51, false));
vector<vector<int>> dist(51, vector<int>(51, -1));

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

int bfs(int sy, int sx) {
    rep(i, h) {
        rep(j, w) {
            dist[i][j] = -1;
        }
    }

    dist[sy][sx] = 0;
    queue<P> q;
    q.push(make_pair(sy, sx));

    while (!q.empty()) {
        int y = q.front().first, x = q.front().second;
        q.pop();
        rep(i, 4) {
            int ny = y + dy[i], nx = x + dx[i];
            if (ny < 0 || ny >= h || nx < 0 || nx >= w) continue;
            if (dist[ny][nx] != -1) continue;
            if (ny == h-1 && nx == w-1) {
                dist[ny][nx] = dist[y][x] + 1;
                break;
            }
            if (maze[ny][nx] != '#') {
                q.push(make_pair(ny, nx));
                dist[ny][nx] = dist[y][x] + 1;
            } 
        }
    }
    return dist[h-1][w-1];
}
 
int main() {
    cin >> h >> w;

    int black = 0;
    rep(i, h) {
        rep(j, w) {
            cin >> maze[i][j];
            if (maze[i][j] == '#') {
                black++;
            }
        }
    }
    
    int ans = bfs(0, 0);
    if (ans == -1) {
        cout << ans << endl;
    } else {
        cout << w * h - black - ans - 1 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n,t,a;
  cin >> n >> t >> a;
  int h[n];
  rep(i,n) R h[i];
  double M=MAX;
  int x=0;
  rep(i,n) {
    double d=(double)t-0.006*h[i];
    if(M>fabs(a-d)) {
      M=fabs(a-d);
      x=i+1;
    }
  }
  pr(x);
}

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


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

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int cnt = 0;
    For(i, a, b+1) {
        if (c % i == 0) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
 
ostream& operator<<(ostream &out, string str) {
	for(char c : str) out << c;
	return out;
}
 
template<class L, class R> ostream& operator<<(ostream &out, pair<L, R> p) {
	return out << "(" << p.first << ", " << p.second << ")";
}
 
template<class T> auto operator<<(ostream &out, T a) -> decltype(a.begin(), out) {
	out << "{";
	for(auto it = a.begin(); it != a.end(); it = next(it))
		out << (it != a.begin() ? ", " : "") << *it;
	return out << "}";
}
 
void dump() { cerr << "\n"; }
template<class T, class... Ts> void dump(T a, Ts... x) {
	cerr << a << ", ";
	dump(x...);
}

#ifdef DEBUG
#  define debug(...) cerr << "[" #__VA_ARGS__ "]: ", dump(__VA_ARGS__)
#else
#  define debug(...) false
#endif
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define ST first
#define ND second
 
template<class T> int size(T && a) { return a.size(); }
 
using LL = long long;
using PII = pair<int, int>;

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

	int a, b, m;
	cin >> a >> b >> m;

	vector<int> q(a), r(b);
	int min_q = 1e9, min_r = 1e9;
	REP(i, a) {
		cin >> q[i];
		min_q = min(min_q, q[i]);
	}
	REP(i, b) {
		cin >> r[i];
		min_r = min(min_r, r[i]);
	}

	debug(q, r, min_q, min_r);

	int ans = min_q + min_r;
	REP(i, m) {
		int x, y, c;
		cin >> x >> y >> c;
		ans = min(ans, q[x - 1] + r[y - 1] - c);
	}

	cout << ans << "\n";
}


Measured memory_bytes: 1024
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let n:i64 = read();
    let s:Vec<char> = read::<String>().chars().collect();
    let sum:Vec<_> = s.clone().iter().map(|x| if *x == 'E'{ 1 } else { 0 })
        .scan(0,|state,x|{
            *state = *state + x;
            Some(*state)
        }).collect();
    let ans = (0..n).fold(1e9 as i64, |res,j| {
        let diff = if j == 0{
            (sum[(n-1) as usize] - sum[j as usize])
        } else if j == (n-1){
            j - sum[(j-1) as usize]
        } else {
            ((sum[(n-1) as usize] - sum[(j) as usize])) + (j+1 - sum[j as usize])
        };
        std::cmp::min(res, diff)
    });
    println!("{}",ans );
}

Measured memory_bytes: 12456
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

S = input()
Sset = set(S.rstrip('\n'))
# print(Sset)

n = 0
for SS in Sset:
    if S.count(SS) % 2 == 0:
        n += 1
if len(Sset) == n:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9036
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl;

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

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

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd

#define CIN(x) int x;cin>>x;
#define CIN2(x,y) int x,y;cin>>x>>y;
#define CIN3(x,y,z) int x,y,z;cin>>x>>y>>z;
#define SCIN(x) string x;cin>>x;
#define SCIN2(x,y) string x,y;cin>>x>>y;
#define COUT(x) cout<<(x)<<endl;
#define SCOUT(x) cout<<(x)<<" ";
#define ENDL cout<<endl;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i];
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

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

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())


#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){
    CIN2(n,m);V a(m);V b(m);VECIN2(a,b);
    vector<S> map_(n+1);
    REP(i,m){map_[a[i]].insert(b[i]);map_[b[i]].insert(a[i]);}
    bool flag=false;
    FOREACH(x,map_[1])if(EXIST(map_[x],n)){flag=true;break;}
    SANKOU(flag,POSSIBLE,IMPOSSIBLE);

    return 0;
}


Measured memory_bytes: 29952
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <cstdlib>
#include <cmath>

using namespace std;
typedef long long ll;

struct dat{
	ll a;
	ll num;
};

bool lessN(const dat &n1, const dat &n2) { return (n1.a < n2.a); }

int main() {
	ll n, k;
	dat d[100010];

	cin >> n >> k;
	for (ll i = 0; i < n; i++) {
		ll a, b;
		cin >> a >> b;
		d[i].a = a;
		d[i].num = b;
	}
	sort(d, d + n, lessN);
	ll id = 0;
	ll sum = d[0].num;
	while (sum < k) {
		id++;
		sum += d[id].num;
	}
	cout << d[id].a << endl;

	return 0;
}

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

typedef long long LL;
typedef pair<int, int> II;

struct Element {
    int val, sum, id;
    bool operator<(const Element &e) const {
        if (val != e.val) {
            return val > e.val;
        }
        if (sum != e.sum) {
            return sum < e.sum;
        }
        return id < e.id;
    }
};

const int MAXN = (int)2e5 + 10;
int n, k, ft[MAXN];
Element a[MAXN];

void update(int i, int v) {
    i += 1;
    while (i <= n + 1) {
        ft[i] += v;
        i += i & -i;
    }
}

int query(int i) {
    i += 1;
    int ans = 0;
    while (i > 0) {
        ans += ft[i];
        i -= i & -i;
    }
    return ans;
}

int main() {
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; ++i) {
        int x;
        scanf("%d", &x);
        a[i].sum = (a[i - 1].sum + x) % k;
        a[i].val = a[i].sum - i;
        a[i].id = i;
    }
    sort(a, a + 1 + n);

    LL ans = 0;
    map<int, int> pos;
    for (int i = 0; i <= n; ++i) {
        pos[a[i].val] = i;
        int j = i;
        while (j + 1 <= n && a[j + 1].val == a[i].val) {
            j += 1;
        }
        for (int t = i; t <= j; ++t) {
            ans += query(a[t].id);
            update(a[t].id, 1);
        }
        for (int t = i; t <= j; ++t) {
            update(a[t].id, -1);
        }

        if (pos.count(a[i].val + k)) {
            int l = pos[a[i].val + k];
            int r = l;
            for (int p = l; a[p].val == a[l].val; ++p) {
                update(a[p].id, 1);
                r = p;
            }

            int p = l - 1;
            for (int t = i; t <= j; ++t) {
                while (p + 1 <= r && a[p + 1].sum <= a[t].sum) {
                    p += 1;
                    update(a[p].id, -1);
                }
                ans += query(a[t].id);
            }
            while (p + 1 <= r) {
                p += 1;
                update(a[p].id, -1);
            }
        }
        i = j;
    }

    printf("%lld\n", ans);
    return 0;
}

/**
 * s[j] - s[i - 1] = j - (i - 1)
 * s[j] - j = s[i - 1] - (i - 1)
 *
 * s[j] < s[i - 1]
 * s[j] - j + k = s[i - 1] - (i - 1)
 * */

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


int main() {
    int q;
    cin >> q;
    vector<int> p,pans;
    for (int i=2;i<=1e5;i++) {
        bool flag=true;
        for (int j=0;j<p.size();j++) {
            if (i%p[j]==0) {
                flag=false;
                break;
            } else if (p[j]<sqrt(j)+1) break;
        }
        if (flag) p.push_back(i);
    }
    for (int i=0;i<p.size();i++) {
        int pp=(p[i]+1)/2;
        int k=lower_bound(p.begin(),p.end(),pp)-p.begin();
        if (p[k]==pp) pans.push_back(p[i]);
    }
    int l,r;
    for (int i=0;i<q;i++) {
        cin >> l >> r;
        int ans=upper_bound(pans.begin(),pans.end(),r)-lower_bound(pans.begin(),pans.end(),l);
        cout << ans << endl;
    }
}

Measured memory_bytes: 768
MOD=10**9+7
UPPERLIMIT=10**4
MODMUL=[1, 1]+[0]*(UPPERLIMIT-1)
for i in range(2, UPPERLIMIT+1):
  MODMUL[i]=MODMUL[i-1]*i%MOD
MODDIV=[1]*UPPERLIMIT+[pow(MODMUL[-1], MOD-2, MOD)]
for i in range(UPPERLIMIT, 0, -1):
  MODDIV[i-1]=MODDIV[i]*i%MOD
def MODCOMB(n, r):
  return (((MODMUL[n]*MODDIV[r])%MOD)*MODDIV[n-r])%MOD

S=int(input())
if S<3:
  print(0)
  exit()
  
ans=0
T=S//3
for i in range(1, T+1):
  x=S-i*3
  ans=(ans+MODCOMB(x+i-1, x))%MOD
  
print(ans)

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

#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

map<string, int> m;


int main(){

    string s;
    cin >> s;

    int size = s.size();

    bool ans = true;

    for(int i = 0; i < size; i++){
        if(s[i] != s[size - 1 - i]){
            ans = false;
            break;
        }
    }

    if(ans){
        for(int i = 0; i < (size - 1) / 2; i++){
            if(s[i] != s[(size - 1) / 2 - 1 - i]){
                ans = false;
                break;
            }
        }
    }

    if(ans){
        for(int i = (size - 1) / 2 + 1; i < size; i++){
            if(s[i] != s[size - 1 - i]){
                ans = false;
                break;
            }
        }
    }

    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}


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


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);    
    
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    
    int cnt = 1;
    bool takahashi = false, aoki = false;
    while (true){
      if (cnt & 1) 
        c -= b;
      else
        a -= d;
      if (a <= 0){
        aoki = true;
        break;
      }
      if (c <= 0){
        takahashi = true;
        break;
      }
      cnt++;
    }
    if (takahashi)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
}


Measured memory_bytes: 3644
def CHECK_NUM(n):
    for d in range(len(n)):
        if n[d]=="3":
            return True
    return False
 
num = int(input())
str=""
for d in range(3,num+1):
    s = "%d"%(d)
    if d%3==0 or CHECK_NUM(s):
        str+=" %d"%(d)
print(str)


Measured memory_bytes: 5636
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

#define fore(l) for(auto && value:l)
typedef long long ll;

int main()
{
    ll size;
    cin >> size;
    vector<ll> k;
    for ( ll i = 0; i < size; i++ )
    {
        ll w;
        cin >> w;
        k.push_back( w );
    }

    ll result = 0;

    while ( true )
    {
        bool end = true;
        for ( ll i = 0; i < size; i++ )
        {
            if ( k[i] != 0 )
                end = false;
        }
        if ( end )
            break;

        ll start = 0;
        for ( start = 0; start < size; start++ )
        {
            if ( k[start] != 0 )
                break;
        }

        for ( ll i = start; i < size; i++ )
        {
            if ( k[i] == 0 )
                break;
            k[i]--;
        }
        result++;
    }
    cout << result;
}


Measured memory_bytes: 3164
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repi(i,x,n) for(ll i=x;i<(ll)(n);i++)
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
//cin.tie(0);
//ios::sync_with_stdio(false);



signed main(){
    ll n,ans=0;cin>>n;
    vector<string> v(n);
    rep(i,n){
        cin>>v[i];
        sort(all(v[i]));
    }
    sort(all(v));
    v.pb("z");

    ll cnt=0;
    for(int i=1;i <= n;i++)
    {
        if(v[i]==v[i-1]){
            cnt++;
        }else{
            ans+=(cnt+1)*(cnt)/2;
            cnt=0;
        }
    }

    cout<<ans<<endl;

}

Measured memory_bytes: 8064
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<climits>
#include<numeric>
#include<cmath>
#include<cstring>
#include<deque>
#include<fstream>
#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 VSORT(v) sort(v.begin(), v.end());
#define VE vector<int>
#define VEP vector<pair<int,int>>
#define llong long long
#define pb(a) push_back(a)
using namespace std;
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
int main() {
	int n, k,r,s,p;
	string str;
	cin >> n >> k >> r>> s>> p;
	cin >> str;
	string hand(n,'z');
	llong ans = 0;
	REP(i, n) {
		if (str[i] == 'r') {
			if (i - k >= 0 && hand[i - k] == 'p') {}
			else {
				ans += p;
				hand[i] = 'p';
			}
		}else if (str[i] == 's') {
			if (i - k >= 0 && hand[i - k] == 'r') {}
			else {
				ans += r;
				hand[i] = 'r';
			}
		}
		else if (str[i] == 'p') {
			if (i - k >= 0 && hand[i - k] == 's') {}
			else {
				ans += s;
				hand[i] = 's';
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio() ios_base::sync_with_stdio(false);
#define rmod(x, y) ((((x)%(y))+(y))%(y))
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<typename T, typename R = null_type, typename C = less<T>>
tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update> ordered_set(){
	return tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update>();
}

const int mod = 1e9+7;
const int maxn = 22, maxm = (1<<21);

int add(ll a, ll b){return (a+b)%mod;}
int mul (ll a, ll b){return (a*b)%mod;}
int sub(ll a, ll b){return (((a-b)%mod)+mod)%mod;}

bool a[maxn][maxn];
int n, dp[maxn][maxm];

int solve(int i, int msk){
	if(i == n) return (msk == 0);
	int &ret = dp[i][msk];
	if(ret != -1) return ret;
	ret = 0;
	for(int j = 0; j<n; j++) if (a[i][j] && ((msk>>j)&1))
		ret = add(ret, solve(i+1, msk^(1<<j)));
	return ret;
}


int main(){
	fastio();
	memset(dp, -1, sizeof(dp));
	cin >> n;
	for(int i = 0; i<n; i++)
		for(int j = 0; j<n; j++) cin >> a[i][j];
	printf("%d\n", solve(0, (1<<n)-1));
	

	return 0;
}


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

int main()
{
  int H, W;
  cin >> H >> W;
  
  for (int i = 0; i < W + 2; i++) cout << '#';
  cout << endl;
  
  for (int i = 0; i < H; i++)
  {
    string S;
    cin >> S;
    cout << '#' << S << '#' << endl;
  }
  
  for (int i = 0; i < W + 2; i++) cout << '#';
  cout << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int MAX = 10'000;

int P[MAX];
int R[MAX];

//
int parent(int x) {
    while (P[x] != x) {
        x = P[x];
    }
    return x;
}

void unite(int x, int y) {
    int a, b;
    a = parent(x);
    b = parent(y);
    if (R[a] > R[b]) {
        P[b] = a;
    } else if (R[a] < R[b]) {
        P[a] = b;
    } else {
        P[b] = a;
        R[a]++;
    }
}

bool same(int x, int y) {
    return parent(x) == parent(y);
}

//
int main() {

    int n, q;
    cin >> n >> q;

    for (int i = 0; i < n; i++) {
        P[i] = i;
        R[i] = 0;
    }

    int com, x, y;
    for (int i = 0; i < q; i++) {
        cin >> com >> x >> y;
        if (com == 0) {
            unite(x, y);
        } else {
            cout << (same(x, y) ? 1 : 0) << endl;
        }
    }
}


Measured memory_bytes: 3160
N, C, K = map(int, input().split())

T = [int(input()) for _ in range(N)]
T.sort()

bus = []

count = 0
for i in range(N):
    if count == 0:
        first = T[i]
        count += 1
    else:
        if T[i] - first <= K:
            count += 1
        else:
            bus.append(count)
            first = T[i]
            count = 1
    if count >= C:
        bus.append(count)
        count = 0

if count > 0:
    bus.append(count)

print(len(bus))

Measured memory_bytes: 8036
#!/usr/bin/env python3
import sys, itertools

def WarshallFloyd(V: int, cost: "List[List[int]]"):
    """
    全ての頂点対の間の最短距離を求めます。
    ==============
    V: 頂点数
    cost: 隣接行列(辺が存在しない部分はINF)
    --------------
    cost: 最短距離の行列
    """
    for k in range(V):
        for i in range(V):
            for j in range(V):
                cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])
    return cost

def solve(N: int, M: int, R: int, r: "List[int]", A: "List[int]", B: "List[int]", C: "List[int]"):
    INF = 1e18
    G = [[INF for _ in range(N)] for _ in range(N)]
    for i in range(M):
        G[A[i]-1][B[i]-1] = C[i]
        G[B[i]-1][A[i]-1] = C[i]
    cost = WarshallFloyd(N, G)
    mn = 1e18
    for p in itertools.permutations(r):
        path = 0
        for i in range(R-1):
            path += cost[p[i+1]-1][p[i]-1]
        mn = min(path, mn)
    print(mn)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    r = [int(next(tokens)) for _ in range(R)]  # type: "List[int]"
    A = [int()] * (M)  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    C = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, R, r, A, B, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 57052
N, M = map(int, input().split())

ab = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b = map(int, input().split())
    ab[a].append(b)

dp = [0] * (N + 1)
for i in range(1, N + 1):
    dp[i] = max(dp[i], dp[i - 1])
    for j in ab[i]:
        dp[j] = max(dp[j], dp[i] + 1)

print(dp[N])


Measured memory_bytes: 23368
//To compile : type "$     g++ test.cpp -std=c++14 -I .    "
#include <atcoder/lazysegtree>
#include <bits/stdc++.h>
//#include <chrono>
//#pragma GCC optimize("Ofast")
using namespace std;
using namespace atcoder;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,Q,K,A,B;
//string S;
typedef pair<ll, ll> P;
const ll INF = (1LL<<60);

template <unsigned long long mod > class modint{
public:
    ll x;
    constexpr modint(){x = 0;}
    constexpr modint(ll _x) : x((_x < 0 ? ((_x += (LLONG_MAX / mod) * mod) < 0 ? _x + (LLONG_MAX / mod) * mod : _x) : _x)%mod){}
    constexpr modint operator-(){
        return x == 0 ? 0 : mod - x;
    }
    constexpr modint& operator+=(const modint& a){
        if((x += a.x) >= mod) x -= mod;
        return *this;
    }
    constexpr modint operator+(const modint& a) const{
        return modint(*this) += a;
    }
    constexpr modint& operator-=(const modint& a){
        if((x -= a.x) < 0) x += mod;
        return *this;
    }
    constexpr modint operator-(const modint& a) const{
        return modint(*this) -= a;
    }
    constexpr modint& operator*=(const modint& a){
        (x *= a.x)%=mod;
        return *this;
    }
    constexpr modint operator*(const modint& a) const{
        return modint(*this) *= a;
    }
    constexpr modint pow(unsigned long long pw) const{
        modint res(1), comp(*this);
        while(pw){
            if(pw&1) res *= comp;
            comp *= comp;
            pw >>= 1;
        }
        return res;
    }
    //以下、modが素数のときのみ
    constexpr modint inv() const{
        return modint(*this).pow(mod - 2);
    }
    constexpr modint& operator/=(const modint &a){
        (x *= a.inv().x)%=mod;
        return *this;
    }
    constexpr modint operator/(const modint &a) const{
        return modint(*this) /= a;
    }
};
#define mod1 998244353
using mint = modint<mod1>;

ostream& operator<<(ostream& os, const mint& a){
    os << a.x;
    return os;
}
using vm = vector<mint>;

struct S {
	mint x;
	int n;
	//S(int _x = 0, int _n = 0) : x(_x), n(_n){}
	S(mint _x = 0, int _n = 0) : x(_x), n(_n){}
};

struct F {
	mint a, b;
	//F(int _a = 1, int _b = 0) : a(_a), b(_b){}
	F(mint _a = 1, mint _b = 0) : a(_a), b(_b){}
};

S op(S s, S t){
	return S(s.x + t.x, s.n + t.n);
}

S e(){ return S(); }

S mapping(F f, S s){
	return S(f.a * s.x + f.b * s.n, s.n);
}

F composition(F f, F g){
	return F(f.a * g.a, f.a * g.b + f.b);
}

F id(){ return F(); }

int main() {
	cin>>N>>Q;
	vector<S> a(N);
	rep(i, N){
		scanf("%lld", &A);
		a[i] = S(A, 1);
	}
	lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
	rep(_, Q){
		int t, l, r, b, c;
		scanf("%d%d%d", &t, &l, &r);
		if(t == 0){
			scanf("%d%d", &b, &c);
			seg.apply(l, r, F(b, c));
		}else{
			printf("%lld\n", seg.prod(l, r).x.x);
		}
	}
}

Measured memory_bytes: 35808
N,K=map(int,input().split())

H=[int(input()) for i in range(N)]
H.sort()

ans=10**9

for i in range(N-(K-1)):
  if ans > abs(H[i]-H[i+(K-1)]):
    ans = abs(H[i]-H[i+(K-1)])
print(ans)

Measured memory_bytes: 7384
#include<stdio.h>
#include<stdlib.h>
long long n;
long long k;
long long a[1000005];
int cmp(const void* a, const void* b)
{
    return *(long long*)a - *(long long*)b;
}
int getLeft(long long x)
{
    long long i;
    long long index = 0;
    long long left, right, mid;
    for (i = 1; i < n; i++)
    {
        left = i + 1;
        right = n;
        if (a[i] >= 0)
        {
            if (a[i] * a[left] < x)
            {
                while (left < right) {
                    mid = (left + right + 1) / 2;
                    if (a[i] * a[mid] < x) left = mid;
                    else right = mid - 1;
                }
                index += left - i;
                continue;
            }
        }
        else
        {
            if (a[i] * a[right] < x)
            {
                if (a[i] * a[left] < x)
                {
                    index += right - left + 1;
                    continue;
                }
                while (left < right)
                {
                    mid = (left + right + 1) / 2;
                    if (a[i] * a[mid] >= x) left = mid;
                    else right = mid - 1;
                }
                index += n - left;
                continue;
            }
        }
        break;
    }
    return index < k;
}
int main() 
{
    int i;
    long long left = -1000000000000000005;
    long long right = 1000000000000000005;
    long long mid;
    scanf("%lld %lld", &n, &k);
    for (i = 1; i <= n; i++)
    {
        scanf("%lld", &a[i]);
    }
    qsort(a + 1, n, sizeof(long long), cmp); 
    while (left < right)
    {
        mid = (left + right + 1) / 2;
        if (getLeft(mid))
        {
            left = mid;
        }
        else
        {
            right = mid - 1;
        }
    }
    printf("%lld", left);
    return 0;
}

Measured memory_bytes: 3324
#include <stdio.h>
//#include <stdlib.h>
#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

int main() {
  char t[7][4] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  char s[4];
  scanf("%s", s);
  for (int i=0; i<7; i++) {
    if (strcmp(t[i], s) == 0) {
      printf("%d\n", 7-i);
    }
  }
  return 0;
}


Measured memory_bytes: 128
#include <cstdio>
#include <utility>

int main(){
    int x,y;
    scanf("%d %d",&x,&y);
    if(x < y) std::swap(x,y);

    int ans;
    while(true){
        if(x % y == 0){
            ans = y;
            break;
        }else{
            x = x % y;
            std::swap(x,y);
        }
    }    
    printf("%d\n",ans);

}


Measured memory_bytes: 2684
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,a,b,ans=0;
	cin>>n>>a>>b;
	ans+=n/(a+b)*a;
	n=n%(a+b);
	if(n>=a){
		ans+=a;
	}
	else{
		ans+=n;
	}
	cout<<ans<<endl;
  return(0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;



int main() {
    int n,m;
    cin >> n >> m;
    cout << n*(n-1)/2 + m*(m-1) / 2 << endl;
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include<stdio.h>
 
int main()
{
 int m,f,r;

 for(;;){
         scanf("%d%d%d",&m,&f,&r);
         if(m==-1&&f==-1&&r==-1)break;
         else if(m==-1||f==-1)printf("F\n");
         else if(m+f>=80)printf("A\n");
         else if(m+f>=65)printf("B\n"); 
         else if(m+f>=50)printf("C\n");
else if(m+f>=30&&r>=50)printf("C\n");
         else if(m+f>=30)printf("D\n");
         
         else if(m+f<30)printf("F\n");

          }
 return 0;
}
         



Measured memory_bytes: 2104
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

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

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


int main()
{
	ll h, n;
	cin >> h >> n;

	ll s = 0;
	for (int i = 0; i < n; i++)
	{
		ll x;
		cin >> x;

		s += x;
	}

	println((s >= h ? "Yes" : "No"));
}


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

int n;
#define maxn 200011
int a[maxn];

#define LL long long
LL calc(LL v)
{
	for (int i=1;i<=n;i++) v=v/a[i]*a[i];
	return v;
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	
	LL L=0,R=1e15;
	while (L<R)
	{
		const LL mid=(L+R+1)>>1;
		if (calc(mid)<=2) L=mid;
		else R=mid-1;
	}
	LL right=L;
	L=0,R=1e15;
	while (L<R)
	{
		const LL mid=(L+R)>>1;
		if (calc(mid)>=2) R=mid;
		else L=mid+1;
	}
	LL left=L;
//	cout<<left<<' '<<right<<endl;
	if (left>right) puts("-1");
	else printf("%lld %lld\n",left,right);
	return 0;
}

Measured memory_bytes: 640
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<i64>();
    let (k, x) = (v[0], v[1]);
    for i in x - k + 1..x + k {
        print!("{} ", i);
    }
    println!("");
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 2128
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include "bits/stdc++.h"

typedef long long ll;
using namespace std;

#define FOR(i,n) for(ll i=0;i<n;i++) 
#define RFOR(i,n) for(ll i=n-1;i>=0;--i)
#define COUT(str) cout << str << endl

//入力
string a,b,c ;


int main() {

	cin >> a >> b >> c;

	if ((a.back() == b.front()) && (b.back() == c.front())) COUT("YES");

	else COUT("NO");

	return 0;
}


Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;


void main() {
	int a, b;
	auto s = readln().strip().split();
	a = to!int(s[0]);
	b = to!int(s[1]);
	writefln("%.5f", a*b/3.305785);
}

Measured memory_bytes: 1136
#include<iostream>

using namespace std;

static const int N = 100;
static const int I=(1<<21);
static const int W= 0;
static const int G =1;
static const int B =2;

int n,M[N][N];

int prim(){
  int u,minv,d[N],p[N],color[N];
  for(int i=0;i<n;i++){
    d[i]=I;
    p[i]=-1;
    color[i]=W;
  }

  d[0]=0;

  while(1){
    minv=I;
    u=-1;
    for(int i=0;i<n;i++){
      if(minv>d[i]&&color[i]!=B){
        u=i;
        minv=d[i];
      }
    }
    if(u==-1)break;
    color[u]=B;
    for(int v=0;v<n;v++){
      if(color[v]!=B&&M[u][v]!=I){
        if(d[v]>M[u][v]){
          d[v]=M[u][v];
          p[v]=u;
          color[v]=G;  
            
            
        }}
    }
  }
  int sum=0;
  for(int i=0;i<n;i++){
    if(p[i]!=-1)sum+=M[i][p[i]];
  }

  return sum;
}

int main(){
  cin>>n;

  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      int e;
      cin>>e;
      M[i][j]=(e==-1) ? I : e;
    }
  }

  cout<<prim()<<endl;

  return 0;
}


Measured memory_bytes: 3140
#include <bits/stdc++.h>
 
using namespace std;
 
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
#define ll	long long
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ios	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define hell 1000000007
#define PI 3.141592653589793

ll x_power_y (int x, int y) {
	ll ans = 1ll;
	if (x == 1) return ans;
	while (y > 0) {
		if (y&1) {
			ans = (ans*x)%hell;
		}
		y>>=1;
		x = (1ll*x*x)%hell;
	}
	//ans %= hell;
	return ans;
}

int main() 
{	ios;
	int t = 1;
	//cin>>t;
	while (t--) {
		int n, k;
		cin>>n>>k;
		ll dp[k+1];
		for (int h = k; h >= 1; --h) {
			int base = k/h;
			dp[h] = x_power_y(base, n);
			for (int mul = 2; h*mul <= k; mul++) {
				dp[h] = (dp[h] - dp[h*mul])%hell;
			}
		}
		ll sum = 0;
		for (int i = 1; i <= k; i++) {
			sum = (sum + i*dp[i])%hell;
		}
		cout<<sum;
		cout<<"\n";
	}
    return 0; 
} 


Measured memory_bytes: 4420