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

int n,m,s,t;
int a,b,d[15][15];

inline void init(){
	scanf("%d%d",&a,&b);
	for(int i=1;i<=a;++i)
		for(int j=1;j<=b;++j)
			scanf("%d",d[i]+j);
}

int fl,ga[300][300];
struct edge{
	int u,v,w;
}ge[100005];

inline int check(int x,int y,int c){
	for(int i=1;i<=a;++i)
		for(int j=1;j<=b;++j)
			if(i*x+j*y+c<d[i][j])return 0;
	return 1;
}

inline void solve(){
	s=1;t=n=202;
	for(int i=1;i<=100;++i)
		ge[m++]=(edge){i,i+1,-1};
	for(int i=102;i<n;++i)
		ge[m++]=(edge){i,i+1,101};
	
	for(int i=1;i<=a;++i){
		for(int j=1;j<=b;++j){
			int ok=0;
			for(int x=0;x<=d[i][j]/i;++x){
				for(int y=0;y<=(d[i][j]-x*i)/j;++y){
					int c=d[i][j]-x*i-y*j;
					if(check(x,y,c)){
						if(!ga[x][y]){
							ga[x][y]=1;
							ge[m++]=(edge){x+1,n-y,c};
						}
						ok=1;break;
					}
				}
				if(ok)break;
			}
			if(!ok){fl=1;break;}
		}
		if(fl)break;
	}
	
	if(fl){puts("Impossible");return;}
	printf("Possible\n%d %d\n",n,m);
	for(int i=0;i<m;++i){
		printf("%d %d ",ge[i].u,ge[i].v);
		if(ge[i].w<0)puts("X");
		else if(ge[i].w>100)puts("Y");
		else printf("%d\n",ge[i].w);
	}
	printf("%d %d\n",s,t);
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

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

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::steady_clock::now().time_since_epoch().count());

    int n, k;
    cin >> n >> k;
    int cnt = 0;
    while(n) {
        cnt++;
        n /= k;
    }
    cout << cnt;

    return 0;
}

Measured memory_bytes: 256
S_array = input()

lastIndex = len(S_array) -1
lastChar = S_array[len(S_array)-1]
while lastIndex > 0 and S_array[lastIndex-1] == lastChar:
    lastIndex -= 1

nextIndex = 0
k_counter = 0
was_prev_1 = False

while nextIndex < lastIndex:
    if was_prev_1:
       if S_array[nextIndex] == S_array[nextIndex-1]:
           was_prev_1 = False
           nextIndex += 2
       else:
           was_prev_1 = True
           nextIndex += 1
    else:
        was_prev_1 = True
        nextIndex += 1
    k_counter += 1

remains = len(S_array) - 1 - nextIndex + 1
if remains % 3 == 0:
    k_counter += (remains / 3) * 2
elif remains % 3 == 1:
    k_counter += ((remains - 1) / 3) * 2 + 1
elif remains % 3 == 2:
    k_counter += ((remains - 2) / 3) * 2 + 1

print(int(k_counter))

Measured memory_bytes: 3500
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n)  for (int i = 0; i < (int) (n); i++)
#define REP1(i, n) for (int i = 1; i <= (int) (n); i++)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())
using ll = long long;

int main() {
  int h, w;
  cin >> h >> w;
  vector <string> s(h, "");
  REP(i, h) {
	cin >> s[i];
  }
  vector <vector <int> > dp(h * w, vector <int>(h *w, 1e9));
  REP(i, h * w) {
	int x = i % w;
	int y = i / w;
	dp[i][i] = 0;
	if (s[y][x] == '#') {
		continue;
	  }
	if (x != 0 && s[y][x - 1] == '.') {
		dp[i][i - 1] = 1;
	  }
	if (y != 0 && s[y - 1][x] == '.') {
		dp[i][i - w] = 1;
	  }
	if (x != w - 1 && s[y][x + 1] == '.') {
		dp[i][i + 1] = 1;
	  }
	if (y != h - 1 && s[y + 1][x] == '.') {
		dp[i][i + w] = 1;
	  }
  }
  REP(k, h * w) {
	REP(i, h * w) {
	  REP(j, h * w) {
		if (dp[i][j] > dp[i][k] + dp[k][j]) {
			dp[i][j] = dp[i][k] + dp[k][j];
		  }
	  }
	}
  }
  int ans = 0;
  REP(i, h * w) {
	REP(j, h * w) {
	  if (s[i / w][i % w] != '#' && s[j / w][j % w] != '#') {
		  ans = max(ans, dp[i][j]);
		}
	}
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 896
#include<stdio.h>
int main(void)
{
  int n, k, i, j, tmp;

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

   for (i=0; i<n; ++i) {
    for (j=i+1; j<n; ++j) {
      if (number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
  int sum = 0;
  for(i=0 ; i<k ;i++){
    sum += number[i];
  }

	printf("%d\n", sum);

  return 0;
}

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

int main() {
  long long n, price = 1000; cin >> n;
  vector<long long> a(n); for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < n-1; i++) {
    long long stocks = 0;
    if(a[i] < a[i+1]) stocks = price / a[i];
    price += (a[i+1] - a[i]) * stocks;
  }
  cout << price << endl;
  return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
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 P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(ll i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(ll 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(0); 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 int MOD  = int(1e9)+7;


int main() {
  ld a, b, h, m; cin >> a >> b >> h >> m;

  ld x = (h + m/60.0) / 12.0;
  ld y = m/60.0;

  ld ans = sqrt(a*a + b*b - 2*a*b*cos(M_PI * 2 * (x-y)));

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


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

long long A, B, K;
int main() {
    cin >> A >> B >> K;

    long long a = max(0LL, A - K);
    long long b = B;
    
    if (A - K < 0) {
        b -= K - A;
    }

    printf("%lld %lld\n", a, max(0LL, b));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define test() int t;cin>>t;loop(test,1,t+1)
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define nl cout<<"\n"
#define sp cout<<" "
#define F first
#define S second
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<pii>
#define vll vector<pll>
#define MOD 1000000007
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

ll mod( ll n, ll m=MOD ){ n%=m,n+=m,n%=m;return n; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

unordered_map<long long, int, custom_hash> safe_map;

const int MAXN = 1e5+5;
const int LOGN = 21;
const ll INF = 1e14;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

int main() 
{
    fastio();

    int n;
    cin>>n;
    ll num = 0, sum = 0;
    for(int i=0;i<n;i++)
    {
        ll d,c;
        cin>>d>>c;
        num += c;
        sum += d*c;
    }
    ll ans = (9*num+sum-1)/9 - 1;
    cout<<ans,nl;

    return 0;
}

Measured memory_bytes: 256
using System;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var ABCD = Console.ReadLine().Split(' ');
            var A = int.Parse(ABCD[0]);
            var B = int.Parse(ABCD[1]);
            var C = int.Parse(ABCD[2]);
            var D = int.Parse(ABCD[3]);

            var output = Math.Max(0, Math.Min(B, D) - Math.Max(A, C));
            Console.Write(output);
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
#define MOD 1000000007ll // prime
// How to devide :
// ModInt a(6ll);
// ModInt b(2ll);
// a *= b.exp(MOD-2ll);  -> a/=b;  result: a = 3
struct ModInt{
	ll val;
	ModInt():val(0ll){}
	ModInt(ll v):val(((v%MOD)+MOD)%MOD){}
	ModInt exp(ll y)const{
		if(!y)return ModInt(1ll);
		ModInt a = exp(y/2ll);
		a *= a;
		if(y&1)a*=(*this);
		return a;
	}
	bool operator==(const ModInt& x)const{return val==x.val;}
	inline bool operator!=(const ModInt& x)const{return !(*this==x);}
	bool operator<(const ModInt& x)const{return val<x.val;}
	bool operator>(const ModInt& x)const{return val>x.val;}
	inline bool operator>=(const ModInt& x)const{return !(*this<x);}
	inline bool operator<=(const ModInt& x)const{return !(*this>x);}
	ModInt& operator+=(const ModInt& x){if((val+=x.val)>=MOD)val-=MOD;return *this;}
	ModInt& operator-=(const ModInt& x){if((val+=MOD-x.val)>=MOD)val-=MOD;return *this;}
	ModInt& operator*=(const ModInt& x){(val*=x.val)%=MOD;return *this;}
	ModInt operator+(const ModInt& x)const{return ModInt(*this)+=x;}
	ModInt operator-(const ModInt& x)const{return ModInt(*this)-=x;}
	ModInt operator*(const ModInt& x)const{return ModInt(*this)*=x;}
};
istream& operator>>(istream&i,ModInt&x){i>>x.val;return i;}
ostream& operator<<(ostream&o,const ModInt&x){o<<x.val;return o;}
ModInt pow(ModInt a,ll x){
	ModInt res = ModInt(1ll);
	while(x){
		if(x&1)res *= a;
		x >>= 1;
		a = a*a;
	}
	return res;
}
const int SIZE = 100100;
ModInt inv[SIZE+10],fac[SIZE+10],facinv[SIZE+10];
// notice: 0C0 = 1 
ModInt nCr(int n,int r){
	assert(!(n<r));
	assert(!(n<0||r<0));
	return fac[n]*facinv[r]*facinv[n-r];
}
void init(){
	fac[0]=ModInt(1ll);
	for(int i=1;i<=SIZE;i++)fac[i]=fac[i-1]*ModInt(i);
	inv[1]=ModInt(1ll);
	for(int i=2;i<=SIZE;i++)inv[i]=ModInt(0ll)-ModInt(MOD/i)*inv[MOD%i];
	facinv[0]=ModInt(1ll);
	for(int i=1;i<=SIZE;i++)facinv[i]=facinv[i-1]*inv[i];
	return;
}
int N,A,B,C;
ModInt f[100100];
ModInt g[200100];
int main(){
	init();
	cin >> N >> A >> B >> C;
	ModInt a = ModInt((ll)A)*inv[100];
	ModInt b = ModInt((ll)B)*inv[100];
	ModInt c = ModInt((ll)C)*inv[100];
	ModInt ans;
	ModInt cinv = pow(a+b,MOD-2);
	g[1]=pow(cinv,2);
	for(int i=2;i<2*N;i++){
		g[i]=g[i-1]*cinv*ModInt(i);
	}
	for(int k=0;k<N;k++){
		ModInt base = pow(a,k)*pow(b,k)*(pow(a,N-k)+pow(b,N-k))*facinv[N-1]*facinv[k];
		//cout << base << ' ' << g[N+k] << endl;
		ans += base*g[N+k];
	}
	cout << ans << endl;
    return 0;
}


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

int main(){
  ll ans=0;
  string s;
  cin>>s;
  for(int i=0;i<3;i++){
    if(s[i]=='R')ans++;
  }
  cout<<(ans==2 && s[1]=='S' ? ans-1 : ans)<<endl;
}


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

const int N = (int)1e6 + 6;

int n;

double x[10],y[10];

int a[10];

double ans;

int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> x[i] >> y[i];
		a[i] = i;
	}
	do{
		for(int i = 1; i < n; i++){
			ans += (double)sqrt((x[a[i]] - x[a[i + 1]]) * (x[a[i]] - x[a[i + 1]]) + (y[a[i]] - y[a[i + 1]]) * (y[a[i]] - y[a[i + 1]]));	
		}	
	}while(next_permutation(a + 1,a + 1 + n));
	int q = 1;
	for(int i = 1; i <= n; i++){
		q *= i;
	}
	cout << fixed << setprecision(7) << (double)ans / q;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define mod 1000000007
#define INF2 9999999999
#define INF (1 << 30)
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)

using namespace std;
using ll = __int64_t;

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

bool comp(const pair<int, ll>& p1, const pair<int, ll>& p2){
    return p1.second > p2.second;
}

void solve(){
    int n, m;
    ll a[100005];
    ll res=0;
    vector<pair<int, ll>> v;

    cin >> n >> m;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    sort(a, a+n);
    for(int i = 0; i < m; i++){
        int b;
        ll c;
        cin >> b >> c;
        v.push_back({b, c});
    }
    sort(v.begin(), v.end(), comp);
    int k = 0;
    for(int i = 0; i < v.size(); i++){
        for(int j = 0; j < v[i].first && v[i].second > a[k]; j++){
            a[k] = v[i].second;
            k++;
        }
    }
    for(int i = 0; i < n; i++){
        res += a[i];
    }
    cout << res << endl;
}

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

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

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

#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)

#define ALL(c) (c).begin(), (c).end()
#define sz(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/
const ll mod=1e9+7;
const ll INF=1e18;
/*****************************************************************************/

using namespace std;

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int a[6],ans,i;
	for (i=1;i<=5;i++) {
		cin >>a[i];
		if (a[i]==0) {
			cout <<i<<endl;
		}
	}
	return 0;
}
/******************************************************************************
******************************************************************************/


Measured memory_bytes: 3580
#include<stdio.h>

#define MAX 500000

int T[MAX];
int size;

void Max_Heapify(int);

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

  for(i=1; i<=size; i++){
    scanf("%d",&T[i]);
  }

  for(i=size/2; i>=1; i--) Max_Heapify(i);

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

void Max_Heapify(int i){
  int left, right, largest, temp;
  left = i*2;
  right = i*2+1;

  if(left<=size && T[left]>T[i]) largest = left;
  else largest = i;

  if(right<=size && T[right]>T[largest]) largest = right;

  if(largest != i){
    temp = T[i];
    T[i] = T[largest];
    T[largest] = temp;
    Max_Heapify(largest);
  }
}



Measured memory_bytes: 3668
#include <cstdint>
#include <iostream>
#include <map>

using namespace std;

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

  constexpr int64_t mod = 1000000007;
  int n;
  string s;
  cin >> n >> s;
  map<char, int> m;
  for (char c : s) {
    m[c]++;
  }
  int64_t ans = 1;
  for (auto p : m) ans = ans * (p.second + 1) % mod;
  ans--;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
N, M = map(int, input().split())
p_list = [1 for _ in range(N)]
e_list = list(map(int, input().split()))
for _ in range(M):
   a, b = map(int, input().split())
   if e_list[a - 1] <= e_list[b - 1]:
       p_list[a - 1] = 0
   if e_list[b - 1] <= e_list[a - 1]:
       p_list[b - 1] = 0
print(sum(p_list))

Measured memory_bytes: 20904
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on
void main()
{
    auto input = stdin.byLine.map!split.joiner;

    long X;
    X = input.front.to!long;
    input.popFront;

    solve(X);
}

void solve(long X)
{
    writeln(10 - X / 200);
}


Measured memory_bytes: 3740
#include <iostream>
#include "string"
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i=0;i<n;++i)

typedef long long ll;
using namespace std;
int main(){
    vector<ll> a;
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        ll x;
        cin >> x;
        a.push_back(x);
    }
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());

    if (a.size() == n) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 2420
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<map>

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

using namespace std;

int main() {



	string str;
	cin >> str;
	rep(i, 0, str.length()) {
		if (str[i] == ',') {
			str[i] = ' ' ;
		}
	}

	cout << str << endl;


	return 0;
}

Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
//19234567892927;
const int mod=1e9+7;
const llint big=1e15+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
int main(void){
	int i,s,t,n,c,ans=0;cin>>n>>c;//cいらん
	vector<int>ims(114514);
	set<int>ch[30];
	for(i=0;i<n;i++){
		cin>>s>>t>>c;
		ims[s]++;
		ims[t+1]--;
		if(ch[c-1].count(s)==0){ch[c-1].ins(s);}
		else{ims[s]--;ims[s+1]++;}
		if(ch[c-1].count(t)==0){ch[c-1].ins(t);}
		else{ims[t]--;ims[t+1]++;}
		//tukeyaki edge
	}
	for(i=0;i<114500;i++){ims[i+1]+=ims[i];}
	for(i=0;i<114500;i++){maxeq(ans,ims[i]);}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 10744
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <iomanip>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(10)
#define highest(x) (63 - __builtin_clzl(x))

int main(){
    int N;
    cin >> N;
    int ans = 0, continuity = 1, back;
    cin >> back;
    for(int i = 1; i < N; i++){
        int a;
        cin >> a;
        if(back == a){
            continuity++;
        }else{
            ans += continuity / 2;
            continuity = 1;
            back = a;
        }
    }
    ans += continuity / 2;
    cout << ans << endl;
}


Measured memory_bytes: 892
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main()
{
  string o, e;
  int gap;
  cin >> o >> e;

  int olen = (int)o.size();
  int elen = (int)e.size();

  if(olen == elen){
    for(int i = 0; i < olen; i++){
      cout << o[i] << e[i];
    }
  }

  else if(olen < elen){
    for(int i = 0; i < olen; i++) cout << o[i] << e[i];
    for(int i = olen; i < elen; i++) cout << e[i];
  }

  else if(elen < olen){
    for(int i = 0; i < elen; i++) cout << o[i] << e[i];
    for(int i = elen; i < olen; i++) cout << o[i];
  }

  cout << endl;

  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define in(e,l) (std::find(l.begin(), l.end(), e) != l.end())
#define asort(l) (std::sort(l.begin(), l.end()))
#define dsort(l) (std::sort(l.rbegin(), l.rend()))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;

int main() {
  ll N;
  cin >> N;
  vl H(N);
  ll maxc = 0;
  ll cnt = 0;
  cin >> H[0];
  rep(i, N - 1){
    cin >> H[i + 1];
    maxs(maxc, cnt);
    if(H[i + 1] <= H[i]){
      ++cnt;
    } else {
      cnt = 0;
    }
  }
  maxs(maxc, cnt);
  cout << maxc << endl;
  return 0;
}



Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int n, mp[3][1003][1003];
void solve(int d, int w){
	int tmp[602][602];
	if (d % 4 == 0){
		solve(d / 4, w);
		for (int i = 0; i < 2 * n; ++ i)
			for (int j = 0; j < 2 * n; ++ j)
				tmp[i][j] = mp[w][i >> 1][j >> 1];
		for (int i = 0; i < 2 * n; ++ i)
			for (int j = 0; j < 2 * n; ++ j)
				mp[w][i][j] = tmp[i][j];
		return;
	}
	else{
		if (d % 2)
			for (int i = 0; i < 2 * n; ++ i)
				for (int j = 0; j < 2 * n; ++ j)
					mp[w][i][j] = (i + j + 1) & 1;
		else
			for (int i = 0; i < 2 * n; ++ i)
				for (int j = 0; j < 2 * n; ++ j)
					mp[w][i][j] = (i + 1) & 1;
	}
}
int main(){
	int d1, d2;
	cin >> n >> d1 >> d2;
	solve(d1, 1);
	solve(d2, 2);
	int cnt = 0;
	for (int i = 0; i < 2 * n; ++ i)
		for (int j = 0; j < 2 * n; ++ j)
			if (mp[1][i][j] && mp[2][i][j]){
				cout << i << " " << j << endl;
				if (++ cnt == n * n)
					return 0;
			}
}


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

int main(){
    int a,b,c;
    long long k;
    cin>>a>>b>>c>>k;
    int ans;
    if(k%2==1) ans=-a+b;
    else ans=a-b;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
c = str(input())

a, b = 0, 0

a = c.count('R')
ans = max(a, b)

for i in range(n):
    if c[i] == 'R':
        a -= 1
    else:
        b += 1
    ans = min(ans, max(a, b))
print(ans)



Measured memory_bytes: 9468
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

class Main {

    public static void main( final String[] args ) {

	final Scanner stdin = new Scanner( System.in );
	final int N = Integer.parseInt( stdin.nextLine() );
	final String target = stdin.nextLine();

	int count = 0;
	for ( int i = 0; i < N; i++ ) {
	    if ( check( target, stdin.nextLine() ) ) {
		count++;
	    }
	}
	System.out.println( count );
    }

    static boolean check( final String target, final String input ) {

	final int maxSpan = ( input.length() - target.length() ) / ( target.length() - 1 ) + 1;

	for ( int span = 1; span <= maxSpan; span++ ) {
	    for ( int index = 0; index + ( target.length() - 1 ) * span < input.length(); index++ ) {

		if ( makeString( target, input, span, index ) ) {
		    return true;
		}		
	    }	    
	}
	return false;
    }

    static boolean makeString( final String target, final String input, final int span, final int index ) {

	for ( int i = 0; i < target.length(); i++ ) {
	    if ( target.charAt( i ) != input.charAt( index + i * span ) ) {
		return false;
	    }
	}
	return true;
    }    
}

Measured memory_bytes: 21312
#include <utility>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <list>
#include <string>
#define REP(i, n) for (int i = 0; i < n; i++)
using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;

int main()
{
    int r, D, x;
    cin >> r >> D >> x;

    int ret = x;
    for (int i = 0; i < 10; i++)
    {
        ret = r * ret - D;
        cout << ret << endl;
    }
}

void cheatsheet()
{
    // loop
    // vector<int> vec(10);
    vector<int> vecloop;
    REP(i, 10)
    {
        vecloop.push_back(i);
    }

    // swap
    int a = 1;
    int b = 5;
    swap(a, b); // -> a = 5, b = 1

    // sort
    int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    sort(arr, arr + 9, greater<int>()); // 9 8 7 6 5 4 3 2 1

    // lower
    vector<int> vec(arr, end(arr));
    sort(vec.begin(), vec.end());
    cout << lower_bound(vec.begin(), vec.end(), 2)[0]; // 2

    // map
    map<Pll, ll> m;
    m[Pll(10, 100)] = 100;
}

Measured memory_bytes: 384
// ????????¨using
using System;
using System.Linq;
using System.Collections.Generic;

public class DFS
{
	public static void Main()
	{
		var n = int.Parse(Console.ReadLine());
		var u = Enumerable.Range(0, n)
			.Select(_ => Console.ReadLine());
		
		var builtupNodes = Build(u);
		var explorer = new Explorer();
		while (builtupNodes.Any(x => x.FoundTime == 0))
		{
			explorer.Explore(builtupNodes.First(x => x.FoundTime == 0));
		}
		
		// ????????¨ ForEach??¨???ToList()
		builtupNodes.ToList()
			.ForEach(x => Console.WriteLine(x.Id + " " + x.FoundTime + " " + x.FinishedTime));
	}
	
	static IEnumerable<Node> Build(IEnumerable<string> u)
	{
		var nodeAndInputs = u.Select(x => x.Split(' '))
			.Select(x => x.Select(int.Parse))
			.Select(x => new 
			{ 
				node = new Node(x.First()),
				input = x
			})
			.ToList();
		// Node?????????????????£????????????????????\????????????????????????2????????????????????????????????????????????§??????
		return nodeAndInputs.Select(nodeinput => 
		{
			nodeinput.node.Children = nodeAndInputs
				.Select(x => x.node)
				.Where(x => nodeinput.input.Skip(2).Contains(x.Id));
			return nodeinput.node;
		})
		.OrderBy(x => x.Id);
	}
	
	class Explorer
	{
		private int time = 0;
		public void Explore(Node node)
		{
			node.FoundTime = ++time;
			node.Children.ToList().ForEach(x => { if (x.FoundTime == 0) Explore(x); });
			node.FinishedTime = ++time;
		}
	}
	
	class Node
	{
		public int Id { get; private set; }
		public IEnumerable<Node> Children { get; set; }
		public int FoundTime { get; set; }
		public int FinishedTime { get; set; }
		
		public Node(int id) { Id = id; }
	}
}

Measured memory_bytes: 6960
#!/usr/bin/env python
from itertools import permutations
from math import ceil

def main():
    L = []
    [L.append(int(input())) for _ in range(5)]
    all_combinations = list(permutations(L))

    ans = float('inf')
    for i in range(len(all_combinations)):
        temp = 0
        for j in range(5):
            if j != 4:
                temp += all_combinations[i][j]
                temp = ceil(temp/10) *10
            if j == 4:
                temp += all_combinations[i][j]
        if temp < ans:
            ans = temp

    return ans

if __name__ == '__main__':
    print(main())

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

#define int long long

#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

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

template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

// https://twitter.com/vane11ope ←フォローしましょう
// (ノ)>◡<(ヾ)ﾓﾁﾓﾁ
signed main(signed argc, char* argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const int MOD = 1e9+7;

    int h,w,k;
    cin>>h>>w>>k;
    P s,g;
    cin>>s.first>>s.second>>g.first>>g.second;
    s.first--;
    s.second--;
    g.first--;
    g.second--;
    vector<vector<char>> c(h,vector<char>(w));
    rep(i,h)rep(j,w)cin>>c[i][j];
    vector<vector<int>> d(h,vector<int>(w,MOD));
    queue<P> que;
    que.emplace(s);
    d[s.first][s.second]=0;
    while(!que.empty()){
        auto now=que.front();que.pop();
        P c_now=now;
        rep(i,k){
            c_now.first++;
            if(c_now.first>=h||(d[c_now.first][c_now.second]!=MOD&&d[c_now.first][c_now.second]!=d[now.first][now.second]+1)||c[c_now.first][c_now.second]!='.'){
                break;
            }
            if(d[c_now.first][c_now.second]==d[now.first][now.second]+1){
                continue;
            }
            d[c_now.first][c_now.second]=d[now.first][now.second]+1;
            que.emplace(c_now);
        }
        c_now=now;
        rep(i,k){
            c_now.first--;
            if(c_now.first<0||(d[c_now.first][c_now.second]!=MOD&&d[c_now.first][c_now.second]!=d[now.first][now.second]+1)||c[c_now.first][c_now.second]!='.'){
                break;
            }
            if(d[c_now.first][c_now.second]==d[now.first][now.second]+1){
                continue;
            }
            d[c_now.first][c_now.second]=d[now.first][now.second]+1;
            que.emplace(c_now);
        }
        c_now=now;
        rep(i,k){
            c_now.second++;
            if(c_now.second>=w||(d[c_now.first][c_now.second]!=MOD&&d[c_now.first][c_now.second]!=d[now.first][now.second]+1)||c[c_now.first][c_now.second]!='.'){
                break;
            }
            if(d[c_now.first][c_now.second]==d[now.first][now.second]+1){
                continue;
            }
            d[c_now.first][c_now.second]=d[now.first][now.second]+1;
            que.emplace(c_now);
        }
        c_now=now;
        rep(i,k){
            c_now.second--;
            if(c_now.second<0||(d[c_now.first][c_now.second]!=MOD&&d[c_now.first][c_now.second]!=d[now.first][now.second]+1)||c[c_now.first][c_now.second]!='.'){
                break;
            }
            if(d[c_now.first][c_now.second]==d[now.first][now.second]+1){
                continue;
            }
            d[c_now.first][c_now.second]=d[now.first][now.second]+1;
            que.emplace(c_now);
        }
    }
    cout<<([](int it){return it==MOD?-1:it;})(d[g.first][g.second])<<endl;
}


Measured memory_bytes: 19920
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    ll n;
    cin >> n;
    vector<pii> lr, rl;
    for (ll i = 0; i < n; ++i) {
        ll l, r;
        cin >> l >> r;
        lr.emplace_back(l, r);
        rl.emplace_back(r, l);
    }
    sort(rl.begin(), rl.end());
    sort(lr.begin(), lr.end(), greater<pii>());
    // from right
    ll retR = 0;
    ll curr = 0;
    ll odd  = n % 2;
    for (ll i = 0; i < n / 2 + odd; ++i) {
        retR += max(0ll, lr[i].first - curr);
        if (lr[i].first > curr)
            curr = lr[i].first;
        retR += max(0ll, curr - rl[i].first);
        if (rl[i].first < curr)
            curr = rl[i].first;
    }
    retR += abs(curr);

    // from left
    ll retL = 0;
    curr     = 0;
    for (ll i = 0; i < n / 2 + odd; ++i) {
        retL += max(0ll, curr - rl[i].first);
        if (rl[i].first < curr)
            curr = rl[i].first;
        retL += max(0ll, lr[i].first - curr);
        if (lr[i].first > curr)
            curr = lr[i].first;
    }
    retL += abs(curr);
    cout << max(retR, retL) << "\n";
    return 0;
}

Measured memory_bytes: 2036
import java.util.Scanner;
import java.util.ArrayList;

public class Main {

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

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = 360;
    System.out.println(360 / gcd(x, y));
  }
}


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

#include <iostream>
#include <fstream>

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

typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define intv(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0; i < (end); i += 1)
#define all(x) (x).begin(),(x).end()
//#define len(array)  (sizeof(array)/sizeof((array)[0]))
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))
const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
void _mod(ll &x){x = mod(x, MOD);}
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;

#define int ll

map<int,int > M;
class CBigArray {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        int N, K;
        cin >> N >> K;
        _for(i,N){
            int a,b;
            cin >> a >> b;
            M[a] += b;
        }
        for(auto p : M){
            K -= p.second;
            if(K <= 0){
                cout << p.first << endl;
                return;
            }
        }
        cout << M.rbegin()->second << endl;
    }
};

#undef int
int main() {
	CBigArray solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
vector<lint> ans;
void solve(lint num, lint nowk, lint lastnum, lint k) {
    //cout << num << endl;
    if(nowk >= k) {
        //cout << num << endl;
        ans.push_back(num);
        return;
    }
    lint num1 = num*10 + lastnum;
    solve(num1, nowk+1, lastnum, k);
    if(lastnum != 0) {
        lint num2 = num*10 + (lastnum-1);
        solve(num2, nowk+1, lastnum-1, k);
    }
    if(lastnum != 9) {
        lint num3 = num*10 + (lastnum+1);
        solve(num3, nowk+1, lastnum+1, k);
    }
}
int main()
{
    lint K;
    cin >> K;
    int k = 1;
    while(true) {
        FOR(i, 1, 10) {
            solve(i, 1, i, k);
        }
        if(ans.size() >= K) break; 
        k++;
    }
    sort(ans.begin(), ans.end());
    cout << ans[K-1] << endl;
}

Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mem(arr,v) memset(arr,v,sizeof(arr))
/*bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
} */
int main()
{
     ll t,arr[100005],kk;
     cin>>t;
     for(int i=0;i<t;i++)
        cin>>arr[i];
     sort(arr,arr+t);
     kk=t/2;
     cout<<arr[kk]-arr[kk-1]<<endl;
}




Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  int n,m,tmp,cnt=0;
  vector<int> vec(0);
  cin >> n >> m;
  rep(i,n){
    cin >> tmp;
    vec.push_back(tmp);
    m-=tmp;
    cnt++;
  }
  sort(vec.begin(),vec.end());
  cnt+=m/vec.at(0);
  cout << cnt << endl;
}

Measured memory_bytes: 256
<<NOTE.!
サイコロ III
  DiceIと同様の方法で、入力された数字から２つのサイコロをつくります。
  これらが同一のものか判定するプログラムを作成してください。
  DiceIの方法でサイコロを回転させ、２つのサイコロのそれぞれの６方向から見た数字が
  全て一致するとき、同一のサイコロとみなします。

Input
  １行目に１つ目のサイコロの各面の数字が、ラベルの順番に空白区切りで与えられます。
  ２行目に２つ目のサイコロの各面の数字が、ラベルの順番に空白区切りで与えられます。

Output
  ２つのサイコロが同一ならば "Yes" と、異なるならば "No" と１行に出力してください。

Constraints
  0? 入力されるサイコロの面の数字 ?100

Sample Input 1
1 2 3 4 5 6
6 2 4 3 5 1

Sample Output 1
Yes

Sample Input 2
1 2 3 4 5 6
6 5 4 3 2 1

Sample Output 2
No

NOTE

class Dice
  attr_accessor :faces

  # |T F L|
  # |B U R|
  def initialize(faces)
    top, front, right, left, back, bottom = faces
    @faces = [[top, bottom], [front, back], [left, right]]
  end

  def move(commands)
    commands.split('').each do |com|
      case com.upcase.to_sym
      when :E
        faces[0], faces[2] = faces[2], faces[0].reverse
      when :W
        faces[0], faces[2] = faces[2].reverse, faces[0]
      when :N
        faces[0], faces[1] = faces[1], faces[0].reverse
      when :S
        faces[0], faces[1] = faces[1].reverse, faces[0]
      end
    end
  end

  def method_missing(face)
    if %i(top bottom front back left right).include? face
      {
        top:    faces[0][0],
        bottom: faces[0][1],
        front:  faces[1][0],
        back:   faces[1][1],
        left:   faces[2][0],
        right:  faces[2][1]
      }[face]
    else
      super
    end
  end

  def ==(other)
    commands = (["N"]*3 + ["E"]*3)
    0.upto(commands.size) do |r|
      commands.permutation(r).each do |c|
        move(c.join)
        return true if faces == other.faces
      end
    end
    false
  end

  def clone
    self.class.new([top, front, right, left, back, bottom])
  end

  def info
    p({ T: top, F: front, R: right, L: left, U: back, B: bottom })
  end

end

$stdin = DATA if $<.eof?

dice_a = Dice.new(gets.split)
dice_b = Dice.new(gets.split)

puts(dice_a == dice_b ? "Yes" : "No")

__END__
1 2 3 4 5 6
6 2 4 3 5 1

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

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

const long long mod = 1000000007;
// auto mod int
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 { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

int main(){
    int n;
    cin >> n;
    if (n == 1) cout << 0 << endl;
    else if (n == 2) cout << 2 << endl;
    else {
        mint ans = 1;
        rep(i, n) ans *= 10;
        mint one = 1, two = 1;
        rep(i, n) one *= 9;
        rep(i, n) two *= 8;
        ans = ans - one * 2 + two;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3628
n=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(n):
    if a[i]<=399:
        c.append('0')
    elif a[i]<=799:
        c.append('1') 
    elif a[i]<=1199:
        c.append('2')
    elif a[i]<=1599:
        c.append('3')
    elif a[i]<=1999:
        c.append('4')
    elif a[i]<=2399:
        c.append('5')
    elif  a[i]<=2799:
        c.append('6')
    elif  a[i]<=3199:
        c.append('7')
x=n-len(c)
#3200以上の人数
c=list(set(c))

print(max(len(c),1), len(c)+x)

Measured memory_bytes: 3064
import java.util.*;
 
public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) A[i] = sc.nextInt();
		show(A);
		for(int i=1;i<N;i++){
			int v = A[i];
			int j = i-1;
			while(j>=0 && A[j]>v){
				A[j+1] = A[j];
				j--;
			}
			A[j+1] = v;
			show(A);
		}

	}
	
	public static void show(int[] ary){
		for(int i=0;i<ary.length-1;i++){
			System.out.print(ary[i]+" ");
		}
		cout(ary[ary.length-1]);
	}
	
	public static void cout(String n){
		System.out.println(n);
	}
	
	public static void cout(int n){
		System.out.println(n);
	}
}

Measured memory_bytes: 34740
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
typedef long long lint;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef unsigned long long ulint;
#define endl '\n'
#define fst first
#define sed second
#define pb push_back
#define mp make_pair
#define rint register int
#define newline putchar('\n')
#define leave_space putchar(' ')
#define all(x) (x).begin(), (x).end()
#define reveal(x) cerr << #x << " = " << (x) << endl
#define rep(it, f, e) for (rint it = (f); it <= (e); ++it)
#define per(it, f, e) for (rint it = (f); it >= (e); --it)
const int MAXN = 1e5 + 10;
pll p[MAXN];
int sz[MAXN];
map<lint, int> rec;
vector<int> edge[MAXN];
#define D fst
#define P sed
vector<pii> opt;
lint res = 0;
inline void dfs(int u, int par, int dep) {
	res += dep;
	for (auto v : edge[u]) {
		if (v == par) continue;
		dfs(v, u, dep + 1);
	}
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	int n;
	cin >> n;
	rep (i, 1, n) {
		cin >> p[i].D;
		p[i].P = i;
		if (rec.find(p[i].D) != rec.end()) {
			cout << -1 << endl;
			return 0;
		}
		rec[p[i].D] = p[i].P;
	}
	sort(p + 1, p + n + 1, greater<pll>());
	fill(sz + 1, sz + n + 1, 1);
	rep (i, 1, n - 1) {
		int u = p[i].P;
		if (n - sz[u] - sz[u] <= 0) {
			cout << -1 << endl;
			return 0;
		} 
		lint diff = p[i].D - (n - sz[u] - sz[u]);
		if (rec.find(diff) == rec.end()) {
			cout << -1 << endl;
			return 0;
		}
		int v = rec[diff];
		opt.pb(pii(u, v));
		edge[u].pb(v);
		edge[v].pb(u);
		sz[v] += sz[u];
	}
	dfs(p[n].P, 0, 0);
	if (res != p[n].D) {
		cout << -1 << endl;
		return 0;
	}
	for (auto &v : opt) {
		if (v.fst > v.sed) swap(v.fst, v.sed);
	}
	sort(all(opt));
	for (auto &v : opt) {
		cout << v.fst << ' ' << v.sed << endl;
	}
	return 0;
}

Measured memory_bytes: 18292