akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cstdio>
using namespace std;
long long n;
long long sum, ans;
int main() {
  scanf("%lld", &n);
  sum = 1;
  while (n) {
  	ans += sum;
  	sum *= 2;
    n /= 2;
  }
  printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 128
import bisect

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

count = 0

A.sort()
C.sort()

for i in B:
    t = bisect.bisect_left(A,i)
    s = N - bisect.bisect_right(C,i)
    count += t*s
print(count)

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

#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(i, 0, n)
#define rrep(i, n) RFOR(i, n, 0)
#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const ll INF = 1e18;
const int inf = 1e8;


void solve()
{
  ll N;
  scanf("%lld",&N);
  ll T;
  scanf("%lld",&T);
  double A;
  scanf("%lf",&A);
  double d=inf;
  int ans=0;
  for(int i = 0 ; i < N ; i++){
    ll H; cin>>H;
    double t = abs(A-(T-H*0.006));
    if (d>t) {
      d=t;
      ans=i+1;
    }
  }
  cout << ans << endl;
}

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


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

typedef long long int ll;
typedef vector<int> vec;
typedef vector<vec> mat;

typedef priority_queue<int, vec, greater<int> > QUE;

int main() {
    int N, M;
    string str;
    QUE que;

    cin >> N;
    vec v(N);
    for (auto &i : v) cin >> i;

    int ans = 0;

    for (int i = 0; i < N; i++) {
        if (v[v[i]-1] == i+1) ans++;
    }

    cout << ans/ 2 << endl;

    return 0;
}


Measured memory_bytes: 640
N,K = list(map(int, input().split()))
mod = int(1e9+7)
# N+1からK個をとる手法
# だけどmin - maxまで一飛ばしで作れるはずなので引き算でもとめてよい
ans = 0
for i in range(K,N+2):
  ans = (ans + i * (N+1-i) + 1) % mod
  
print(ans)

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

int main( int argc, char *argv[] )
{
string sA;
string sB;

	cin >> sA;
	cin >> sB;

	if( sA.size() > sB.size() )
		cout << "GREATER" << endl;
	else if( sA.size() < sB.size() )
		cout << "LESS" << endl;
	else
	{
		if( sA > sB )
			cout << "GREATER" << endl;
		else if( sA < sB )
			cout << "LESS" << endl;
		else
			cout << "EQUAL" << endl;
	}

	return 0;

}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
#include <cstdio>
#include <cmath>
#include <cstring> 
#include <algorithm>
#include <stack> 
#define ll long long
int n,a,b,num;
int i1=0,i2=0,i3=0;
int findmin(void)
{
	int h[3];
	h[0]=i1;h[1]=i2;h[2]=i3;
	sort(h,h+3);
	return h[0];
}
int main()
{
	cin>>n>>a>>b;
	for(int i=0;i<n;i++)
	{
		cin>>num;
		if(num<=a)
		{
			i1++;
		}
		else if(num>b)
		{
			i3++;
		}
		else
		{
			i2++;
		}
	}
	cout<<findmin()<<endl;
	return 0;
	
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1e9+7;
const int INF=1e9;
const ll LINF=(ll)1e18;

ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1)res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}

struct Combination{
    vector<ll> fac,finv,inv;
    Combination(int mx){init(mx);}
    void init(int mx){
        fac.resize(mx+1);
        finv.resize(mx+1);
        inv.resize(mx+1);
        fac[0]=fac[1]=1;
        finv[0]=finv[1]=1;
        inv[1]=1;
        for(int i=2;i<=mx;i++){
            fac[i]=fac[i-1]*i%MOD;
            inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
            finv[i]=finv[i-1]*inv[i]%MOD;
        }
    }
    ll operator()(int n,int k){
        if(n<k)return 0;
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
    }
};

int main(){
    int b,w;
    cin>>b>>w;
    ll half=modpow(2,MOD-2);
    ll s=0,t=0;
    Combination comb(b+w);
    for(int i=1;i<=b+w;i++){
        ll ans=(half*(1+s-t+MOD))%MOD;
        cout<<ans<<endl;
        s=(s+comb(i-1,w-1)*modpow(half,i))%MOD;
        t=(t+comb(i-1,b-1)*modpow(half,i))%MOD;
    }
}


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

const int MAX = 100;
const long long  INF = 1e10;

long long M[MAX][MAX];

int main(){
    int V, E;
    cin >> V >> E;

    rep(i,V){
        rep(j,V){
            if(i == j){
                M[i][j] = 0;
            }else{
                M[i][j] = INF;
            }
        }
    }

    int s, t;
    long long d;
    rep(i,E){
        cin >> s >> t >> d;
        M[s][t] = d;
    }

    for(int k = 0; k < V; k++){
        for(int i = 0; i < V; i++){
            for(int j = 0; j < V; j++){
                if(M[i][k] != INF && M[k][j] != INF){
                    M[i][j] = min(M[i][j], M[i][k] + M[k][j]);
                }
            }
        }
    }


    for(int i = 0; i < V; i++){
        if(M[i][i] < 0){
            printf("NEGATIVE CYCLE\n");
            return 0;
        }
    }
    for(int i = 0; i < V; i++){
        for(int j = 0; j < V; j++){
            if(M[i][j] == INF){
                printf("INF");
            }else{
                printf("%d", M[i][j]);
            }
            if(j < V - 1){
                printf (" ");
            }
        }
        printf("\n");
    }

    return 0;

}


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


int main() {
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(i == 3){
            cout << '8';
        }
        else
        {
            cout << s[i];
        }
    }   
    cout << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
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;
}
 
using namespace std;



void solve(){
  int n;
  cin>>n;
  vector<int>p(n);
  rep(i,n)cin>>p[i],p[i]--;
  vector<ll>a(n);
  rep(i,n)a[i]=20000*i+1;
  vector<ll>b(n);
  rep(i,n)b[i]=20000*i+1;
  reverse(all(b));
  rep(i,n){
    b[p[i]]+=i;
  }
  rep(i,n){
    if(i)cout<<" ";
    cout<<a[i];
  }
  cout<<endl;
  rep(i,n){
    if(i)cout<<" ";
    cout<<b[i];
  }
  cout<<endl;
}

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


Measured memory_bytes: 1024
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Ans[2] = {"No", "Yes"};
string ANS[2] = {"NO", "YES"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int Root(int x, vector<int> &root)
{
    if (x == root[x]) return x;
    return root[x] = Root(root[x], root);
}

void Merge(int v, int u, vector<int> &root, vector<int> &sz)
{
    v = Root(v, root), u = Root(u, root);
    if (v == u) return;
    if (sz[v] < sz[u])
    {
        sz[u] += sz[v];
        root[v] = u;
    }
    else
    {
        sz[v] += sz[u];
        root[u] = v;
    }
}

int ok(int x, int n)
{
    return 0 <= x && x < n;
}

void bfs(int v, vi &dist, vector<vi> &graph)
{
    fill(all(dist), -1);
    dist[v] = 0;
    vi q = {v};
    for (int i = 0; i < q.size(); i++)
    {
        for (auto u : graph[q[i]])
        {
            if (dist[u] == -1)
            {
                dist[u] = dist[q[i]] + 1;
                q.push_back(u);
            }
        }
    }
}


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int a, b, c;
    cin >> a >> b >> c;
    if (a + b + c >= 22) cout << "bust";
    else cout << "win";
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


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

int main() 
{
  int a,b;
  cin >> a >> b;
  int pro=a*b;

  string judge;
  if( pro%2 == 0 ) 
    judge="Even";
  else
    judge="Odd";

  cout << judge << endl;
  return 0;
}

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

struct Edge {
  int to, weight;
  Edge(int t, int w) :to(t), weight(w) {}
};

struct Graph {
  vector<vector<Edge>> edges;

  Graph(int N) :edges(N) {}

  void addEdge(int a, int b) { addEdge(a, b, 1); }

  void addEdge(int a, int b, int w) {
    edges[a].emplace_back(b, w);
  }
};

int main()
{
  int N, M; cin >> N >> M;
  Graph G(N), revG(N);
  rep(i, M) {
    int x, y; cin >> x >> y;
    x--; y--;
    G.addEdge(x, y);
    revG.addEdge(y, x);
  }

  const int INF = 1e9 + 10;
  int ans = INF;
  int num = -1;

  rep(k, N) {
    vector<int> dfs(N, -1);
    queue<int> q;

    dfs[k] = 0;
    q.push(k);

    int loop = -1;

    while (!q.empty()) {
      int v = q.front(); q.pop();

      for (Edge e : G.edges[v]) {
        int nv = e.to;
        if (dfs[nv] != -1) {
          if (nv != k) continue;
          loop = dfs[v];
          break;
        }

        dfs[nv] = dfs[v] + 1;
        q.push(nv);
      }

      if (loop != -1) break;
    }

    if (loop != -1 and ans > loop) {
      ans = loop;
      num = k;
    }

  }

  if (num == -1) {
    cout << -1 << endl;
    return 0;
  }

  vector<int> bfs(N, -1);
  queue<int> q;

  bfs[num] = 0;
  q.push(num);

  int start = -1;

  while (!q.empty()) {
    int v = q.front(); q.pop();

    for (Edge e : G.edges[v]) {
      int nv = e.to;
      if (bfs[nv] != -1) {
        if (nv != num) continue;
        start = v;

        break;
      }

      bfs[nv] = bfs[v] + 1;
      q.push(nv);
    }

    if (start != -1) break;
  }

  vector<int> res;
  rep(i, ans) {
    res.push_back(start);
    for (Edge e : revG.edges[start]) {
      int nv = e.to;
      if (bfs[nv] == bfs[start] - 1) {
        start = nv;
        break;
      }
    }
  }
  res.push_back(num);
  cout << res.size() << endl;
  rep(i, res.size()) cout << res[i] + 1 << endl;
}

Measured memory_bytes: 384
#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()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する

int main(){
    int x;
    cin>>x;
    int max = 1;
    for(int i=2;i<=x;i++){
        int t = i;
        while(t<=x){
            t *= i;
        }
        t /= i;
        //cout<<t<<endl;
        if(t != i && t>max){
            max = t;
        }
    }
    cout<<max<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i<(int)n; ++i)
#define forr(i, t, n) for (int i = t; i<n; ++i)
#define rmod(x, y) (((x%y)+y)%y)
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int maxn = 3000;
const int mod = 1e9+7;
const int maxf = 2e5+5;

int h, w, n;
ll f[maxf];

int fpow(ll a, ll b){
	a%=mod;
	ll res = 1;
	while (b>0){
		if (b&1) res = res*a%mod;
		a = a*a%mod;
		b>>=1;
	}
	return ll(res%mod);
}
void facts(){
	f[0] = 1;
	forr(i, 1, maxf) f[i] = ll((i*f[i-1])%mod);
}

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

int inv(int n){ return fpow(n, mod-2);}
int comb(int n, int k){
	if (k == 0 or n == k or n == 0) return 1;
	int ans = f[n] * inv(f[k])%mod * inv(f[n-k])%mod;
	return ans%mod;
}
inline bool topleft(pii &a, pii &b){
	if (a.first<=b.first and a.second<=b.second) return true;
	else return false;
}
int fx(int n, int m){
	return comb(m+n-2, n-1); // 6, 4
}
/*
FORMULA:
Formas de hacer (0, 0) -> (n, m)
avanzando solo hacia la derecha o hacia abajo
binomial de((m+n-2), (n-1)):
	(m+n-2)!/((n-1)!(m-1))!
*/
int dp[maxn+1];
vector<pii> rc;


/* KSAHDFKJAHSDKFJH
int solve(){
	int dp[n+1][n+1];
	forn(i, n+1){
		forn(j, i){
			dp[i][j] = fx(rc[i].first, rc[i].second);
			if(topleft(rc[j], rc[i])){
				int px = rc[i].first - rc[j].first;
				int py = rc[i].second - rc[j].second;
				dp[i][j] = rmod(sub(dp[i][j], mul(dp[i-1][j], fx(px+1, py+1))), mod);
			}
		}
	}
	return dp[n][n];
}
*/
int solver(){
	forn(i, n+1){
		int aux = fx(rc[i].first, rc[i].second);
		forn(j, i) {
			if (topleft(rc[j], rc[i])){
				int px = rc[i].first - rc[j].first;
				int py = rc[i].second - rc[j].second;
				aux = sub(aux, mul(dp[j], fx(px+1, py+1)));
				//if (i == 4) cout << aux << " ";
			}
		}
		dp[i] = aux;
	}
	return dp[n];
}


bool comp(pii a, pii b){
	if (a.first == b.first) return a.second<b.second;
	return a.first<b.first;
}
int main() {
	facts();
	memset(dp, -1, sizeof(dp));
	scanf("%d%d%d", &h, &w, &n);
	rc.resize(n+1);
	int auxa, auxb;
	forn(i, n){
		scanf("%d%d", &auxa, &auxb);
		rc[i] = {auxa, auxb};
	}
	rc[n] = {h, w};
	sort(rc.begin(), rc.end(), comp);
	//for(auto&p: rc) cout << p.first << " " <<p.second << "\n";
	cout << solver();
	//cout << fx(3,5);
	//printf("%d %d %d\n", fx(3, 5), fx(2, 3), fx(3, 1));
	//printf("%d\n", fx(3,5)-fx(3, 3)-fx(1,5));
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long   signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(LL i = (l)    ; i <  (r); ++i)
#define incII(i, l, r) for(LL i = (l)    ; i <= (r); ++i)
#define decID(i, l, r) for(LL i = (r) - 1; i >= (l); --i)
#define decII(i, l, r) for(LL i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
template<typename T> bool setmin  (T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmax  (T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
LL mo(LL a, LL b) { assert(b > 0); a %= b; if(a < 0) { a += b; } return a; }
LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define bit(b, i) (((b) >> (i)) & 1)
#define BC __builtin_popcountll
#define SC static_cast
#define SI(v) SC<int>(v.size())
#define SL(v) SC<LL >(v.size())
#define RF(e, v) for(auto & e: v)
#define ef else if
#define UR assert(false)

// ---- ----

int n;
vector<int> a, b;

int main() {
	cin >> n;
	inc(i, n) { int v; cin >> v; a.PB(v); }
	b = a;
	sort(RALL(b));
	
	inc(i, n) { cout << (a[i] == b[0] ? b[1] : b[0]) << "\n"; }
	
	return 0;
}


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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
int N;
	vecl(A);
	ll ans = 1000;

	cin >> N;
	fx(N) {
		vecp(A);
	}
	int start = 0;
	fx(N-1) {
		if (A[x]<=A[x+1]) {
			continue;
		}
		ans = ans / A[start] * A[x] + ans%A[start];
		start = x + 1;
	}

	ce(max(ans,ans/A[start]*A[N-1] + ans%A[start]));
    return 0;
}



Measured memory_bytes: 3584
#include<bits/stdc++.h>
#include<cstdio>
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
    ll n,i,j,k,x,y,sum=0,p,q;
     vector<ll>v;
     map<ll,ll>m;
     cin>>n>>k>>q;
     for(i=1;i<=n;i++)
     {
         m[i]=0;
     }
     for(i=0;i<q;i++)
     {
         cin>>x;
         m[x]+=1;
     }
//     for(i=1;i<=n;i++)
//     {
//        cout<<m[i]<<endl;
//     }
     for(i=1;i<=n;i++)
     {
         sum+=m[i];
     }
     for(i=1;i<=n;i++)
     {
         //cout<<k-sum+m[i]<<endl;
         if(k-sum+m[i]>0)
         {
             cout<<"Yes"<<endl;
         }
         else
            cout<<"No"<<endl;
     }

    return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
#include <sstream>
using namespace std;
 
int main() {
  long long  N, M;
 cin >> N >> M;
 if( N == 1 ){
   if (M == 1){
     cout << 1 << endl;
   } else {
     cout << M - 2 << endl;
   }
 } else {
   if( M == 1){
     cout << N - 2 << endl;
   } else {
     cout << (N - 2) * (M - 2) << endl;
   }
 }
}

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

using namespace std;

void Main() {
    long long A, B, N;
    cin >> A >> B >> N;

    long long d = (B <= N) ? B - 1 : N;
    double ansD = ((double)A / (double)B) * (double)d;
    long long ans = (long long)ansD;
    cout << ans << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3580
#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
#define mp make_pair
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define in auto&it
#define out auto it
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
const double pi = acos(-1);
#define error(x) cerr<<#x<<" = "<<x<<'\n';
int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
		freopen("error.txt", "w", stderr);
	#endif
	fastio
	string s;
	cin>>s;
	int sum=0;
	for(int i=0;i<s.size();++i) sum+=(s[i]-'0');
	if(sum%9==0) cout<<"Yes";
	else cout<<"No";
	return 0;
}

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

#define INF_LL (int64)1e18
#define INF (int64)1e9
#define REP(i, n) for(int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for(int64 i = (a); i < (b); i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint32_t;
using int64 = int64_t;
using uint64 = uint64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

template<typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; }
template<typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; }

int64 comb(int64 a, int64 b) {
  int64 ret = 1;
  for (int64 i = a, j = 1; j <= b; i--, j++) {
    ret = ret * i / j;
  }
  return ret;
}

int64 calc(int64 x, int64 y) {
  int64 ret = 0;
  REP(i, min(y, x)+1) {
    ret += comb(x, i);
  }
  return ret;
}

int main(void) {
  int64 l, k;
  cin >> l >> k;
  int64 res = 0;
  FOR(i, 1, l+1) {
    int64 rest = (l - i) / (k-1);
    res += calc((i+1)/2, rest);
    i++;
  }
  cout << res << endl;
}



Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n, a, b;
  cin >> n >> a >> b;
  if(a+b-1 > n || (ll)a*b < n){
    cout << -1 << endl;
    return 0;
  }
  vector<int> ans;
  int l = n - (a+b-1);
  int num = b;
  rrep(i, b) ans.push_back(i+1);
  rep2(i, 1, a){
    int nx = num + min(l, b-1) + 1;
    l -= min(l, b-1);
    // cerr << num+1 << " " << nx+1 << endl;
    rrep2(j, num+1, nx+1){
      ans.push_back(j);
    }
    num = nx;
  }
  rep(i, n){
    if(i != 0) cout << " ";
    cout << ans.at(i);
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 5284
/*
 * Author:  xioumu
 * Created Time:  2012/7/17 12:42:40
 * File Name: a.cpp
 * solve: a.cpp
 */
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
#include<set>
using namespace std;
const double esp = 1e-8;
const int maxn = 1007;
typedef long long ll;
int n;
int main(){
    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        int y, m, d;
        int num = 0;
        scanf("%d%d%d", &y, &m, &d);
        num = (y - 1) * 195 + (y - 1) / 3 * 5;
        num += (m - 1) * 20;
        if(y % 3 != 0)
            num -= (m - 1) / 2;
        num += d;
        printf("%d\n", 196471 - num);
    }
    return 0;
}

Measured memory_bytes: 0
#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(a: int, b: int, _c: int, k: int) -> int:
    if k <= a + b:
        return min(k, a)
    return a - (k - a - b)


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    A, B, C, K = map(int, input().split())
    result = solve(A, B, C, K)
    print(result)


def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)


Measured memory_bytes: 82660
h,w=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(10)]
o=[list(map(int,input().split())) for _ in range(h)]

for k in range(10):
  for i in range(10):
    for j in range(10):
      if l[i][j]>l[i][k]+l[k][j]:
        l[i][j]=l[i][k]+l[k][j]

v=[[l[j][1] if j>=0 else 0 for j in i] for i in o]
print(sum(map(sum,v)))


Measured memory_bytes: 3700
#include <bits/stdc++.h> 
 
#define INF (1<<31) - 1 //INT_MAX/2
#define MOD 1000000007
#define PI  acos(-1)

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

int main(int argc, char *argv[])
{
    int N;
    std::cin >> N;

    std::vector<int> a(N);
    for (int i = 0; i < N; i++) {
        std::cin >> a[i];
    }

    int max = 0;
    int min = 0;

    std::set<int> s;

    int cnt = 0;
    for (int i = 0; i < N; i++) {
        int temp = 0;
        if (a[i] < 400) {
            temp = 1;
        } else if (a[i] < 800) {
            temp = 2;
        } else if (a[i] < 1200) {
            temp = 3;
        } else if (a[i] < 1600) {
            temp = 4;
        } else if (a[i] < 2000) {
            temp = 5;
        } else if (a[i] < 2400) {
            temp = 6;
        } else if (a[i] < 2800) {
            temp = 7;
        } else if (a[i] < 3200) {
            temp = 8;
        } else {
            cnt++;
            continue;
        }
        s.insert(temp);
    }

    bool flag = true;
    for (int i = 0; i < N; i++) {
        if (a[i] < 3200) {
            break;
        }
        if (i == N-1) {
            flag = false;
        }
    }

    if (flag) {
        min = s.size();
        max = s.size() + cnt;
    } else {
        min = 1;
        max = cnt;
    }

    std::cout << min << " " << max << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll dp[5][5555*5555];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  ll ga,sa,ba,gb,sb,bb;
  cin>>ga>>sa>>ba>>gb>>sb>>bb;
  ll ans=n;
  // dongri value kin weight
  for(int i=0;i<n+10;i++)dp[0][i]=0;
  for(int i=0;i<3;i++){
    ll wei,val;
    if(i==0){wei=ga;val=gb;}else if(i==1){wei=sa;val=sb;}else{wei=ba;val=bb;}
    for(int w=0;w<=n;w++){
      if(w<wei)
	dp[i+1][w]=dp[i][w];
      if(w >= wei)dp[i+1][w]=max(dp[i][w],dp[i+1][w-wei]+val);
    }
  }
  ll ma=0,num=0;
  for(int j=1;j<=3;j++)
  for(int i=0;i<5555*5555;i++){
    if(ma<dp[j][i]){
      // cout<<i<<" "<<dp[j][i]<<endl;
      ma=max(ma,dp[j][i]);
      num=i;
    }
  }
  if(ans<ma+(n-num))
    ans=ma+(n-num);
  ma=ans;
  for(int i=0;i<ma+10;i++)dp[0][i]=0;
  for(int i=0;i<3;i++){
    ll wei,val;
    if(i==0){wei=gb;val=ga;}else if(i==1){wei=sb;val=sa;}else{wei=bb;val=ba;}
    for(int w=0;w<=ma;w++){
      if(w<wei)
	dp[i+1][w]=dp[i][w];
      if(w >= wei)dp[i+1][w]=max(dp[i][w],dp[i+1][w-wei]+val);
    }
  }
  ll mama=0,numm=0;
  for(int j=1;j<=3;j++)
  for(int i=0;i<5555*5555;i++){
    if(mama<dp[j][i]){
      mama=max(mama,dp[j][i]);
      numm=i;
    }
  }
  ans=max(ans,mama+(ma-numm));
  cout<<ans<<endl;
  return 0;
}


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

int main(){
	int a,b,c,d,e,f;
	double x,y;

	while(true){
		cin >> a >> b >> c >> d >> e >> f;
		if(cin.eof()) break;

		y=(double)(a*f-c*d)/(a*e-b*d);
		x=(double)(c-b*y)/a;

		cout << fixed;
		cout << setprecision(3) << x << " " << y << endl;
	}
	return 0;
}

Measured memory_bytes: 3260
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

void printTime(int sec) {
    int h = sec / 3600;
    sec %= 3600;
    int m = sec / 60;
    sec %= 60;
    printf("%02d:%02d:%02d\n", h, m, sec);
}

void solve74(int h, int m, int s) {
    int sec = 3600 * h + 60 * m + s;
    int left = 7200 - sec;
    printTime(left);
    printTime(left * 3);
}

int main() {
    int h, m, s;
    while (cin>>h>>m>>s, h+m+s+3) {
        solve74(h,m,s);
    }
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
int frog(int n,vector<int>&dp,int a[],int ind,int k)
{
    if(ind==n-1)
    return 0;
    if(dp[ind]!=-1)
    return dp[ind];
    int minicost=INT_MAX;
    for(int i=ind+1;i<=min(n-1,ind+k);i++)
    {
       int cost=abs(a[ind]-a[i])+frog(n,dp,a,i,k);
       minicost=min(cost,minicost); 
    }
    return dp[ind]=minicost;
    
}

int main() {
    int n,k;
    cin>>n>>k;
    int a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    vector<int>dp(n+1,-1);
    cout<<frog(n,dp,a,0,k);
	
}

Measured memory_bytes: 13460
n, y = gets.split.map(&:to_i)

a = b = c = -1
valid = false

0.upto(n) do |i|
  break if valid

  0.upto(((y - 10_000 * i) / 5_000)) do |j|
    k = n - i - j
    valid = 10_000 * i + 5_000 * j + 1_000 * k == y

    if valid
      a, b, c = [i, j, k]
      break
    end
  end
end

puts [a, b, c].join(" ")


Measured memory_bytes: 1788
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int N = ni();
        long[] A = new long[N];
        for (int i = 0; i < N; i++) {
            A[i] = nl();
        }
        int[] count1 = new int[60];
        int[] count0 = new int[60];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < 60; j++) {
                if(((A[i] >> j)&1) == 1){
                    count1[j]++;
                }else{
                    count0[j]++;
                }
            }
        }
        // System.out.println(Arrays.toString(count0));
        // System.out.println(Arrays.toString(count1));
        int ans = 0;
        for (int i = 0; i < 60; i++) {
            long digit = 1L<<i;
            int di = (int)(digit % (long)mod);
            // System.out.println(String.format("%d %d", digit, di));
            int addval = mul(mul(count1[i], count0[i]),di);
            ans = add(ans, addval);
        }
 
        out.println(ans);
    }

    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);

    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 64816
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    string s;
    cin>>s;
    if(s=="ABC") cout<<"ARC"<<endl;
    else cout<<"ABC"<<endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
 
struct edge {int /*from,*/to,cost;};
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> PP;
typedef vector<int> VI;
typedef vector<long long int> VL;
typedef vector<edge> VE;
static const int MOD = 1000000007;
static const int INF = 2147483647;
//static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const int INF = 1000010000;
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define np next_permutation
#define pq priority_queue
#define SZ(a) int((a).size())
#define LEN(a) int((a).length())
#define MAX(a,b,c) max((a),max((b),(c)))
#define MIN(a,b,c) min((a),min((b),(c)))
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REP1(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREP1(i,x) for(int i=((int)(x));i>0;i--)
//#define int ll

signed main(){
    int x;
    scanf("%d",&x);
    if(x<1200) puts("ABC");
    else puts("ARC");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;
    vector<int> A(N);
    REP(i, 0, N) cin >> A[i];

    sort(ALL(A), greater<int>());
    
    using pi = pair<int, pair<int, int>>;
    priority_queue<pi> Q;
    Q.push({min(A[0], A[1]), {0, 1}});
    Q.push({min(A[0], A[1]), {0, 1}});
    ll ans = A[0];
    REP(i, 2, N) {
        auto q = Q.top(); Q.pop();
        ans += q.first;
        Q.push({A[i], {i, q.second.first}});
        Q.push({A[i], {i, q.second.second}});
    }

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

Measured memory_bytes: 7204
#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
constexpr int MOD=1e9+7;

const int mod = 2019 ; 



int main() {
    string s  ; 
    cin >> s ; 
    ll ans = 0 ; 
    int suff = 0;
    int power = 1  ;
    int n = s.size() ; 
    map<int,int> cnt ; 
    cnt[suff]++; 
    for(int i = n -1 ; i >= 0 ; --i) {
        int digit = s[i] - '0' ; 
        suff = (suff + digit * power ) % mod ; 
        power = (power * 10 ) % mod ; 
        ans += cnt[suff] ; 
        cnt[suff]++;
    } 

    cout << ans << endl ;

    return 0 ; 
}



Measured memory_bytes: 3752
#include <iostream>
#include <queue>
#include<algorithm>
#include <vector>
#include<string>
#include<map>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
	string s;
	cin >> s;
	int ans = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '+') ans++;
		else ans--;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	private void solve() {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int P = in.nextInt();
		System.out.println((A*3+P)/2);
	}

	public static void main(String[] args) {
		new Main().solve();
	}
}

Measured memory_bytes: 23124
import java.io.*;
import java.util.*;

public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        long A, B, K;
        {long[] a = in.ll(); A = a[0]; B = a[1]; K = a[2];}
        long i = Math.min(A, K);
        long j = Math.min(K-i, B);
        A -= i;
        B -= j;
        out.println(A+" "+B);
        out.flush();
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        ArrayList<Integer> li(){
            String[] ss = ss();
            ArrayList<Integer> li = new ArrayList<>();
            for(int j = 0; j < ss.length; j++) li.add(Integer.parseInt(ss[j]));
            return li;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


Measured memory_bytes: 24532
#include <bits/stdc++.h>
using namespace std;
     
int main() {
 int a,b,c;
 cin>>a>>b>>c;
    
for (int i =0; i < 10; ++i) {
 if(a >= b) {
  swap(a,b);}
  if(b >= c){
   swap(b,c);
   
  }
 }

    
    
    
cout <<a<<" "<<b<<" "<<c<<endl; 
    
    
}


Measured memory_bytes: 3076
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    int[] x = new int[n];
    for(int i = 0; i < n; i++) {
      x[i] = sc.nextInt();
    }
    int p = -1;
    for(int i = 0; i < n; i++) {
      if(x[i] >= 0) {
        p = i;
        break;
      } 
    }
    int ans = Integer.MAX_VALUE;
    if(p == -1) {
      ans = (-1) * x[n - k];
    } else if(p == 0) {
      ans = x[k - 1];
    } else {
      if(x[p] == 0) {
        for(int i = 0; i <= Math.min(p, k - 1); i++) {
          if(i == k) {
            ans = Math.min(ans, (-1) * x[p - k]);
          } else {
            if((p + k - i - 1) < n) {
              if(i == 0) {
                ans = Math.min(ans, x[p + k - i - 1]);
              } else {
                ans = Math.min(ans, 2 * (-1) * x[p - i] + x[p + k - i - 1]);
                ans = Math.min(ans, (-1) * x[p - i] + 2 * x[p + k - i - 1]);
              }
            }
          }
        }
      } else {
        for(int i = 0; i <= Math.min(p, k); i++) {
          if(i == k) {
            ans = Math.min(ans, (-1) * x[p - k]);
          } else {
            if((p + k - i - 1) < n) {
              if(i == 0) {
                ans = Math.min(ans, x[p + k - i - 1]);
              } else {
                ans = Math.min(ans, 2 * (-1) * x[p - i] + x[p + k - i - 1]);
                ans = Math.min(ans, (-1) * x[p - i] + 2 * x[p + k - i - 1]);
              }
            }
          }
        }
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 51608
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


# globals
S, T = "", ""


def set_inputs():
    global S, T
    S = get_str()
    T = get_str()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    mapper = dict()
    inverser = dict()
    for s, t in zip(S, T):
        m = mapper.get(s, None)
        if m and m != t:
            print("No")
            return
        mapper[s] = t
        i = inverser.get(t, None)
        if i and i != s:
            print("No")
            return
        inverser[t] = s
    print("Yes")
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return zip(*(
        [t(x) for t, x in zip(types, input().split())]
        for _ in range(n)
    ))


if __name__ == '__main__':
    main()


Measured memory_bytes: 41968
#include <iostream>
#include <string>


using namespace std;

int main() {
    string arr1;
    cin >> arr1;
    string arr2;
    cin >> arr2;
    int ctr=0;
    if(arr1.length()==arr2.length())
    {
     for(int i=0;i<arr1.length();i++)
     {
         if(arr1[i]!=arr2[i])
         {
             ctr++;
         }
     }
    }
    cout <<ctr;
    

 
}

Measured memory_bytes: 3916
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	public static void main(String[] args) throws IOException {
		new Main().exec();
	
	}

	public void exec() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		char[] Nchar = br.readLine().toCharArray();
		out.println((Nchar[0] == Nchar[2])?"Yes":"No");
		out.flush();
	}
}


Measured memory_bytes: 23124
#include <algorithm>  // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>     // bitset
#include <cctype>     // isupper, islower, isdigit, toupper, tolower
#include <cstdint>    // int64_t, int*_t
#include <cstdio>     // printf
#include <deque>      // deque
#include <iomanip>    // fixed, setprecision
#include <iostream>   // cout, endl, cin
#include <map>        // map
#include <queue>      // queue, priority_queue
#include <set>        // set
#include <stack>      // stack
#include <string>     // string, to_string, stoi
#include <tuple>      // tuple, make_tuple
#include <unordered_map>  // unordered_map
#include <unordered_set>  // unordered_set
#include <utility>        // pair, make_pair
#include <vector>         // vector
using namespace std;

int main() {
  int64_t N, t = 0;
  cin >> N;
  string s;
  map<string, int64_t> cnt{};

  for (int i = 0; i < N; i++) {
    cin >> s;
    sort(s.begin(), s.end());
    cnt[s]++;
  }

  for (auto &[str, c] : cnt) {
    t += c * (c - 1) / 2;
  }
  cout << t << endl;
}


Measured memory_bytes: 11000
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
using namespace std;
#include <vector>
#define rep(i,n) for (int i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

/*
#include <math.h>
int standerd = int(pow(10.0,9.0)) + 7;
*/
string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 
 

int main(){

    int M;
    int N;
    
    cin >> M;
    cin >> N;

    cout << (M*(M-1)/2+N*(N-1)/2) << endl;    

}

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

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

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            long ans = (long) Math.pow(2, m) * (1900 * m + 100 * (n - m));

            out.print(ans);
        }

    }
}



Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
 
int main() {
   int A, B;
  string op;
  
  cin >> A >> op >> B;
  
  if (op == "+") {
      cout << A+B << endl; 
  }
  else {
      cout << A-B << endl;
  }
}

Measured memory_bytes: 3620