akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
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 ll INF = 1LL <<60;
// const int INF = 10000;

//最大公約数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

const int MAX = 1e6+1;
const int MOD = 1e9+7;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}

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

//sieve(MAX);でベクトルIsPrimeに「MAXまでの数値の素数の真偽」を格納する。
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    } 
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
}
// ここから開始

int main(){
    int h,w,a,b;
    cin>>h>>w>>a>>b;
    vector<vector<int> >ans(h,vector<int>(w,0));
    for(int i = 0; i < b; i++){
        for(int j = 0; j < a; j++){
            ans[i][j] = 1;
        }
    }
    for(int i = b; i < h; i++){
        for(int j = a; j < w; j++){
            ans[i][j] = 1;
        }
    }
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cout<<ans[i][j];
        }
        cout<<endl;
    }
    return 0;
}



Measured memory_bytes: 5120
#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 fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
struct UnionFind {
	using T = int;
	const T def = 0;
	T f(T a, T b) { return a + b; }
	//==========================================
	vector<int> par;
	vector<T> value;
	UnionFind() {}
	UnionFind(int NV) { init(NV); }
	void init(int NV) { par.clear(); rep(i, 0, NV) par.push_back(i); value.resize(NV, 1); }
	void reset() { rep(i, 0, par.size()) par[i] = i; }
	int operator[](int x) {
		if (par[x] == x) return x;
		else {
			int res = operator[](par[x]);
			if (res != par[x]) {
				value[res] = f(value[res], value[par[x]]);
				value[par[x]] = def;
			}
			return par[x] = res;
		}
	}
	// uf(x,y)->y
	void operator()(int x, int y) {
		x = operator[](x); y = operator[](y);
		if (x != y) {
			value[y] += value[par[x]];
			value[par[x]] = def;
			par[x] = y;
		}
	}
	T getValues(int x) { return value[operator[](x)]; };
};
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N, M;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> M;

	UnionFind uf(N);
	rep(i, 0, M) {
		int a, b; cin >> a >> b;
		a--; b--;
		uf(a, b);
	}

	int ans = 0;
	rep(i, 0, N) chmax(ans, uf.getValues(i));
	cout << ans << endl;
}







Measured memory_bytes: 10876
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d,s,t,r,n,m,l,k,j;
int main(){
    cin>>a>>b>>c>>d;
    s=a*c;
    t=b*d;
    r=a*d;
    n=b*c;
    m=max(s,t);
    k=max(m,r);
    j=max(k,n);
    cout<<j;


return 0;}




Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define INF 1<<10

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
struct COIN{
	int c[4];
};
COIN coin[13205];

const int coins[] = { 10, 50, 100, 500 };


int main()
{
//	cut here before submit 
//	freopen ("testcase.MPL", "r", stdin );
	int price;
	scanf ("%d", &price );
	while (1 ){
		vector<int> count (4, 0 );
		rep (i, 4 ){
			scanf ("%d", &count[i] );
		} // end rep
		int sum = 0;
		rep (i, 4 ){
			sum += coins[i]*count[i];
		} // end rep
//		cout << "sum: " << sum << endl;
		int change = sum - price;
		vector<int> c (4, 0 );
		for (int i = 3; i >= 0; i-- ){
			c[i] = change/coins[i];
			change -= c[i]*coins[i];
		} // end for
		vector<int> res (4, 0 );		
		rep (i, 4 ){
			res[i] = max (0, count[i] - c[i] );
		} // end rep
		rep (i, 4 ){
			if (res[i] != 0 ){
				cout << coins[i] << ' ' << res[i] << endl;
			} // end if
		} // end rep
		scanf ("%d", &price );
		if (price != 0 )
			cout << endl;
		else
			break;			 
	} // end loop

//	printf ("%d\n", res );
		
	return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x%y) : x; }


int main(){
    int N, K;
    cin >> N >> K;
    vector<int> p(N);
    rep(i, N) cin >> p[i];
    sort(all(p));
    int ans = 0;
    rep(i, K) ans += p[i];
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3632
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
using namespace std;
int a,b,c,d;
string st;
int main(){
	cin>>st;
	a=st[0]-48; b=st[1]-48; c=st[2]-48; d=st[3]-48;
	if(a+b+c+d==7) {printf("%d+%d+%d+%d=7\n",a,b,c,d);return 0;}
	if(a+b+c-d==7) {printf("%d+%d+%d-%d=7\n",a,b,c,d);return 0;}
	if(a+b-c+d==7) {printf("%d+%d-%d+%d=7\n",a,b,c,d);return 0;}
	if(a-b+c+d==7) {printf("%d-%d+%d+%d=7\n",a,b,c,d);return 0;}
	if(a-b+c-d==7) {printf("%d-%d+%d-%d=7\n",a,b,c,d);return 0;}
	if(a+b-c-d==7) {printf("%d+%d-%d-%d=7\n",a,b,c,d);return 0;}
	if(a-b-c+d==7) {printf("%d-%d-%d+%d=7\n",a,b,c,d);return 0;}
	if(a-b-c-d==7) {printf("%d-%d-%d-%d=7\n",a,b,c,d);return 0;}
}


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

int main(){
  string s, t;
  cin >> s >> t;

  int cnt = 0;
  rep(i, 3) if(s[i] == t[i]) cnt++;

  cout << cnt << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define mREP(i,a,b) for (int i = a; i > (b); --i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int main(){
  string s;
  cin >> s;
  cout << s.substr(0,4) + " " + s.substr(4,8) << endl; 
  return 0;
} 

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

using namespace std;

#define FOR(i,a,b) for(int i=a;i<=b;i++)

int main() {
	// your code goes here
	int a[5][5]; int dd[5][5];
	memset(dd,0,sizeof(dd));
	FOR(i,1,3)
	FOR(j,1,3) cin >> a[i][j];
	int n,dem=0; cin >> n;
	FOR(p,1,n) {
		int h; cin >> h;
		FOR(i,1,3)
		FOR(j,1,3) if (a[i][j]==h) dd[i][j]=1;
	}
	FOR(i,1,3) {
	 int dem=0;
	 FOR(j,1,3) if (dd[i][j]==1) dem++;
	 if (dem==3) {
	 	cout << "Yes";
	 	exit(0);
	 }
	}
	FOR(j,1,3) {
	 int dem=0;
	 FOR(i,1,3) if (dd[i][j]==1) dem++;
	 if (dem==3) {
	 	cout << "Yes";
	 	exit(0);
	 }
	}
	dem=0;
	FOR(i,1,3) {
		if (dd[i][i]==1) dem++;
		if (dem==3) {
			cout << "Yes";
			exit(0);
		}
	}
	dem=0;
	if (dd[1][3]==1) dem++;
	if (dd[2][2]==1) dem++;
	if (dd[3][1]==1) dem++;
	if (dem==3) {
		cout << "Yes";
		exit(0);
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;

    if(s == "Sunny")
	cout << "Cloudy" << endl;
    else if(s == "Cloudy")
	cout << "Rainy" << endl;
    else
	cout << "Sunny" << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
#include<unordered_map>
#include <queue>
 
using namespace std;
using ll=long long;
#define rep(i,n)  for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

int main(){
    string s;
    cin >> s;
    ll ans = -1;
    rep(i, s.size()){
        ans++;
        while(i+1<s.size()&&s[i]==s[i+1])i++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

void solve() {
  ll H, A;
  cin >> H >> A;
  ll ans = H / A;
  if (H % A) ans++;
  cout << ans << endl;
}

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


Measured memory_bytes: 256
//Compiler optimization
#pragma GCC optimize("Ofast")

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

//typedef
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef string S;
typedef queue<int> qi;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<vl> mat;

//macro
#define reverse(a) reverse(a.begin(),a.end())
#define unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define fr(i,n)for(ll i=0;i<(n);i++)
#define ifr(i,n)for(ll i=(n)-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define each(x, v) for (auto &x : v)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
ll pow(ll a,ll n, ll m){
    ll ret=1;
    for(;n>0;n>>=1,a=a*a%m){
        if(n%2==1){
        ret=ret*a%m;
        }
    }
    return ret;
}

//abbreviation
#define pb push_back
#define elif else if
#define mp make_pair
#define endl '\n'

//debug
#define debug(x) cerr << #x << ": " << x << endl
#define v_debug(v) cerr << #v << endl;fr(i,v.size()) cerr << i << ": " << v[i] << endl

//const
const  ll INF = 1e18;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << setprecision(20);
    ll d,t,s;cin >> d >> t >> s;
    if(d<=t*s)cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007 //1e9+7
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 21

void calc(int n){
  int y,x,m,l;
  char dir;
  bool jewel[SIZE][SIZE] = {};
  
  for(int i=0;i<n;i++){
    scanf("%d%d",&x,&y);
    jewel[y][x] = true;
  }

  y = 10;
  x = 10;
  int cc = 0;

  scanf("%d",&m);

  cc += jewel[y][x];
  jewel[y][x] = false;

  for(int i=0;i<m;i++){
    scanf(" %c%d",&dir,&l);

    for(int j=0;j<l;j++){
      if(dir=='N') y += 1;
      if(dir=='W') x -= 1;
      if(dir=='S') y -= 1;
      if(dir=='E') x += 1;

      cc += jewel[y][x];
      jewel[y][x] = false;
    }
  }
  
  if(cc==n) puts("Yes");
  else puts("No");
  
  return;
}

int main(){
  int n;
  
  while(1){
    scanf("%d",&n);
    if(n==0) break;
    calc(n);
  }

  return 0;
}

Measured memory_bytes: 3136
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
 int n ;
void dfs(string s,char c){//ｃは使われているマックス+1
  if(s.size()==n){
    cout<<s<<endl; //ここでn文字の文字列が決定
    }else{
     for(char d= 'a';d<=c;d++){//辞書順
       if(d==c) dfs(s+d,c+1) ;
       else dfs(s+d,c) ;
     } 
    }
  }

int main(){
   cin>>n ;
  dfs("",'a') ;
   
    return 0;
  }

Measured memory_bytes: 1536
R = int(input())
# a, b = map(int, input().split())
# c = list(map(int, input().split()))
# d = [list(map(int, input().split())) for _ in range(n)]
# s = input()

ans = ""

if R <1200:
    ans = "ABC"
elif R<2800:
    ans = "ARC"
else:
    ans = "AGC"


print(ans)

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

using namespace std;

int main(int argc, char const *argv[]) {
  long long a, b, c, x, cnt;

  cin >> a >> b >> c >> x;

  cnt = 0;
  for (int i = 0; i <= a; i++)
  {
    for (int j = 0; j <= b; j++)
    {
      for (int k = 0; k <= c; k++)
      {
        if (500 * i + 100 * j + 50 * k == x)
        {
          cnt++;
        }
      }
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
ll N,K,t,d;
vector<pair<ll,int>> v;
int main(){
	cin >> N >> K;
	for(int i=1;i<=N;i++){
		cin >> t >> d;
		v.push_back({d,t});
	}
	map<int,ll> m;
	sort(v.begin(),v.end());
	ll ans = 0,sum = 0,cnt = 0,r = 0;
	for(int i=N-1;i>=0;i--){
		if(i>=N-K){
			m[v[i].second]++;
			sum += v[i].first;
			if(i==N-K){
				ll s = m.size();
				ans = sum + s*s;
				r = N-K;
			}
		}else{
			if(!m.count(v[i].second)){
				m[v[i].second]++;
				while(r<=N-1 && m[v[r].second]==1) r++;
				if(r==N) break;
				sum += v[i].first-v[r].first;
				m[v[r].second]--; r++;
				ll s = m.size();
				ans = max(ans,sum+s*s);
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 5744
/**
 *   created: 03 June 2019  00:25:23
**/
#include<bits/stdc++.h>
using namespace std;

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

#define PB push_back
#define PPB pop_back
#define all(c) c.begin(),c.end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define rrep(i,a,b) for(int i = (int)(a-1); i>=(int)(b); i--)
#define INFLL 2000000000000000007
#define INF 2000000007
#define MOD 1000000007


#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif


void optimizeIO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

//                                        //AUTHOR: Kaushalesh Shukla

//=========================================================================================================

int main()
{
	optimizeIO();
	int tt=1;
	//cin>>tt;
	while(tt--){
		int n;
		cin>>n;
		vi v(n);
		rep(i,0,n)
			cin>>v[i];
		int res=0;
		bool flag = true;
		while(flag){
			flag = false;
			int mini = INF;
			int ind1=-1,ind2=-1;
			rep(i,0,n){
				if(v[i]!=0){
					flag=true;
					if(ind1==-1){
						ind2=i;
						ind1=i;
					}
					else{
						ind2 = i;
					}
					mini = min(mini, v[i]);
				}
				else if(v[i]==0 && ind1!=-1){
					break;
				}
			}
			if(flag){
				res += mini;
				rep(i,ind1,ind2+1)
					v[i] -= mini;
			}
		}
		cout<<res;

	}
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int h[100005];
int n;
int a,b;
bool check(int x){
  long long cnt=0;
  for(int i=n;i>=1;--i){
    if(h[i]>=b*1ll*x){
      cnt+=(h[i]-b*x+a-1)/a;
    }
  }
  return cnt<=x;
}
int main(){
  scanf("%d%d%d",&n,&a,&b);a-=b;
  for(int i=1;i<=n;++i)scanf("%d",h+i);
  sort(h+1,h+n+1);
  int l=1,r=1000000000;
  while(l<=r){
    int mid=(l+r)>>1;
    if(check(mid)){
      r=mid-1;
    }else{
      l=mid+1;
    }
  }
  printf("%d\n",l);
  return 0;
}


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

int main()
{
  string S;
  cin >> S;

  if(S.at(0) == S.at(1) || S.at(1) == S.at(2) || S.at(2) == S.at(3)){
      cout << "Bad" << endl;
  }else{
      cout << "Good" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int N;
 cin>>N;
 vector<string> V;
 long long sum=0;
 for(int i=1;i<=N;i++)
 {
   if(i%3==0 && i%5==0)
   { V.push_back("FizzBuzz");}
   else
   if(i%3==0)
   { V.push_back("Fizz");}
   else
   if(i%5==0)
   { V.push_back("Buzz");}
   else
   {V.push_back("i");
    sum+=i;}
    }
    
    cout<<sum;
    return 0;
    }


Measured memory_bytes: 36112
#include<iostream>
#include<string>
#include<algorithm>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <set>
#include <queue>
#include <stack>
#include <map>
 
using namespace std;
typedef long long LL;
const int INF = int(1e9);
const int MAX = 1000020;
LL N;
LL a[MAX],b[MAX],c[MAX];
 
void Cin(LL a[])
{
    for(int i = 1;i<=N;i++)
        scanf("%lld",&a[i]);
}
 
int main()
{
    cin>>N;
    Cin(a),Cin(b),Cin(c);
    sort(a+1,a+1+N),sort(b+1,b+1+N),sort(c+1,c+1+N);
    LL sum = 0;
    LL ai = 0,ci = 0;
    for(int i = 1;i<=N;i++){
        while(a[ai+1]<b[i]&&ai+1<=N)
            ai++;
        while(c[ci+1]<=b[i]&&ci+1<=N)
            ci++;
       // cout<<ai<<" "<<ci<<endl;
        sum += ai*(N-ci);  //因为相乘可能会溢出,所以要为LL;
    }
 
    cout<<sum<<endl;
 
    return 0;
}

Measured memory_bytes: 9216