akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const long long MOD=1000000007;
int n,a[10010],x[1000010],p=1000000007,inv[1000010],mx=0;
long long ans,num=1;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d",&a[i]),mx=max(mx,a[i]);
	inv[1]=1;
	for(int i=2;i<=mx;++i) inv[i]=((long long)inv[p%i]*(p-p/i))%p;
//	for(int i=1;i<=mx;++i) printf("%d ",inv[i]);
//	printf("\n");
	for(int i=1;i<=n;++i) {
		int b=a[i];
		for(int j=2;j*j<=a[i];++j) {
			int tmp=0;
			while(b%j==0) {
				b/=j;
				tmp++;
			}
			x[j]=max(x[j],tmp);
		}
		x[b]=max(x[b],1);
	}
	for(int i=2;i<=mx;++i)
		for(int j=1;j<=x[i];++j)
			num=(num*(long long)i)%MOD;
//	printf("%lld\n",num);
	for(int i=1;i<=n;++i) ans+=num*(long long)inv[a[i]],ans%=MOD;//printf("%lld ",num*(long long)inv[a[i]]);
	printf("%lld",ans%MOD);
	return 0;
}

Measured memory_bytes: 7168
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m)-1; i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << p.first << " " << p.second; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const ld PI    = acos(-1.0);
const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


int main() {
  ll a, b, c, k; cin >> a >> b >> c >> k;
  ll ans = a-b;
  if (k&1) ans *= -1;
  cout << ans << "\n";
  return 0;
}


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

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

int main(){
	int n, a, b;
	vector<int> v;
	string s;
	cin>>n;
	cin>>s;
	if(s.size()%2)	{
		cout<<"No";
		return 0;
	}
	for(int i=0;i<s.size()/2;i++) {
		if(s[i] != s[s.size()/2+i]){
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	
	
	
}

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

typedef long long ll;


int main() 
{
    ll n,r;
    cin>>n>>r;
    if(n>=10)
    {
        cout<<r<<endl;
    }
    else
    {
        cout<<r+(100*(10-n))<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        boolean result = false;
        for (int i=1; i<=9; i++) {
            if (n % i == 0) {
                int shou = n / i;
                if (shou <= 9) {
                    result = true;
                    break;
                }
            }
        }
        System.out.print(result ? "Yes" : "No");
    }
}

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, m, r;
  while (cin >> n >> m >> r) {
    const lli inf = 1LL << 60;
    const int N = 200 + 3;
    static lli g[N][N];
    fill(&g[0][0], &g[N - 1][N - 1] + 1, inf);

    vector<int> v(r);
    cin >> v;
    each (i, v) --i;

    for (int i = 0; i < m; ++i) {
      int a, b, c;
      cin >> a >> b >> c;
      --a;
      --b;
      g[a][b] = g[b][a] = c;
    }
    for (int k = 0; k < N; ++k) {
      for (int i = 0; i < N; ++i) {
        for (int j = 0; j < N; ++j) {
          setmin(g[i][j], g[i][k] + g[k][j]);
        }
      }
    }

    lli mn = inf;
    sort(v.begin(), v.end());
    do {
      lli sum = 0;
      for (int i = 0; i + 1 < v.size(); ++i) {
        sum += g[v[i]][v[i + 1]];
      }
      setmin(mn, sum);
    } while (next_permutation(v.begin(), v.end()));
    cout << mn << endl;
  }

  return 0;
}


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

int main() {
  string S;
  cin >> S;
  char a, b, c;
  a = S.at(0);
  b = S.at(1);
  c = S.at(2);
  if(a == b & b == c) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n, m; readV(n, m);

  auto uf = UnionFind(n);
  foreach (_; 0..m) {
    int x, y; readV(x, y); --x; --y;
    uf.unite(x, y);
  }

  writeln(uf.countForests);
}

struct UnionFind
{
  import std.algorithm, std.range;

  int[] p;
  const size_t n;
  const int s;
  size_t cf;
  size_t[] cn;

  this(size_t n)
  {
    this.n = n;
    s = cast(int)n;
    p = new int[](n);
    p[] = s;
    cf = n;
    cn = new size_t[](n); cn[] = 1;
  }

  bool unite(int i, int j)
  {
    auto pi = subst(i), pj = subst(j);
    if (pi != pj) {
      p[pj] = pi;
      --cf;
      cn[pi] += cn[pj];
      return true;
    } else {
      return false;
    }
  }

  bool isSame(int i, int j) { return subst(i) == subst(j); }
  @property countForests() { return cf; }
  auto countNodes(int i) { return cn[subst(i)]; }

  auto groups()
  {
    auto g = new int[][](n);
    foreach (i; 0..cast(int)n) g[subst(i)] ~= i;
    return g.filter!(l => !l.empty);
  }

private:

  int subst(int i) { return p[i] == s ? i : (p[i] = subst(p[i])); }
}


Measured memory_bytes: 4220
import heapq
N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
x = []
for i in range(N):
    heapq.heappush(x, -A[i])
for i in range(M):
    p = -heapq.heappop(x)
    heapq.heappush(x, -(p // 2))
ans = -sum(x)
print(ans)

Measured memory_bytes: 91920
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;

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

    int H, W, h, w;

    cin >> H >> W >> h >> w;

    if (!(H % h) && !(W % w))
    {
        cout << "No" << endl;
        return 0;
    }

    int res[510][510];

    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++)
            res[i][j] = 1;

    ll sum = H * W;

    for (int i = h - 1; i < H; i += h)
        for (int j = w - 1; j < W; j += w)
            res[i][j] = -h * w, sum -= h * w + 1;

    int a = H * W - (H - H % h) * (W - W % w);

    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++)
            if (res[i][j] > 0)
                res[i][j] += max(0LL, 1LL - sum);
            else
                res[i][j] -= (h * w - 1) * max(0LL, 1LL - sum);

    cout << "Yes" << endl;

    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++)
            cout << res[i][j] << (j == W - 1 ? "\n" : " ");

    return 0;
}

Measured memory_bytes: 3072
//	Totally unrelated and not AT ALL stolen from hohohaha's, generic_placeholder_name's or katoriyuu's template
#include <bits/stdc++.h>

using namespace std;

#pragma GCC optimize("O3")
#pragma GCC target("avx")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define gcd __gcd
#define rep(i,s,end) for(int i = (s); i <  (end); ++i)
#define rep0(i, end) for(int i =   0; i <= (end); ++i)
#define rep1(i, end) for(int i =   1; i <= (end); ++i)
#define lb lower_bound
#define ub upper_bound

#define vt vector
#define endl "\n"

#define fileopen(filename, in_type, out_type) if (fopen(filename in_type, "r")) {freopen(filename in_type, "r", stdin);freopen(filename out_type, "w", stdout);}
#define local_input(x) if (x && fopen("input.txt","r")) freopen("input.txt","r",stdin);
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fscan(x)   scanf("%d",  &x)
#define fscandb(x) scanf("%lf", &x)
#define fscanll(x) scanf("%lld",&x)
//	Until next time, remember:
//			You are closer than you think.
//						_Dan Lok_

#define db double
#define ll long long
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define pi 3.1415926535897932	//faster than pi = acos(-1); but sometimes doesn't work?
//	srand(chrono::steady_clock::now().time_since_epoch().count());
//	freopen("input.txt","r",stdin);

#define mn 1 << 18
int n;
int id1[mn],id2[mn],dp1[mn],dp2[mn];
signed main()
{
	fastio;
	fileopen("cricket",".in",".out");
	cin >> n; rep(i,0,1 << n){
		cin >> dp1[i]; id1[i] = i, dp2[i] = id2[i] = -1;
	}
	rep(i,1,1 << n){
		rep(j,0,n) if(i & (1 << j)){
			int jj = i ^ (1 << j);
			if(jj){
				if(id1[i] == id1[jj]) continue;
				if(dp1[i] <= dp1[jj] && id1[i] != id1[jj]){
					dp2[i] = dp1[i],  id2[i] = id1[i];
					dp1[i] = dp1[jj], id1[i] = id1[jj];
					if(dp2[i] <= dp2[jj] && id2[i] != id2[jj]){
						dp2[i] = dp2[jj], id2[i] = id2[jj];
					}
					continue;
				}
				if(dp2[i] <= dp1[jj] && id2[i] != id1[jj]){
					dp2[i] = dp1[jj], id2[i] = id1[jj];
					continue;
				}
			}
			else{
				if(dp1[0] > dp1[i]){
					dp2[i] = dp1[i], id2[i] = id1[i];
					dp1[i] = dp1[0], id1[i] = id1[0];
				}
				else if(dp1[0] > dp2[i]){
					dp2[i] = dp1[0], id2[i] = id1[0];
				}
			}
		}
	}
	// rep(i,1,1 << n){
		// printf("%d %d   %d %d\n",dp1[i],id1[i], dp2[i],id2[i]);
	// }
	int ans = 0;
	rep(i,1,1 << n){
		cout << (ans = max(ans, dp1[i] + dp2[i])) << endl;
	}
	return 0;
}
// with the aura of Dora, AC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Why is there a one in my row of exclamation marks?
 

Measured memory_bytes: 7732
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
string s,a="dream",b="erase";

int main(){
	cin >> s;
	
	REP(i,0,s.size()){
		if(s.substr(i,5)==a) i+=a.size()-1;
		else if(s.substr(i,5)==b) i+=b.size()-1;
		else if(s.substr(i-1,3)=="mer") i++;
		else if(s.substr(i-1,2)=="er") continue;
		else{cout << "NO" << endl; return 0;}
	}
	
	cout << "YES" << endl;
	return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
// #pragma GCC optimize("O2")
typedef long long int ll;
typedef long double ld;
typedef map <ll,ll> mm;
typedef vector <ll> mv;
typedef pair <ll,ll> mp;
typedef set <ll> ms;
typedef multiset <ll> mms;
typedef queue <ll> mq;
typedef deque <ll> mdq;
typedef stack <ll> mst;
typedef priority_queue <ll> mpq;
typedef priority_queue <ll, vector<ll>, greater<ll> > mmh;
typedef complex<double> cd;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define flush cout.flush();
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define pb(v) push_back(v)
#define lb(v) lower_bound(v)
#define ub(v) upper_bound(v)
#define cn continue
#define forl(i,n) for(ll i=0;i<n;i++)
#define forlr(i,n) for(ll i=n-1;i>=0;i--)
#define rev(s) reverse(s.begin(),s.end())
void swap(ll &a,ll &b) {
	ll tmp=a;
	a=b;
	b=tmp;
}
ll atoistring(string s) {
	stringstream lol(s);
	ll x;
	lol>>x;
	return x;
}
void pv(mv v) {
	forl(i,v.size()) cout<<v[i]<<" ";
	cout<<"\n";
}
void pa(ll *v, ll size) {
	forl(i,size) cout<<v[i]<<" ";
	cout<<"\n";
}
void removeDups(mv &v) {
	sort(all(v));
	mv::iterator it = unique(v.begin(), v.end());
	v.resize(distance(v.begin(), it));
}
// ll facs[], facsinv[];
// ll nck(ll N,ll K,ll mod) {
// 	if(N<K) return 0;
// 	return (((facs[N]*facsinv[N-K])%mod)*facsinv[K])%mod;
// }
inline ld kthRoot(ld n, ll k) {
	return pow(k, (1.0 / k) * (log(n) / log(k)));
}
ll power(ll x, ll y, ll p) {
	ll res=1;
	x=x%p;
	while(y>0) {
		if(y&1) res = (res*x)%p;
		y=y>>1;
		x=(x*x)%p;
	}
	return res;
}
void checkmod(ll &x, ll mod) {
	if(x>=mod) x%=mod;
}
ll ncr(ll n, ll r, ll mod) {
	ll ans = 1;
	forl(i,min(r,n - r)) {
		ans *= n - i;
		checkmod(ans,mod);
		ans *= power(i+1, mod - 2,mod);
		checkmod(ans,mod);
	}
	return ans;
}
ll sumofgp(ll a, ll n, ll m) {
	// n = number of terms - 1
	if(n < 0) return 0;
	if(n == 0) return 1;
	if(n==1) return (1+a)%m;
	ll ans;
	if(n%2) ans=(1+a)*sumofgp((a*a)%m,(n-1)/2,m);
    else ans=1+((a*(1+a))%m)*sumofgp((a*a)%m,n/2-1,m);
    return ans%m;
}
ll power_of_2_not_less(ll n) {
	if(!n) return 1;
	n--;
	n |= n>>1;
	n |= n>>2;
	n |= n>>4;
	n |= n>>8;
	n |= n>>16;
	n |= n>>32;
	n++;
	return n;
}
ll mod = 1e9 + 7;
// void checktime()
// {
// 	struct timespec ts;
// 	printf("Running Program\n");
// 	clock_gettime(CLOCK_MONOTONIC_RAW,&ts);
// 	long double st=ts.tv_nsec/(1e9)+ts.tv_sec;
// 	// Call Funcn Here
// 	clock_gettime(CLOCK_MONOTONIC_RAW,&ts);
// 	long double en=ts.tv_nsec/(1e9)+ts.tv_sec;
// 	printf("Program ended\nTime = %Lf\n",en-st);
// }

void thisIsMain() {
	ll n;
	cin>>n;
	if(n >= 30) cout<<"Yes\n"; else cout<<"No\n";
}

int main(void)
{
	fastio
	ll t = 1;
	// cin>>t;
	while(t--) thisIsMain();
	return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

int main(){
    ll S;
    cin>>S;
    ll S_ = S;
    ll N = 0;
    while(S_>=1){
        S_/=10;
        N++;
    }

    ll i2 = 1;

    ll minS = INF;
    rep(i,0,N-2){
        ll s = abs((S/i2) % 1000 - 753);
        minS = min(minS,s);
        i2 *= 10;
    }
    cout<< minS;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
signed main() {
  int x, y;
  cin >> x >> y;
  int g = __gcd(x,y);
  int ans = x+y -g+1;
  cout << ans << endl;
}



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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

string s;
map<char, int> hs;

int main()
{
  hs['I'] = 1;
  hs['V'] = 5;
  hs['X'] = 10;
  hs['L'] = 50;
  hs['C'] = 100;
  hs['D'] = 500;
  hs['M'] = 1000;

  while(cin >> s){
    int res = 0;
    rep(i, s.size()-1){
      if(hs[s[i]] < hs[s[i+1]])  res -= hs[s[i]];
      else res += hs[s[i]];
    }
    res += hs[s[s.size()-1]];
    cout << res << endl;
  }

  return 0;
}

Measured memory_bytes: 1184
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

int main(){
    ll N;
    cin>>N;
    v A(N);
    rep(i,0,N)cin>>A[i];

    sort(all(A));
    ll sum =0;
    rep(i,1,N){
        if(A[i] == A[i-1])sum++;
    }
    if(sum%2 == 1)sum++;
    cout<<N-sum;
    return 0;
}

Measured memory_bytes: 1024
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func init() {
	// read one word/char/int separated by space(s).
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 8000000), 8000000)

	// read one line.
	// sc.Split(bufio.ScanLines)
}

func main() {
	var n, q int
	n = nextInt()
	q = nextInt()
	var g = make([][]int, n+1)
	for i := 1; i < n; i++ {
		var a, b int
		a = nextInt()
		b = nextInt()
		g[a] = append(g[a], b)
		g[b] = append(g[b], a)
	}
	var v = make([]int, n+1)
	for i := 0; i < q; i++ {
		var p, x int
		p = nextInt()
		x = nextInt()
		v[p] += x
	}

	que := make([]int, 0)
	que = append(que, 1)
	done := make([]bool, n+1)

	for len(que) != 0 {
		parent := que[0]
		que = que[1:]
		done[parent] = true

		for _, child := range g[parent] {
			if done[child] {
				continue
			}
			v[child] += v[parent]
			que = append(que, child)
		}
	}
	for i := 1; i < n+1; i++ {
		if i > 1 {
			fmt.Print(" ")
		}
		fmt.Print(v[i])
	}
	fmt.Println("")
}


Measured memory_bytes: 34304
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
point = [K for _ in range(N)]
for i in range(Q):
  point[A[i]-1] += 1
point = [i-Q for i in point]
for i in range(N):
  if point[i]>0:
    print('Yes')
  else:
    print('No')

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

int main()
{
    int a, b, count = 0;
    cin >> a >> b;
    for (int i = a; i <= b; i++)
    {
        if (i / 10000 == i % 10 && (i / 1000) % 10 == (i / 10) % 10)
        {
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
#define INF 100000000
#define IINF 9999999999999;
using vint = std::vector<int>;
using ll = long long;
using vll = std::vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = std::min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = std::max(a, b); }

//original problem

int prime[25] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
string S;
int B;
int decomposition_of_numbers[101];
int prime_filling_up[101];

int main() {
    vector<int> A;
    rep(i, 3) {
        int temp;
        cin >> temp;
        A.push_back(temp);
    }
    sort(A.begin(), A.end());
    int ans = 0;
    ans += abs(A[1] - A[0]);
    ans += abs(A[2] - A[1]);
    cout << ans << endl;
}

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

int main()
{
	double W,H,x,y;
	cin >> W >> H >> x >> y;
	double ans = W * H /2;

	cout << ans << " ";

	if (x * 2 == W && y * 2 == H) cout << "1" << endl;
	else cout << "0" << endl;
	return 0;
}

Measured memory_bytes: 256
N,M = map(int,input().split())
mi = 0
ma = 10 ** 6
for i in range(M):
  L,R = map(int,input().split())
  mi = max(mi,L)
  ma = min(ma,R)
if(ma - mi + 1 <= 0):
  print("0")
else:
  print(str(ma - mi + 1))

Measured memory_bytes: 3060
#include<stdio.h>

int main(void)
{
    int a, b, c;
    int tmp;
    scanf("%d %d %d", &a, &b, &c);

    tmp = a;
    a = b;
    b = tmp;

    tmp = a;
    a = c;
    c = tmp;

    printf("%d %d %d\n", a, b, c);

    return 0;
}

Measured memory_bytes: 128
H,W = map(int,input().split())
li = [input() for i in range(H)]
num_lists = []
num_lists2 = []
for i in range(H):
    if "#" in li[i]:
        print("") 
    else :
        num_lists.append(i)
for i in reversed(num_lists):
    li.pop(i)
n_H = len(li)
for i in range(W) :
    ch_li = []
    for j in range(n_H):
        ch_li.append(li[j][i])
    if "#" in ch_li:
        print("")
    else :
        num_lists2.append(i)
for i in reversed(num_lists2):
    for k in range(n_H) :
        li[k] = li[k][:i]+li[k][(i+1):]
        
for i in li:
    for j in i:
        print(j,end="")
    print()

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

#define int long long
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define str string
#define vint vector<int>
#define vchar vector<char>
#define vool vector<bool>
#define pb() pushback
#define elif else if

main(){
    int b,c,count=0,count2=0;
    double a=0.000000,f=3.1415926535;
    str SA,SB;
    cin>>SA>>SB;
    if(SA.size()>SB.size())cout<<"GREATER"<<endl;
    else if(SA.size()<SB.size())cout<<"LESS"<<endl;
    else if(SA.size()==SB.size()){
      if(SA>SB)cout<<"GREATER"<<endl;
      elif(SA<SB)cout<<"LESS"<<endl;
      else cout<<"EQUAL"<<endl;
    }
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC083B_SomeSums
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int n = input[0];
            int a = input[1];
            int b = input[2];
            int ans = 0;

            for(int i = 1; i <= n; i++)
            {
                int p = (i % 100000) / 10000;
                int q = (i % 10000) / 1000;
                int r = (i % 1000) / 100;
                int s = (i % 100) / 10;
                int t = (i % 10) / 1;

                if (a <= (p + q + r + s + t) && (p + q + r + s + t) <= b)
                {
                    ans += i;
                }
            }

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13396
N, K, *V = map(int, open(0).read().split())

# i: 操作回数
# j: 取り出す個数
# k: 左から取り出す範囲 [0, k)
ans = 0
for i in range(K + 1):
    for j in range(min(N + 1, i + 1)):
        for k in range(j + 1):
            right = N - j + k
            tmp = V[:k] + V[right:]
            tmp.sort()
            ans = max(ans, sum(tmp) - sum([t for t in tmp if t < 0][: i - j]))
print(ans)


Measured memory_bytes: 9132
/*
 * Author : underdog_eagle
 */
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define sz(o) ((int)o.size())
#define eb(o) emplace_back(o)
#define all(o) o.begin(), o.end()
#define rep(i, a, b) for(int i = (a); i <= (b); i++)
#define repr(i, a, b) for(int i = (a); i >= (b); i--)
#define repo(i, o) for(auto i = o.begin(); i != o.end(); i++)

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

void solve(){
    ll x, y;
    cin >> x >> y;
    if(x % y == 0){
        cout << "-1";
        return;
    }
    ll g = __gcd(x, y);
    ll lcm = (x*y) / g;
    cout << lcm + x;
}

int main() {
   /* #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cout << setprecision(8);
    clock_t b = clock();
    solve();
    clock_t e = clock();
    cerr << (double(e - b) / CLOCKS_PER_SEC) << " sec";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <string>
using namespace std;
int main(){
    int N;
    cin >> N;
    int Sn = 0;
    string ans = "No";
    int sampleN = N;
    while(sampleN > 0){
        Sn += sampleN%10;
        sampleN = (sampleN - sampleN%10)/10;
    }
    if(N % Sn == 0) ans = "Yes";
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <bitset>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
#define FOR(i,a,b)   for(ll i = (a); i < (b); i++ )
#define REP(i, n)    FOR(i,0,n)
typedef pair< ll, ll >   cp2;
typedef pair< string, cp2 >   cp3;
#define fi first
#define se second
#define sec  se.fi
#define thr  se.se
const ll mod = 1000000007;
//              123456789


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

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

int N, K;
int h;
int ans = 0;

int main(){
    
    cin>>N>>K;
    REP( i, N ){
        cin>>h;
        if( h >= K ) ans++;
    }
    
    cout<<ans<<endl;
    
    
    return 0;
}



Measured memory_bytes: 256
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
ans = []
n = int(input())
for i in range(n+1):
  s = i*(i+1)//2
  if s >= n:
    k = i
    break
sabun = s - n
for i in range(k,0,-1):
  # print(sabun)
  if sabun >= i:
    sabun -= i
  else:
    ans.append(i)
print(*reversed(ans),sep = "\n")
# print(k)

Measured memory_bytes: 74944
// CF_623_Div2

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

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

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

	vector<string> v(n);
	forn(i, n) cin >> v[i];

	sort(v.begin(), v.end());

	string ans = "";

	forn(i, n) ans += v[i];
	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 256
import math,itertools,bisect,sys,copy,queue

def LI(): return [int(x) for x in sys.stdin.readline().split()]

H,W = LI()
C = [LI() for _ in range(10)]
A = [LI() for _ in range(H)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            C[i][j] = min(C[i][j], C[i][k] + C[k][j])

ans = 0
for x in range(W):
    for y in range(H):
        if A[y][x] >= 0:
            ans += C[A[y][x]][1]
print (ans)

Measured memory_bytes: 43608
#include <iostream>
int main() {
    int n;
    std::cin >> n;

    double in1[n];
    std::string in2[n];
    for (int i = 0; i < n; i++) {
        std::cin >> in1[i];
        std::cin >> in2[i];
    }
    
    double sum = 0;
    for (int i = 0; i < n; i++){
        if (in2[i] == "JPY") {
            sum += in1[i];
        } else if (in2[i] == "BTC") {
            sum += in1[i] * 380000.0;
        }
    }
    std::cout << sum;
}

Measured memory_bytes: 256
# 2019/06/29
# AtCoder Beginner Contest 132 - C

# Input
n = int(input())
d = list(map(int,input().split()))

# Sort
d.sort()

# Center
med1 = d[int(n / 2) - 1]
med2 = d[int(n / 2)]

ans = med2 - med1

# Output
print(ans)


Measured memory_bytes: 14556
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans[200000] = {};

int main()
{
ll n,q;
cin >> n >> q ;
vector<vector<ll>> g(n);
rep(i, n-1)
{
    ll a,b;
    cin >> a>>b;
    g[a-1].push_back(b-1);
    g[b-1].push_back(a-1); //無向辺
}
ll po[n]={};
rep(i,q){
ll p , x ;
cin >> p >> x ;
po[p-1]+=x;
}
stack<ll> s;
bool see[n]={};
s.push(0);
s.push(0);
ll now=0;
while(s.size()!=0){
  ll te=s.top();
  s.pop();
  if(!see[te]){
    see[te]=1;
    now+=po[te];
    ans[te]=now;
    for (auto p : g[te])
    {
      if (see[p])
          continue;
      s.push(p);
      s.push(p);
    }
  }
  else{
    now-=po[te];
  }
}
rep(i,n)
cout << ans[i] << " ";
cout << endl;
return 0;
}


Measured memory_bytes: 21360
#include<cstdio>
#include<cstring>
const int MAXN=200000+10;

struct edge{
    int to,next;
}edges[MAXN];
int heads[MAXN];
int tot;

void addedge(int a,int b)
{
    edges[tot].to=b;
    edges[tot].next=heads[a];
    heads[a]=tot++;
}

int main()
{
    int n,m;
    while(scanf("%d%d",&n,&m)==2)
    {
        tot=0;
        memset(heads,-1,sizeof(heads));
        for(int i=0;i<m;i++)
        {
            int a,b;
            scanf("%d%d",&a,&b);
            addedge(a,b);
        }

        bool has=false;
        for(int i=heads[1];i!=-1;i=edges[i].next)
        {
            for(int j=heads[edges[i].to];j!=-1;j=edges[j].next)
            {
                if(edges[j].to==n){printf("POSSIBLE\n");has=true;break;}
            }
            if(has)break;
        }
        if(has==false)printf("IMPOSSIBLE\n");
    }
    return 0;
}


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


int main() {
    int n, mi, ma;
    while(cin >> n >> mi >> ma, n) {
        vector<int> v(n);
        int gap=0, ans=0;
        for(int i=0; i<n; ++i) {
            cin >> v[i];
        }
        
        for(int i=mi-1; i<ma; ++i) {
            if(gap == v[i] - v[i+1]) {
                ans = max(ans, i+1);
            } else if(gap < v[i] - v[i+1]) {
                gap = v[i] - v[i+1];
                ans = i+1;
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3084
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(true){
			int n = scan.nextInt();
			int x = scan.nextInt();
			int count = 0;
			if(n == 0 && x == 0){
				break;
			}
			for(int i = 1; i <= n; i++){
				for(int j = i + 1; j <= n; j++){
					for(int k = j + 1; k <= n; k++){
						if(i + j + k == x){
							count++;
						}
					}
				}
			}
			System.out.println(count);
		}

	}

}

Measured memory_bytes: 19808
# http://dai1741.github.io/maximum-algo-2012/docs/shortest-path/
H, W = map(int, input().split())

# color_cost
C = []
for i in range(10):
  C.append(list(map(int, input().split() )))

# WallNumbers
A = []
for i in range(H):
  A.append(list(map(int, input().split() )))

# Distance with init
#D = [[1e9] * 10 for i in range(10)]
#for i in range(10):
#  D[i][i] = 0

# warshal-floyd
# i:middle, j:from, k:to
for i in range(10): 
  for j in range(10): 
    for k in range(10):
      if C[j][k] > C[j][i] + C[i][k]:
        C[j][k] = C[j][i] + C[i][k]

ans = 0
for i in range(H):
  for j in range(W):
    if A[i][j] >= 0:
      ans += C[A[i][j]][1]

print(ans)

Measured memory_bytes: 3444
S = int(input())
s = S // 1000
a = s * 10 + (S - s * 1000) // 100
b = S - a * 100
if(1 <= a and a <= 12) :
  if(1 <= b and b <= 12) :
    print("AMBIGUOUS")
  else :
    print("MMYY")
else :
  if(1 <= b and b <= 12) :
    print("YYMM")
  else :
    print("NA")

Measured memory_bytes: 3060
#include<stdio.h>
#include<string.h>
int main()
{
    char st[30];
    int i,raf=0,j;
    scanf("%s",st);
    for(i=0; i<strlen(st)-1; i++)
    {
        for(j=i+1; j<strlen(st); j++)
        {

            if(st[j]==st[i])
            {
                raf=1;
                break;
            }
        }
        if(raf==1)
            break;
    }
    if(raf==0)
        printf("yes\n");
    else
        printf("no\n");
}


Measured memory_bytes: 128
import queue
n,m=map(int,input().split())
graph=[[] for _ in range(n+1)]
dist=[-1 for _ in range(n+1)]
guide=[0 for _ in range(n+1)]

for _ in range(m):
    a,b=map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

que=queue.Queue()
dist[1]=0
que.put(1)

while not que.empty():
    v=que.get()
    for nv in graph[v]:
        if dist[nv]!=-1:
            continue
        dist[nv]=dist[v]+1
        guide[nv]=v
        que.put(nv)

print("Yes")
print(*guide[2:],sep="\n")   

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

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

using namespace std;
using lint=long long;

int main(){
	lint n,a,b; cin>>n>>a>>b;

	if((b-a)%2==0) cout<<(b-a)/2<<'\n';
	else           cout<<min(a+(b-a-1)/2,(n-b+1)+(b-a-1)/2)<<'\n';

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int X,Y;cin >> X >> Y;
    int ans = 0;
    int ok = 0;
    if(X == 1){
        ans += 300000;
        ok++;
    }
    else if(X == 2){
        ans += 200000;
    }
    else if(X == 3){
        ans += 100000;
    }

    if(Y == 1){
        ans += 300000;
        ok++;
    }
    else if(Y == 2){
        ans += 200000;
    }
    else if(Y == 3){
        ans += 100000;
    }

    if(ok == 2)ans += 400000;

    cout << ans << endl;
}



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

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

int main(){
    string s;
    cin >> s;
    ll n = s.size();
    ll num = 0;
    ll cnt = 0;
    for(ll i = n-1; i >= 0; i--){
        if(s[i] == 'B'){
            cnt += num;
        }else{
            num++;
        }
    }
    cout << cnt << endl;
    return 0;
}

/*
bwbwbw
bwbwwb
bwwbwb
bwwwbb
wbwwbb
wwbwbb
wwwbbb
*/

Measured memory_bytes: 3704
import io.{StdIn => in}

object Main extends App {
  val Array(n, a) = in.readLine.split(" ").map(_.toInt)
  val x = in.readLine.split(" ").map(_.toInt).sorted
  val sumMax = math.max(x.sum, a * n)
  val dp = Array.ofDim[Long](n+1, n+1, sumMax + 1)

  for(i <- 0 to n) dp(i)(0)(0) = 1
  for{
      i <- 1 to n; xi = i - 1
      j <- 1 to n; if j <= i
      k <- 1 to sumMax
    } {
      dp(i)(j)(k) =
        if(k < x(xi)) dp(i-1)(j)(k)
        else dp(i-1)(j)(k) + dp(i-1)(j-1)(k-x(xi))

      // if(k == sumMax) println(i + " " + j + " : " + dp(i)(j).mkString(" "))
    }

  val ans = (1 to n)./:(0L)((acc,j) => {
    // println(n + " " + j +  " " + a*j + " : " + dp(n)(j)(a*j))
    acc + dp(n)(j)(a*j)
  })
  println(ans)
}

Measured memory_bytes: 89896
#include <stdio.h>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> a(3);
    for(int i = 0; i < 3; i++) scanf("%d", &a[i]);
    sort(begin(a), end(a));

    if(a[0] == 5 and a[1] == 5 and a[2] == 7) printf("YES\n");
    else printf("NO\n");
    return 0;
}


Measured memory_bytes: 256
n=int(input())
c=list(input())
ideal=["R"]*c.count("R")+["W"]*c.count("W")

cnt=0
for i in range(n):
    if c[i]!=ideal[i]:
        cnt+=1

print(min([c.count("R"), c.count("W"), (cnt+1)//2]))


Measured memory_bytes: 13620
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ld double
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define setpr(pp) fixed<<setprecision(pp)
#define FOR(I,N) for(I=0;I<N;++I)
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod	%1000000007
#define pi 3.141592653
#define MX 1000000007

ll n;
ll dp[5000000];
bool a[22][22];

ll cnt(ll mask)
{
	ll ans=0;
	for(int i=0;i<n;++i)
	{
		if(mask&1<<i)
			ans++;
	}
	return ans;
}

int main()
{
	MS0(dp);
	cin>>n;
	ll i,j;
	FOR(i,n)
	{
		FOR(j,n)
		{
			cin>>a[i][j];
		}
	}
	dp[0]=1;
	ll k,N = 1<<n;
	for(j=0;j<N-1;++j)
	{
		k = cnt(j);
		for(i=0;i<n;++i)
		{
			if((j&1<<i) == 0 && a[k][i]==1)
				dp[j|1<<i] = (dp[j|1<<i] + dp[j])mod;
		}
	}
	cout<<dp[N-1];
}

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

void swap(int* x, int* y){
    int temp;
    temp = *x;
    *x = *y;
    *y = temp;
}

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a > b){
        swap(&a, &b);
    }
    if(a > c){
        swap(&a, &c);
    }
    if(b > c){
        swap(&b, &c);
    }
    cout << a << " " << b << " " << c << endl;
    return 0;
}



Measured memory_bytes: 3072
s=list(input())
w=int(input())
x=[]
y=''
ans=''
count=[]
for i in range(len(s)):
    y+=s[i]
    if len(list(y))==w:
        x.append(y)
        y=''
    if i==len(s)-1 and y!='':
        x.append(y)
for j in range(len(x)):
    count=list(x[j])
    ans+=count[0]
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  
  int ans = 0;
  
  for(int i=0; i<s.size()/2; i++){
    if(s[i]!=s[s.size()-1-i])ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
# 初期入力

import sys
input = sys.stdin.readline
N = int(input())
S = [input().strip() for i in range(N)]

from collections import Counter
c =[]
for i_s in S:
    i_sorted =sorted(i_s) #各文字列をソート
    i="".join(i_sorted)
    c.append(i)

from collections import Counter
ans_colle =Counter(c) #ソートした後の文字列の数
ans =0
for i in ans_colle.values():
    ans +=i*(i-1)//2
print(ans)

Measured memory_bytes: 26872
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int a, b, h, m;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> a >> b >> h >> m;
    ld x = h * 360 / 12 + m * 30 / 60.0, y = m * 360 / 60;
    ld PI = acos(-1);
    ld diff = fabs(x-y) / 180 * PI;
    ld c = a * a + b * b - 2 * a * b * cos(diff);
    cout << fixed << setprecision(15) << sqrt(c);
    return 0;
}


Measured memory_bytes: 4208
n = int(input())
h = list(map(int, input().split()))

ans = True
m = 10**10
for i in reversed(range(n)):
    if h[i] <= m:
        m = h[i]
    elif h[i] > m+1:
        ans = False
        break

if ans:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14252
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int H, W;
vector<string> a;
vv<ll> memo;

ll dfs(int y, int x) {
    if (memo[y][x] != -1) return memo[y][x];
    memo[y][x] = 0;
    if (y != H - 1 && a[y + 1][x] == '.') memo[y][x] += dfs(y + 1, x);
    if (x != W - 1 && a[y][x + 1] == '.') memo[y][x] += dfs(y, x + 1);
    return memo[y][x] %= MOD;
}

int main() {
    cin >> H >> W;
    a.resize(H);
    rep(i, H) cin >> a[i];

    memo = vvec(H, W, -1LL);
    memo[H - 1][W - 1] = 1;
    
    write(dfs(0, 0));
}

Measured memory_bytes: 9344
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;
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; }
const long long INF = 1LL << 60;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int digsum(int n) {
  int res = 0;
  while(n > 0) {
    res += n%10;
    n /= 10;
  }
  return res;
}


int dignum(int n) {
  int res = 0;
  while(n > 0) {
    res++;
    n /= 10;
  }
  return res;
}


int stringcount(string s, char c) {
  return count(s.cbegin(), s.cend(), c);
}


int lcm(lint x, lint y){
  return x/ gcd(x, y) * y;
}


int combi(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}


int main(){
  lint x;
  cin>>x;
  lint a,b;
  bool is=true;
  for(lint i=-300;i<300;i++&&is){
    for(lint j=-300;j<300;j++&&is){
      if(pow(i,5)-pow(j,5)==x){
        a=i;
        b=j;
        is=false;
        break;
      }
    }
  }
  cout<<a<<" "<<b;
}

Measured memory_bytes: 4068
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
ll MOD = 1e9 + 7;

int main() {
    int h, w;
    cin >> h >> w;
    vector<char> g(h * w);
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> g[w * i + j];
        }
    }
    bool bingo = true, change = true;
    while (change) {
        change = false;
        for (int i = 0; i < h; i++) {
            bingo = true;
            for (int j = 0; j < w; j++) {
                if (g[w * i + j] == '#') bingo = false;
            }
            if (bingo) {
                for (int j = 0; j < w; j++) {
                    if (g[w * i + j] == '.') change = true;
                    g[w * i + j] = 'x';
                }
            }
        }
        for (int i = 0; i < w; i++) {
            bingo = true;
            for (int j = 0; j < h; j++) {
                if (g[i + w * j] == '#') bingo = false;
            }
            if (bingo) {
                for (int j = 0; j < h; j++) {
                    if (g[i + w * j] == '.') change = true;
                    g[i + w * j] = 'x';
                }
            }
        }
    }
    bool exist = false;
    for (int i = 0; i < h; i++) {
        exist = false;
        for (int j = 0; j < w; j++) {
            if (g[i * w + j] != 'x') {
                cout << g[i * w + j];
                exist = true;
            }
        }
        if (exist) cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
long long n,a[200005];
long long sum[200005];
map<long long,long long> mp;
int main()
{
	cin>>n;
	rep(i,n) cin>>a[i];
	sum[0]=a[0];
	rep1(i,n-1)
		sum[i]=sum[i-1]+a[i];
	rep(i,n)
	{
		if(mp.find(sum[i])!=mp.end())
			mp[sum[i]]++;
		else
			mp[sum[i]]=1;
	}
	long long ans=0;
	for(map<long long,long long>::iterator it=mp.begin();it!=mp.end();it++)
	{
		if(it->first==0)
			ans+=it->second;
		ans+=it->second*(it->second-1)/2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 16000
#include<stdio.h>
int main(void)
{
    int a, b;
	
	scanf("%d",&a);
	scanf("%d",&b);
	if(a<b){
	    printf("a < b\n",a, b);
	}
	if(a>b){
	    printf("a > b\n",a, b);
	}
	if(a==b){
	    printf("a == b\n",a, b);
	}
	
	return 0;
}

Measured memory_bytes: 1008
#include <bits/stdc++.h>
using namespace std;
#define N 1000000007
int main() {
  int n, m;
  cin >> n >> m;
  if(n==m){
    int64_t ans=2;
    for(int i=1; i<=n; i++)
      ans=ans*i%N;
    for(int i=1; i<=m; i++)
      ans=ans*i%N;
    cout << ans;
    return 0;
  }
  if(abs(n-m)==1){
    int64_t ans=1;
    for(int i=1; i<=n; i++)
      ans=ans*i%N;
    for(int i=1; i<=m; i++)
      ans=ans*i%N;
    cout << ans;
    return 0;
  }
  cout << 0;
  return 0;
}

Measured memory_bytes: 3612
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n = int(input())
a = [0]* n
b = [0]* n
c= [(0,0)]*n
for i in range(n):
    a[i], b[i] = map(int, input().split())
    c[i] = (i, a[i]+b[i] )

c.sort(key=lambda x:x[1],reverse=True)

ans = 0
for i in range(n):
    if i%2==0:
        ans+=a[c[i][0]]
    else:
        ans-=b[c[i][0]]

print(ans)


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

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

  int N;
   cin >> N;
   vector<int> a(N);
   for (int i = 0; i < N; ++i) {
     cin >> a.at(i);
   }

   sort(a.rbegin(), a.rend());
   int ans = 0;
   for (int i = 1; i < N; ++i) {
     ans += a.at(i - 1) - a.at(i);
   }

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


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


int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if(a%b == 0)
	{
		cout << a/b*c;
	}
	else
	{
		cout << (a/b+1)*c;
	}
}

Measured memory_bytes: 3628