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

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}

int N,M,K;
int A[200005],B[200005];
int sumA[200005],sumB[200005];
int ans;
int T;

signed main(){
    cin>>N>>M>>K;
    for(int i=0;i<N;++i)cin>>A[i];
    for(int i=0;i<M;++i)cin>>B[i];
    sumA[0]=0,sumB[0]=0;
    for(int i=1;i<N+1;++i)sumA[i]=sumA[i-1]+A[i-1];
    for(int i=1;i<M+1;++i)sumB[i]=sumB[i-1]+B[i-1];
    int ans=0;
    for(int i=0;i<N+1;++i){
        if(K<sumA[i])break;
        int C=K-sumA[i];
        int id=upper_bound(sumB,sumB+M+1,C)-sumB-1;
        if(sumA[i]+sumB[id]<=K)chmax(ans,i+id);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 9840
#include <stdio.h>

int main(void)
{
	int a[1000000];
	int max;
	int i, j, k;
	k = 0;
	
	while (scanf("%d", &max) != EOF){
	
	for (i = 0; i <= max; i++){
		a[i] = 1;
		a[0] = 0;
	}
	
	for (i = 1; i < 1000; i++){
		if (a[i] == 1){
			for (j = (i + 1); (i + 1) * j <= max; j++){
				a[(i + 1) * j - 1] = 0;
			}
		}
	}
	
	for (i = 0; i < max; i++){
		if (a[i] == 1){
			k++;
		}
	}
	
	printf("%d\n", k);
	k = 0;
	}
	
	return (0);
}

Measured memory_bytes: 4500
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>

#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
//#define for(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define print(x) std::cout << x << std::endl;

using namespace std;

typedef long long ll;

template<class T, class U> std::string replace(std::string s, const T& target, const U& replacement, bool replace_first = 0, bool replace_empty = 0);
bool isContain(int value, int under, int top);
vector<int> range(int x);

int main(void) {
	//Program Start

	int A, B, C;
	cin >> A >> B >> C;

	if ((A <= C && C <= B) || (A >= C && C>= B)) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}






ProgramEndPointLabel:;

	//Program End
	system("pause");

	return 0;
}


vector<int> range(int y) {
	vector<int> result(y);
	for (int i = 0; i < y; i++)
		result[i] = i;
	return result;
}

bool isContain(int value, int under, int top) {
	if (under <= value && value <= top) return true;
	return false;
}

template<class T, class U> std::string replace(std::string s, const T& target, const U& replacement, bool replace_first, bool replace_empty) {
	using S = std::string;
	using C = std::string::value_type;
	using N = std::string::size_type;
	struct {
		auto len(const S& s) { return s.size(); }
		auto len(const C* p) { return std::char_traits<C>::length(p); }
		auto len(const C  c) { return 1; }
		auto sub(S* s, const S& t, N pos, N len) { s->replace(pos, len, t); }
		auto sub(S* s, const C* t, N pos, N len) { s->replace(pos, len, t); }
		auto sub(S* s, const C  t, N pos, N len) { s->replace(pos, len, 1, t); }
		auto ins(S* s, const S& t, N pos) { s->insert(pos, t); }
		auto ins(S* s, const C* t, N pos) { s->insert(pos, t); }
		auto ins(S* s, const C  t, N pos) { s->insert(pos, 1, t); }
	} util;

	N target_length = util.len(target);
	N replacement_length = util.len(replacement);
	if (target_length == 0) {
		if (!replace_empty || replacement_length == 0) return s;
		N n = s.size() + replacement_length * (1 + s.size());
		s.reserve(!replace_first ? n : s.size() + replacement_length);
		for (N i = 0; i < n; i += 1 + replacement_length) {
			util.ins(&s, replacement, i);
			if (replace_first) break;
		}
		return s;
	}

	N pos = 0;
	while ((pos = s.find(target, pos)) != std::string::npos) {
		util.sub(&s, replacement, pos, target_length);
		if (replace_first) return s;
		pos += replacement_length;
	}
	return s;
}


Measured memory_bytes: 504
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;
typedef pair<int, int> ipair;

const int MAX_N = 2e5 + 1;
int N, K, L;
int par1[MAX_N], par2[MAX_N];
int root1[MAX_N], root2[MAX_N];
int UFTrank1[MAX_N], UFTrank2[MAX_N];

void init1(int n) {
   for (int i = 0; i < n; i++) {
      par1[i] = i;
      root1[i] = i;
      UFTrank1[i] = 0;
   }
}

void init2(int n) {
   for (int i = 0; i < n; i++) {
      par2[i] = i;
      root2[i] = i;
      UFTrank2[i] = 0;
   }
}

int find1(int x) {
   if (par1[x] == x) {
      return x;
   } else {
      return par1[x] = find1(par1[x]);
   }
}

int find2(int x) {
   if (par2[x] == x) {
      return x;
   } else {
      return par2[x] = find2(par2[x]);
   }
}

void unite1(int x, int y) {
   x = find1(x);
   y = find1(y);
   if (x == y) return;

   if (UFTrank1[x] < UFTrank1[y]) {
      par1[x] = y;
   } else {
      par1[y] = x;
      if (UFTrank1[x] == UFTrank1[y]) UFTrank1[x]++;
   }
}

void unite2(int x, int y) {
   x = find2(x);
   y = find2(y);
   if (x == y) return;

   if (UFTrank2[x] < UFTrank2[y]) {
      par2[x] = y;
   } else {
      par2[y] = x;
      if (UFTrank2[x] == UFTrank2[y]) UFTrank2[x]++;
   }
}

bool same1(int x, int y) {
   return find1(x) == find1(y);
}       

bool same2(int x, int y) {
   return find2(x) == find2(y);
}       

int main() {
   cin >> N >> K >> L;
   init1(N);
   init2(N);
   int p, q;
   for (int i = 0; i < K; i++) {
      cin >> p >> q;
      p--;
      q--;
      unite1(p, q);
   }
   int r, s;
   for (int i = 0; i < L; i++) {
      cin >> r >> s;
      r--;
      s--;
      unite2(r, s);
   }

   map<ipair, int> log;
   for (int i = 0; i < N; i++) {
      root1[i] = find1(i);
      root2[i] = find2(i);
      // cout << i << " " << root1[i] << " " << root2[i] << endl;
      log[ipair(root1[i], root2[i])]++;
   }
   for (int i = 0; i < N; i++) {
      cout << log[ipair(root1[i], root2[i])] << " ";
   }
   cout << endl;
   return 0;
}


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

int const MOD = 998244353;

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

int main() {
    ll N;
    cin >> N;
    ll MAX = 0;
    vector<ll> D(N, 0);
    rep(i, N) {
        ll d;
        cin >> d;

        if ((i == 0 && d != 0) || (i != 0 && d == 0)) {
            cout << 0 << endl;
            return 0;
        }

        MAX = max(MAX, d);
        ++D[d];
    }

    ll ans = 1;
    rep(i, MAX + 1) {
        if (i == 0) continue;

        if (D[i] == 0) {
            ans = 0;
            break;
        }

        ans = (ans * modpow(D[i - 1], D[i])) % MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

signed main()
{
  int N;
  cin >> N;
  vector<int> A(N + 1);
  for (int i = 1; i <= N; i++)
  {
    cin >> A.at(i);
  }

  int M = 0;
  vector<int> ans;
  vector<int> V(N + 1, 0);

  for (int i = N; i >= 1; i--)
  {
    vector<int> d;
    for (int j = 1; j * j <= i; j++)
    {
      if (i % j == 0)
      {
        d.push_back(j);
        if (i != j * j) d.push_back(i / j);
      }
    }
    
    if (A.at(i) != V.at(i) % 2)
    {
      M++;
      ans.push_back(i);
      for (int k = 0; k < d.size(); k++)
      {
        V.at(d.at(k))++;
      }
    }
  }
  
  cout << M << endl;
  for (int i = 0; i < M; i++)
  {
    cout << ans.at(i);
    if (i == M - 1) cout << endl;
    else cout << " ";
  }
}

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

int main(){
    int x; cin >> x;
    int n = x/100;
    x %= 100;
    for(int a0 = 0; a0 <= n; ++a0){
        for(int a1 = 0; a0+a1 <= n && a1 <= x; ++a1){
            for(int a2 = 0; a0+a1+a2 <= n && a1+2*a2 <= x; ++a2){
                for(int a3 = 0; a0+a1+a2+a3<=n && a1+2*a2+3*a3 <= x; ++a3){
                    for(int a4 = 0; a0+a1+a2+a3+a4<=n && a1+2*a2+3*a3+4*a4+5*(n-(a0+a1+a2+a3+a4))<=x; ++a4){
                        if(a1+2*a2+3*a3+4*a4+5*(n-(a0+a1+a2+a3+a4)) == x){
                            cout << 1 << endl;
                            return 0;
                        }
                    }
                }
            }
        }
    }
    cout << 0 << endl;
}

Measured memory_bytes: 256
//
// Created on 2020/01/12.
//

#include <istream>
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;
using gragh = vector<vector<int>>;

int main(){
    int H,W;
    cin>>H>>W;
    vector<string> data(H);
    for (int i=0;i<H;i++){
        cin>>data[i];

    }
    queue <vector<int>> d_queue;
    int count =0;
    int ans =0;
    vector<vector<int>> move = {
            {0,  1},
            {1,  0},
            {-1, 0},
            {0,  -1},
    };

    for (int k=0;k<H;k++){
        for (int l=0;l<W;l++){
            if (data[k].at(l) != '#'){
                d_queue.push({k,l,count});
                vector<int> temp_vec(3);
                vector<string>temp_data;
                temp_data = data;
                while (!d_queue.empty()){

                    temp_vec = d_queue.front();
                    d_queue.pop();
                    for (int c=0;c<4;c++){
                        int a,b;
                        a=move[c][0];
                        b=move[c][1];

                        if (0 <= temp_vec[0]+a && temp_vec[0]+a < H && 0 <= temp_vec[1]+b && temp_vec[1]+b < W){
                            if (temp_data[temp_vec[0]+a][temp_vec[1]+b]== '.'){
                                temp_data[temp_vec[0]][temp_vec[1]]= '#';
                                d_queue.push({temp_vec[0]+a,temp_vec[1]+b,temp_vec[2]+1});
                                ans = max(ans,temp_vec[2]+1);
                                temp_data[temp_vec[0]+a][temp_vec[1]+b] = '#';
                            }
                        }
                    }

                }



        }
    }

    }
    cout<<ans<<endl;

}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
	int x, y, i, j;
	while(1){
		scanf("%d %d", &x, &y);
		if(x == 0 && y == 0)break;
		for(i = 0; i < x; i++){
			for(j = 0; j < y; j++){
				if(i % 2 == 0 && j % 2 == 0){
					printf("#");
				}else if (i % 2 == 0 && j % 2 == 1){
					printf(".");
				}else if(i % 2 == 1 && j % 2 == 0){
					printf(".");
				}else if (i % 2 == 1 && j % 2 ==1){
					printf("#");
				}
			}printf("\n");
		}printf ("\n");
	}
	return 0;
}

Measured memory_bytes: 572
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <iomanip>
using namespace std;
#define Int int64_t
using ll = long long;

#define PI  3.14159265358979323846

int main() {

	double a,b ,h,m;
	cin >> a>> b>> h>>m;

	long double sm = m / 60 * 2 * PI;
	
	long double sh = (h / 12 + m / 60 / 12) * 2 * PI;

	long double c = powl(a * a + b * b- 2 * a*b*cos(sh - sm), 0.5);

	cout <<setprecision(16) << c << endl;


}

Measured memory_bytes: 4164
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define queint queue<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>//大きい順
#define pqg priority_queue<int,vec,greater<int>>//小さい順
#define pb push_back
#define vec vector<int>
#define vecvec vector<vector<int>>
#define vecll vector<ll>
#define vecvecll vector<vector<ll>>
#define bs binary_search
#define All(c) (c).begin(),(c).end()
#define mp make_pair
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
string stin(){string s;cin>>s;return s;}
ll lin(){ll x;scanf("%lld",&x);return x;}
int main(){
    string s=stin();
    bool flag=false;
    if(s[0]!=s[1]){
        if(s[0]==s[2]&s[1]==s[3])flag=true;
        else if(s[0]==s[3]&s[1]==s[2])flag=true;
        else flag=false;
    }else{
        if(s[0]==s[2])flag=false;
        else if(s[0]==s[3])flag=false;
        else if(s[2]==s[3])flag=true;
        else flag=false;
    }
    if(flag)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<string> opname{"AB", "AC", "BC"};
    Vi ops(N);
    for (ll i = 0; i < N; i++) {
        string s;
        cin >> s;
        for (ll j = 0; j < 3; j++) {
            if (s == opname[j]) ops[i] = j;
        }
    }

    bool ok = true;
    Vl nums{A, B, C};
    Vi ans(N, -1);
    for (ll i = 0; i < N; i++) {
        ll l, r, e;
        if (ops[i] == 0) {
            l = 0, r = 1, e = 2;
        }
        else if (ops[i] == 1) {
            l = 0, r = 2, e = 1;
        }
        else {
            l = 1, r = 2, e = 0;
        }

        if (nums[l] == 0 && nums[r] == 0) {
            ok = false;
        }
        else if (nums[l] == 0) {
            ans[i] = l;
            ++nums[l], --nums[r];
        }
        else if (nums[r] == 0) {
            ans[i] = r;
            --nums[l], ++nums[r];
        }
        else {
            if (i + 1 < N && ops[i + 1] != ops[i]) {
                ll l2, r2, e2;
                if (ops[i + 1] == 0) {
                    l2 = 0, r2 = 1, e2 = 2;
                }
                else if (ops[i + 1] == 1) {
                    l2 = 0, r2 = 2, e2 = 1;
                }
                else {
                    l2 = 1, r2 = 2, e2 = 0;
                }
                if (nums[l2] > nums[r2]) swap(l2, r2);
                if (nums[l2] == 0) {
                    if (l == r2) {
                        ans[i] = l;
                        ++nums[l], --nums[r];
                    }
                    else {
                        ans[i] = r;
                        --nums[l], ++nums[r];
                    }
                }
                else {
                    ans[i] = l;
                    ++nums[l], --nums[r];
                }
            }
            else {
                ans[i] = l;
                ++nums[l], --nums[r];
            }
        }

        if (!ok) {
            break;
        }
    }

    if (ok) {
        cout << "Yes\n";
        for (ll i = 0; i < N; i++) {
            cout << (char)(ans[i] + 'A') << "\n";
        }
    }
    else {
        cout << "No\n";
    }
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int h = c - a, w = d - b;
  vector<vector<mint>> dp(h+1, vector<mint>(w+1, 0));
  dp.at(0).at(0) = 1;
  rep(i, h+1){
    rep(j, w+1){
      if(j < w)dp.at(i).at(j+1) += dp.at(i).at(j) * (i+a);
      if(i < h)dp.at(i+1).at(j) += dp.at(i).at(j) * (j+b);
      if(j < w && i < h)dp.at(i+1).at(j+1) -= dp.at(i).at(j)*(i+a)*(j+b);
      // rep(l1, h+1){
      //   rep(l2, w+1){
      //     cerr << dp.at(l1).at(l2).x << " ";
      //   }
      //   cerr << endl;
      // }
      // cerr << endl;
    }
  }
  cout << dp.at(h).at(w).x << endl;
  return 0;
}

Measured memory_bytes: 73524
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,P>
#define T tuple<int,int,int>
#define pr(x) cout << x << endl;
using namespace std;
 
int n,m,r,ans;
int cost[210][210];
vector<int> ress;
 
void solve(vector<int> list, vector<int> vis){
  if(list.size()==r){
    int tmp=0;
    rep(i,r-1){
      //cout << i << endl;
      tmp+=cost[list[i]][list[i+1]];
    }
    //cout << tmp << endl;
    ans=min(ans,tmp);
    return;
  }
  rep(i,vis.size()){
    vector<int> nvis=vis;
    vector<int> nlist=list;
    nlist.push_back(ress[nvis[i]]);
    nvis.erase(nvis.begin()+i);
    solve(nlist,nvis);
  }
}
 
int main(){
  cin >> n >> m >> r;
  rep(i,r){
    int tr; cin >> tr;
    ress.push_back(--tr);
  }
  vector<vector<int> > ki(n);
  rep(i,210)rep(j,210){
    cost[i][j]=INF;
    if(i==j) cost[i][j]=0;
  }
 
  rep(i,m){
    int a,b,c; cin >> a >> b >> c;
    a--; b--;
    ki[a].push_back(b);
    ki[b].push_back(a);
    cost[a][b]=cost[b][a]=c;
  }
  rep(i,n)rep(j,n)rep(k,n) cost[j][k]=min(cost[j][k],cost[j][i]+cost[i][k]);

  ans=INF;
  vector<int> vist(r);
  rep(i,r) vist[i]=i;
  vector<int> emp;
  solve(emp,vist);
  cout << ans << endl;
return 0;
}

Measured memory_bytes: 4036
fn main(){
    let scan = std::io::stdin();
    let mut line = String::new();
    let _ = scan.read_line(&mut line);
    let vec: Vec<&str> = line.split_whitespace().collect();
    let c: i32 = vec[0].parse().unwrap();

    let mut line = String::new();
    let _ = scan.read_line(&mut line);
    let vec: Vec<&str> = line.split_whitespace().collect();

    let mut data: Vec<i32> = Vec::new();
    for x in 0..c{
        let n: i32 = vec[x as usize].parse().unwrap();
        data.push(n);
    }
    sort(& mut data);
}

pub fn sort(data:&mut Vec<i32>){
    let mut sorted_data: Vec<i32> = Vec::new();
    for x in 0..data.len(){
        sorted_data.push(data[x]);
        sorted_data.sort();

        for y in 0..sorted_data.len(){
            print!("{}",sorted_data[y]);
            if y != data.len()-1 {
                print!(" ");
            }
        }

        for y in sorted_data.len()..data.len(){
            print!("{}",data[y]);
            if y != data.len()-1 {
                print!(" ");
            }
        }

        println!("");

    }
}

Measured memory_bytes: 5080
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)
	N, A, B, C, D := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()

	x := (N + A - 1) / A * B
	y := (N + C - 1) / C * D

	var z int
	if x < y {
		z = x
	} else {
		z = y
	}

	fmt.Println(z)
}



Measured memory_bytes: 1136
#include<stdio.h>


#define N 100


int main(){
  int A[N],n,i,j,minj,key,count=0;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  for(i=0;i<n;i++){
    minj=i;
    for(j=i;j<n;j++){
      if(A[j]<A[minj]){
	minj=j;
      }
    }
    if(A[i]!=A[minj]){
      key=A[i];
      A[i]=A[minj];
      A[minj]=key;
      count++;
    }
  }
    

  for(i=0;i<n-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n%d\n",A[n-1],count);
  return 0;
}



Measured memory_bytes: 2140
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int n, s;
	while(cin >> n >> s) {
		if(n == 0 && s == 0) break;

		vector<int> v(n);
		rep(i, n) cin >> v[i];

		int ans = 0;
		rep(i, n) {
			REP(j, i + 1, n) {
				if(v[i] + v[j] > s) {
					ans++;
				}
			}
		}
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int X;
    cin >> X;
    int S = X;
    for (int i = 1;; i++) {
        if (S % 360 == 0) {
            cout << i << endl;
            return 0;
        }
        S += X;
    }
}

Measured memory_bytes: 3600
def bekijou(a,x):
  MOD = 1000000007
  ret = 1
  for _ in range(x):
    ret *= a
    ret %= MOD
  return ret
    
n=int(input())
MOD = 1000000007
ret = (bekijou(10,n)+MOD-((2*bekijou(9,n)) % MOD)+bekijou(8,n))%MOD
print(ret)

Measured memory_bytes: 9100
#include <iostream>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <iomanip>
#include <vector>
#include <functional>
#include <algorithm>
#include <cstdio>
#include <random>
#include <ctime>
#include <cstdlib>
#include <unordered_map>
#include <string.h>
#include <iostream>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(0, i, N)
    {
        cin >> A.at(i);
    }
    ll a = 0, b = 0;
    rep(0, i, N)
    {
        rep(0, j, N)
        {
            if (A.at(j) > A.at(i))
            {
                a++;
            }
        }
        rep(i + 1, j, N)
        {
            if (A.at(i) > A.at(j))
            {
                b++;
            }
        }
    }
    ll ans = ((a * ((K * (K - 1) / 2) % MOD) + b * K)) % MOD;
    cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input())
A_list = map(int, input().split())

count = 1

unused = [0] * N
max = 0

for a in A_list:
	if a > 0:
		if unused[a - 1] == 0:
			count = 0
			break
		count = (count * unused[a - 1]) % 1000000007
		unused[a - 1] -= 1
	unused[a] += 1
	if a == 0:
		max += 1
		if max > 3:
			count = 0
			break

if max == 0:
	print(0)
elif max == 1:
	print((count * 3) % 1000000007)
else:
	print((count * 6) % 1000000007)


Measured memory_bytes: 10612
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<stack>
using namespace std;

#define REP(i,n) for(int i=0;(i)<(n);(i)++)
#define ll long long

int main() {
	char a,b;
	cin >> a >> b;
	

	cout << (a==b?"H":"D") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    char s[101],t[101],c[203];
    int n,i,k;
    scanf("%d",&n);
    scanf("%s %s",s,t);
    i=0,k=0;
    while(s[i]!='\0'&&t[i]!='\0')
    {
        c[k]=s[i];
        c[k+1]=t[i];
        k+=2;
        i++;
    }
    c[k]='\0';
    printf("%s",c);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <numeric>
#include <functional>
#include <array>
#include <map>
#include <set>

#define INF 1000000007 //1000000000000000003
#define MOD 1000000007
#define MAX 2000005

#define ll long long

//printf("%.10f", );
//cout << fixed << setprecision(10) << heikin << endl;
//vector<vector<int>> data(3, vector<int>(4, -1));
//left + 1 < top

using namespace std;
using P = pair<int, int>;
using Pc = pair<double, int>;
using T = tuple<int, int, int>;
using edge = struct { int to; long long dist; };
const double PI = 3.1415;
long long fact[MAX], inv[MAX];
int dx[] = { -1,0,1,0 };
int dy[] = { 0,-1,0,1 };

//////////////////////////////////

vector<vector<int>> bingo(3, vector<int>(3));
vector<vector<int>> tree(100005);
int color[100005];
map<P, int>colorMap;
int m = 0;

struct BridgeInfo {
	int town1;
	int town2;
	int year;
	BridgeInfo(int t1, int t2, int y) {
		town1 = t1;
		town2 = t2;
		year = y;
	}
};

struct People {
	int index;
	int town;
	int year;
	People(int i, int t, int y) {
		index = i;
		town = t;
		year = y;
	}
};

bool compare_by_second(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}

struct UnionFind {
	vector<int>uf;

	UnionFind(int size) :uf(size, -1) {};

	int root(int target) {
		if (uf[target] < 0)return target;
		else return uf[target] = root(uf[target]);
	}

	void merge(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b)return;
		if (uf[b] < uf[a])swap(a, b);
		uf[a] += uf[b];
		uf[b] = a;
	}
};

ll CalcPow(ll num, ll power) {
	if (power == 0)return 1;
	if (power % 2 == 0) {
		ll half = CalcPow(num, power / 2);
		return (half * half) % MOD;
	}
	else return (num * CalcPow(num, power - 1)) % MOD;
}

ll combination(ll all, ll select) {
	if (all < select) return 0;
	if (all < 0 || select < 0) return 0;
	return fact[all] * (inv[select] * inv[all - select] % MOD) % MOD;
}

void initCombination(int max) {
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= max; ++i) {
		fact[i] = fact[i - 1] * i % MOD;
	}

	inv[max] = CalcPow(fact[max], MOD - 2);
	for (int i = max - 1; 0 <= i; --i) {
		inv[i] = (inv[i + 1] * (i + 1)) % MOD;
	}
}

ll getGcd(ll a, ll b) {
	if (a < b) {
		ll temp = b;
		b = a;
		a = temp;
	}

	ll r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}

int main() {
	string S; cin >> S;
	string ans = S == "ABC" ? "ARC" : "ABC";
	cout << ans << endl;
}



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

using namespace std;

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

    int n;
    cin >> n;
    vector<int> cnt(1e5 + 1);
    long long sum = 0;
    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        cnt[x]++;
        sum += x;
    }
    int q;
    cin >> q;
    for(int i = 0; i < q; i++)
    {
        int b, c;
        cin >> b >> c;
        int diff = c - b;
        if(diff > 0)
            sum += cnt[b] * diff;
        else
            sum -= cnt[b] * abs(diff);
        cnt[c] += cnt[b];
        cnt[b] = 0;
        cout << sum << "\n";
    }

    return 0;
}


Measured memory_bytes: 3728
package main

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

	"github.com/emirpasic/gods/trees/redblacktree"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	h := getNextInt(scanner)
	w := getNextInt(scanner)

	rbt := redblacktree.NewWithIntComparator()
	rbt2 := redblacktree.NewWithIntComparator()
	for i := 0; i < w; i++ {
		rbt.Put(i, i)
	}
	rbt2.Put(0, w)

	for i := 0; i < h; i++ {
		a := getNextInt(scanner) - 1
		b := getNextInt(scanner)
		x := -1
		for node, ok := rbt.Ceiling(a); ok && node.Key.(int) <= b; node, ok = rbt.Ceiling(a) {
			k := node.Key.(int)
			v := node.Value.(int)
			rbt.Remove(k)
			if x < v {
				x = v
			}
			old, _ := rbt2.Get(k - v)
			o := old.(int)
			if o == 1 {
				rbt2.Remove(k - v)
			} else {
				rbt2.Put(k-v, o-1)
			}
		}
		if b < w && x != -1 {
			old, found := rbt.Get(b)
			if found {
				x = max(old.(int), x)
			}
			rbt.Put(b, x)
			old, found = rbt2.Get(b - x)
			if found {
				rbt2.Put(b-x, old.(int)+1)
			} else {
				rbt2.Put(b-x, 1)
			}
		}
		if rbt2.Empty() {
			fmt.Fprintln(writer, -1)
			continue
		}
		fmt.Fprintln(writer, rbt2.Left().Key.(int)+i+1)
	}
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}


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

int main() {
    int n;
    cin >> n;
    int A[n][40];
    int sum[40];
    memset(A, 0, sizeof(A));
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < n; i++) {
        ll a;
        cin >> a;
        int count = 0;
        while (a) {
            A[i][count] = a % 2;
            sum[count] += a % 2;
            a /= 2;
            count++;
        }
    }
    int ans[n][40];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 40; j++) {
            if (sum[j] % 2 == A[i][j]) ans[i][j] = 0;
            else ans[i][j] = 1;
        }
    }
    for (int i = 0; i < n; i++) {
        ll ret = 0;
        ll keta = 1;
        for (int j = 0; j < 40; j++) {
            ret += keta * ans[i][j];
            keta *= 2;
        }
        cout << ret << " ";
    }
    cout << endl;
    return 0;
}

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

using namespace std;

int n, at;
vector<vector<int>> ans;

int main() {
	scanf("%d", &n);
	for (int i = 0; ; i++) {
		ans.emplace_back();
		for (int j = 0; j < i; j++) {
			at++;
			ans[i].push_back(at);
			ans[j].push_back(at);
			if (at > n)
				break;
		}
		if (at == n) {
			puts("Yes");
			printf("%d\n", (int)ans.size());
			for (auto& j : ans) {
				printf("%d", (int)j.size());
				for (int k : j)
					printf(" %d", k);
				puts("");
			}
			return 0;
		} else if (at > n) {
			printf("No\n");
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 2304
#include <iostream>

using namespace std;

int main()
{
    double d,t,s;
    cin>>d>>t>>s;
    double ti = d/s;
    if(ti>t)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3752
local mmi, mma = math.min, math.max
local n, m = io.read("*n", "*n")
local s, t = io.read("*n", "*n")
local edge1, edge2 = {}, {}
for i = 1, n do
  edge1[i], edge2[i] = {}, {}
end
for i = 1, m do
  local u, v = io.read("*n", "*n")
  local a, b = io.read("*n", "*n")
  edge1[u][v] = a
  edge1[v][u] = a
  edge2[u][v] = b
  edge2[v][u] = b
end
local inf = 1000000000000000

local function getlength(start_idx, edge)
  local taskstate = {}
  for i = 1, n do taskstate[i] = false end
  local tasks = {}
  local tasknum = 0
  local done = 0

  local len = {}
  for i = 1, n do len[i] = inf end
  len[start_idx] = 0

  local function addtask(idx)
    if not taskstate[idx] then
      taskstate[idx] = true
      tasknum = tasknum + 1
      tasks[tasknum] = idx
    end
  end
  addtask(start_idx)

  while done < tasknum do
    done = done + 1
    local src = tasks[done]
    taskstate[src] = false
    for dst, cost in pairs(edge[src]) do
      if len[src] + cost < len[dst] then
        len[dst] = len[src] + cost
        addtask(dst)
      end
    end
  end
  return len
end

local len1 = getlength(s, edge1)
local len2 = getlength(t, edge2)
local ret = {}
for i = 1, n do
  ret[i] = 0
end
local z = 0
for i = n, 1, -1 do
  z = mma(z, inf - len1[i] - len2[i])
  ret[i] = z
end
print(table.concat(ret, "\n"))


Measured memory_bytes: 57820
#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int 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;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

vector< pair<ll,ll> > prime_factorize(ll n){
   vector<pair<ll, ll> > res;
   for (ll p = 2; p*p<=n; ++p){
       if(n%p != 0) continue;
       int num = 0;
       while(n%p == 0){
           ++num; 
           n /= p; 
       }
       res.push_back(make_pair(p, num));
   }
   if (n != 1) res.push_back(make_pair(n,1));
   return res;
}

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    int n;
    cin>>n;
    map<int,int> fact;
    REP(i,1,n+1){
        vector<Pii> a=prime_factorize(i);
        REP(j,0,a.size()) fact[a[j].first]+=a[j].second;
    }


    int ans=1;
    for(auto x : fact){
        ans = (ans * (x.second+1))%MOD; 
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int max = 0;
  if (A > B) {
    max = B;
  }
  if (A < B) {
    max = A;
  }
  if (A == B) {
    max = A;
  }
  int min = 0;
  if(N >= (A+B)) {
    min = 0;
  } else {
    if(A > B) {
      min = A - (N - B);
    }
    if(A < B) {
      min = B - (N - A);
    }
    if(A == B) {
      min = A - (N - B);
    }
  }
  cout << max << " " << min << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
 
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
 
using namespace std;

signed main()
{
    fast;
    string s;
    cin>>s;

    for ( int i = 0 ; i < s.length() ; i++ )
    {
        cout<<"x";
    }
    cout<<endl;
    return 0;
}

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

int myf(int x){
    if(x%10==0) return x;
    else return (x/10)*10+10;
}

signed main(){
    int ans=0;
    int mi=0;
    REP(i,5){
        int a;
        cin>>a;
        ans+=myf(a);
        if(a%10!=0) mi=max(mi,10-a%10);
    }
    cout<<ans-mi<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mx INT_MAX
#define mn INT_MIN
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define itr set<int> :: iterator
const int N = 1e5+10;

int dp[100001];

int main(){

  // **** START HERE ****
       
   int n, k;
   cin>>n>>k;
   
   vector<int> a;
   for(int i=0; i<n; i++){
   	int x;
   	cin>>x;
   	a.pb(x);
   }

   memset(dp, 0, sizeof(dp));

   for(int i=1; i<=k; i++){
   	for(int j=0; j<n; j++){
   		if(i- a[j] < 0)
   			break;
   		if(dp[i-a[j]] == 0){
   			dp[i] = 1;
   			break;
   		}
   		
   	}
   }

   if(dp[k] == 1)
     cout<<"First"<<endl;
   else
   	 cout<<"Second"<<endl;

//   **** END HERE ****
    
    return 0;
}

Measured memory_bytes: 4024
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
struct shu
{
	int k;
    long long m;
}p[200010];
int cam1(shu x,shu y)
{
	return x.m<y.m;
}
int cam2(shu x,shu y)
{
	return x.k<y.k;
}
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>p[i].m;
		p[i].k=i;
	}
	sort(p,p+n,cam1);
	int tem1=p[n/2-1].m;
	int tem2=p[n/2].m;
	sort(p,p+n,cam2);
	for(int i=0;i<n;i++)
	{
		if(p[i].m==tem1)
		{
			cout<<tem2<<endl;continue;
		}
		if(p[i].m==tem2)
		{
			cout<<tem1<<endl;continue;
		}
		if(p[i].m<tem1)
		{
			cout<<tem2<<endl;continue;
		}
		if(p[i].m>tem2)
		{
			cout<<tem1<<endl; continue;
		}
	}
	return 0;
} 

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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved

int main(){
    long long a;
    long double b;
    cin>>a>>b;
    cout<<(long long)floor((long double)a*b)<<endl;
    return 0;

}
/*


*/


Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")  
#pragma GCC optimize ("-fno-defer-pop")
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define sc second
#define N 3000005
#define endl "\n"
#define mod 1000000007
int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll r,d,x,i,j,k,l;

	cin>>r>>d>>x;

	for(i=1;i<=10;i++){
		k=r*x-d;
		cout<<k<<endl;
		x=k;
	}
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main ()
{
    int a,b,c,e,f,h;
    scanf("%d %d %d",&a,&b,&c);
    e=a+b;
    f=a+c;
    h=b+c;
    if((e<f ||e==f) &&(e<h ||e==h))
    {
        printf("%d",e);
    }
    else if((f<e || f==e) &&(f<h ||f==h))
    {
        printf("%d",f);
    }
    else
    {
        printf("%d",h);
    }
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int N;
int max;

int main(){
    scanf("%d", &N);

    int C[N];
    int V[N];
    
    int i;
    for(i = 0; i < N; i++){
        scanf("%d", &V[i]);
    }
    for(i = 0; i < N; i++){
        scanf("%d", &C[i]);
    }

    for(i = 0; i < N; i++){
        if(V[i] - C[i] > 0){
            max += V[i] - C[i];
        }
    }
    
    printf("%d\n",max);

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
int main(){	
	ios_base::sync_with_stdio(false);
	    cin.tie(NULL);
	    int n;
	    cin >> n;
	    string s;
	    cin >> s;
	    int ans = 0 ;
	    for(int i = 0 ; i < n - 2 ; i++){
	    	if(s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
	    		ans++;
	    }
		cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, li, ri, x = 0;

  cin >> N;

  for(int i = 0; i < N; i++){
      cin >> li >> ri;
      x = x + ri - li +1;
  }

  cout << x << endl;


}


Measured memory_bytes: 384
/*https://freestylewiki.xyz/fswiki/wiki.cgi?page=%E5%8B%95%E7%9A%84%E8%A8%88%E7%94%BB%E6%B3%95+-+%E3%82%B3%E3%82%A4%E3%83%B3%E5%95%8F%E9%A1%8C

*/
#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
const ll mod = 1e9 + 7;
typedef pair<int,int>           PI;
typedef pair<ll,ll>             PL;
typedef vector<PI>               vip; 
typedef vector<int>             vi;
typedef vector<vi>              vvi;
typedef vector<ll>              vl;
typedef vector<vl>              vvl;








int main (){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m ;
    vi c(m);
    REP(i,m){
        cin >> c[i];
    }
    sort(c.begin(), c.end(), greater<int>());
    int dp[50001] = {0};
    REPS(i,50000) dp[i] = 100000;
    for(int i = 0; i <= 50000; i++){
        for(int j = 0; j < m; j++){
            if(i+c[j] <= n){
                dp[i+c[j]] = min(dp[i+c[j]], dp[i] + 1);
            }
        }
    }
    cout << dp[n] << endl;







    return 0;
}


Measured memory_bytes: 3412
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author P.Alizadeh
 */

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long int   ll;
typedef long double     ld;
typedef pair<ll,ll>     pll;
typedef complex<ld>     cld;

#define all(x)          x.begin(),x.end()
#define Sort(x)         sort(all(x))
#define kill(x)         return cout << x << endl, 0;
#define Mp              make_pair
#define X               first
#define Y               second
#define sep             " "
#define endl            "\n"
#define fastio          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io         freopen("in.txt" , "r" , stdin) ; freopen("out.txt" , "w" , stdout);
#define ld_io           cout << setprecision(10) << fixed;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll pw(ll a, ll b, ll md) {
    if (!b)
        return 1;
    if (b & 1)
        return a * pw(a * a % md, b / 2, md) % md;
    return pw(a * a % md, b / 2, md) % md;
}

const ll MAXN = 1e5 + 10,
         INF  = 8e18,
         LOG  = 32;
//const ld PI   = M_PI;

ll n, MOD, dp[MAXN], ans[MAXN], prv[MAXN], nxt[MAXN];
vector<ll> adj[MAXN], dp2[MAXN];

void dfs1(ll u, ll p = -1) {
    vector<ll> g;

    dp[u] = 1;
    for (ll v : adj[u]) {
        if (v == p) continue;
        dfs1(v, u);
        g.push_back(v);
        dp[u] *= dp[v] + 1;
        dp[u] %= MOD;
    }

    ll m = g.size();
    if (m == 0) return;

    prv[0] = nxt[m - 1] = 1;
    for (ll i = 1; i < m; i++) {
        prv[i] = prv[i - 1] * (dp[g[i - 1]] + 1) % MOD;
        nxt[m - i - 1] = nxt[m - i] * (dp[g[m - i]] + 1) % MOD;
    }
    for (ll i = 0; i < m; i++)
        dp2[u].push_back(prv[i] * nxt[i] % MOD);
}

void dfs2(ll u, ll p = -1, ll res = 0) {
    ans[u] = (res + 1) * dp[u] % MOD;
    ll m = 0;
    for (ll v : adj[u]) {
        if (v == p) continue;
        dfs2(v, u, (res + 1) * dp2[u][m] % MOD);
        m++;
    }
}

int main()
{
    fastio;
    //ld_io;

    cin >> n >> MOD;
    for (ll i = 0; i < n - 1; i++) {
        ll u, v;
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    dfs1(1);
    dfs2(1);

    for (ll i = 1; i <= n; i++) {
        cout << ans[i] % MOD << endl;
    }

    return 0;
}



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


int main() {
  int A, B;
  cin >> A >> B;
  
  if(A != 1 && B != 1){
    cout << 1;
  }
  if(A != 2 && B != 2){
    cout << 2;
  }
  if(A != 3 && B != 3){
    cout << 3;
  }
  return 0;
}

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

  

int main(){
  int N; cin >> N; ll a[N]; ll cnt[N] = {};
  rep(i, N){
    cin >> a[i]; a[i]--; cnt[a[i]]++;
  }
  ll ans = 0;
  rep(i, N){
    ans+=(cnt[i]*(cnt[i]-1))/2;
  }
  rep(i, N){
    cout << ans - cnt[a[i]] + 1 << endl;
  }
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
int main(){
	int W,H,x,y,r;
	cin >> W >> H >> x >> y >> r;
	if(r<=x&&x<=W-r&&r<=y&&y<=H-r){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
}


Measured memory_bytes: 3120
# encoding: utf-8
ABC = sorted(map(int, input().split()))

if (ABC[2] - ABC[0]) % 2 == (ABC[2] - ABC[1]) % 2:
    print((2 * ABC[2] - ABC[1] - ABC[0]) // 2)
else:
    print(1 + (2 * ABC[2] - ABC[1] - ABC[0] + 1) // 2)

Measured memory_bytes: 3060