akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;
 
#define rep(i, n) for(int i = 0; i < (int)(n);    i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

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; }
typedef long long ll;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }


int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  int N; std::cin >> N;
  std::vector<int> A(N); rep(i,N) std::cin >> A[i];
  std::vector<int> K(N); rep(i,N) K[i] = i;
  std::sort( all(K), [&](int x, int y) {return A[x] > A[y];} );
  for(auto k = K.rbegin(); k!=K.rend(); k++) std::cout << *k+1 << " ";
  std::cout << std::endl;
  return 0;
}


Measured memory_bytes: 1664
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <math.h>
#include <cmath>
#include <string>
#include <time.h>
#include <random>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <string.h>
using namespace std;

//#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
//#define cin in
//#define cout out
#define pii pair<int,int>
#define ll long long
#define db double
#define ld long double
#define uset unordered_set
#define umap unordered_map

ifstream in("input.txt");
ofstream out("output.txt");

int main()
{
	map<string, int> strings;
	int n;
	cin >> n;
	while (n--) {
		string s;
		cin >> s;
		sort(s.begin(), s.end());
		strings[s]++;
	}

	ll ans = 0;
	for (auto x : strings) {
		ans += 1LL * (x.second) * (x.second - 1) / 2;
	}
	
	cout << ans;
}

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VB = vector<bool>;
using VS = vector<string>;
using graph = vector<vector<int>>;

int main()
{
string s;
cin>>s;
cout<<s.rfind("Z")-s.find("A")+1<<endl;
    return 0;
}

Measured memory_bytes: 3744
class Building(object):
    def __init__(self):
        self.floor = []
        self.floor.extend([[0] * 10])
        self.floor.extend([[0] * 10])
        self.floor.extend([[0] * 10])

    def change_resident(self, f, r, v):
        self.floor[f][r] += v

    def print_status(self):
        for f in self.floor:
            print(' {0}'.format(' '.join(map(str, f))))

if __name__ == '__main__':
    # ?????????4?£??????????
    buildings = []
    for i in range(4):
        buildings.append(Building())

    # ??????????????\???
    data_num = int(input())
    data = []
    for i in range(data_num):
        data.append([int(x) for x in input().split(' ')])

    # ??\?±?????????´??°
    for d in data:
        b = d[0]
        f = d[1]
        r = d[2]
        v = d[3]
        buildings[b-1].change_resident(f-1, r-1, v)

    # ?????????????????¨???
    buildings[0].print_status()
    print('#' * 20)
    buildings[1].print_status()
    print('#' * 20)
    buildings[2].print_status()
    print('#' * 20)
    buildings[3].print_status()

Measured memory_bytes: 7724
#include <bits/stdc++.h>
using namespace std;
int main (void) {
    int K, N;
    cin >> K >> N;
    vector<int> A(2 * N);
    for (int i = 0; i < N; i++) cin >> A.at(i);
    for (int i = 0; i < N; i++) A.at(i+N) = A.at(i) + K;

    int ans = 100000000;
    for (int i = 0; i < N; i++) ans = min(ans, A.at(i+N-1) - A.at(i));
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

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

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}


ll cost[400][400];
int main(){
   int h, w, d;
   cin >> h >> w >> d;
   vector<P>coord(h * w + 100);
   rep(i, h){
       rep(j, w){
           int a;
           cin >> a;
           coord[a] = P(i, j);
       }
   }
   vector<ll>rui_sum(h * w + 1, 0);
   vector<bool>seen(h * w + 1, false);
   REP(i, 1, h * w){
       int now = i;
       if(seen[i])continue;
       while(now + d <= h * w){
           seen[now] = true;
           rui_sum[now + d] = rui_sum[now] + abs(coord[now + d].first - coord[now].first) + abs(coord[now + d].second - coord[now].second);
           now += d;
       }
   }

   int q;
   ll res = 0;
   cin >> q;
   while(q--){
       int l, r;
       cin >> l >> r;
       cout << rui_sum[r] - rui_sum[l] << endl;
   }
}



Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
 
#define int long long
 
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (LLONG_MAX - 1e5)
 
using namespace std;
 
int N, A[200005];
 
signed main() { 
    cin >> N;
    REP(i, N) {
        cin >> A[i];
        A[i] -= i + 1;
    }
    sort(A, A + N);
 
    int b = A[N / 2];
 
    int ans = 0;
    REP(i, N) { ans += abs(A[i] - b); }
    cout << ans << endl;
 
    return 0;
}

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

#define gcd(a,b)		__gcd(a,b)
#define lcm(a,b)		(a*b)/gcd(a,b)
#define ff              first
#define ss              second
#define int             long long
#define pb              emplace_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             INT_MAX
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(x)			x.begin(),x.end()
#define digits(x)		floor(log10(x))+1
#define FIO				ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

class dsu {
private:
	int *id;
	int* sz;

	int root(int i) {
		while (i != id[i]) {
			id[i] = id[id[i]];
			i = id[i];
		}
		return i;
	}
public:
	int n;
	dsu(int v) {
		n = v;
		id = new int[n];
		sz = new int[n];

		for (int i = 0; i < n; i++) {
			id[i] = i;
			sz[i] = 0;
		}
	}

	bool find(int p , int q) {
		return root(p) == root(q);
	}

	void join(int p , int q) {
		int i = root(p);
		int j = root(q);
		if (i == j) {
			return;
		}
		if (sz[i] < sz[j]) {
			id[i] = j ;
			sz[j] += sz[i];
		}
		else {
			id[j] = i;
			sz[i] += sz[j];
		}
	}
};

int nCr(int n , int r ) {
	int p = 1, k = 1;

	if (n - r < r ) {
		r = n - r;
	}
	if (r != 0) {
		while (r != 0) {
			p *= n ;
			k *= r ;
			int m = __gcd(p, k);
			p /= m;
			k /= m;
			n--;
			r--;
		}
	}
	else {
		p = 1;
	}
	return p ;
}

int modPower(int x, int y , int p) {
	//Used to calculate (x^y)%p
	int res = 1;
	if (y == 0) {
		return 1;
	}

	x = x % p;
	if (x == 0) {
		return 0  ;
	}

	while (y > 0) {
		if (y & 1) {
			res = (res * x) % p;
		}

		y >>= 1;
		x = (x * x) % p;
	}
	return res ;

}


long double distance( int x , int y) {
	int val = x * x + y * y;
	long double ans = sqrt(val);
	return ans;
}


int32_t main() {
	FIO;

	int n, d ;
	cin >> n >> d;

	int count = 0 ;
	while (n--) {
		int a, b;
		cin >> a >> b;

		if (distance(a, b) <= d) {
			count++;
		}
	}
	cout << count;








	return 0;
}


Measured memory_bytes: 3668
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
cnt = 0
ans = 0
seq = []
for i in reversed(range(1,n+1)):
    sumi = sum(b[i-1:n:i])
    if sumi % 2 == a[i-1]:
        continue
    else:
        b[i-1] = 1
        seq.append(i)
        cnt += 1
    
if ans == -1:
    print(-1)
else:
    print(cnt)
    print(' '.join(list(map(str, seq))))

Measured memory_bytes: 75868
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k;cin>>n>>k;
  lvector dice(n,0); rep(i,n) cin>>dice[i];
  vector<double> expsum(n+1,0.0);
  for(ll i=1;i<=n;++i) expsum[i]=expsum[i-1]+(dice[i-1]+1.0)/2.0;
  double ans=0.0;
  for(ll i=0;i+k<=n;++i) ans=max(ans,expsum[i+k]-expsum[i]);
  printf("%.10f\n",ans);
  return 0;
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define loop(i,n) for(i = 0; i < n; i++)
#define TC() ull T; cin>>T; while(T--)
#define IN(x) {scanf("%d",&x);}
#define LL(x) {scanf("%lld",&x);}
#define CC(x) {scanf("%c",&x);}
#define pfl(x) printf("%d\n",x)
#define pfll(x) printf("%lld\n",x)
#define newl puts("")
#define space printf(" ")
#define MOD 1000000007
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL);


int main()
{
    int i = 0, j = 0, cs = 0, in;
    ll a, v; cin>>a>>v;
    ll b, w; cin>>b>>w;
    int t; cin>>t;
    if(a < b){
        ll fa = a + v*t;
        ll fb = b + w*t;
        if(fa >= fb) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else{
        ll fa = a - v*t;
        ll fb = b - w*t;
        if(fa <= fb) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}


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

int main() {
  int n,m;
  cin>>n>>m;
  int k[15],s[15][15],p[15];
  for (int i=0; i<m; i++) {
    cin>>k[i];
    for (int j=0; j<k[i]; j++) {
      cin>>s[i][j];
      s[i][j]--;
    }
  }
  for (int i=0; i<m; i++) cin>>p[i];
  int ans=0;
  for (int bit=0; bit<(1<<n); bit++) {
    bool flag=true;
    for (int i=0; i<m; i++) {
      int cnt=0;
      for (int j=0; j<k[i]; j++) {
	if (bit&(1<<s[i][j])) cnt++;
      }
      if (cnt%2!=p[i]) {
	flag=false;
      }
    }
    if (flag) ans++;
  }
  cout<<ans<<endl;
  return 0;
}


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

#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
int main(){
    int a,b;
    cin >> a >> b;
    cout << (6-a-b) << endl;
    
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 10000

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef pair<int ,int > P;
typedef long long ll;

int A,B,C,N,W,H,ans,dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	for (int i = 0; i < S.size(); ++i)
	{
		if(S[i] == ','){
			cout << " ";
		}else{
			cout << S[i];
		}
	}
	cout << "\n";
}

void debug(){

}

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

	return 0;
}

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

int main() {
    int r, d, x_init;
    cin >> r >> d >> x_init;

    int x[11] = {0};
    x[0] = x_init;
    for (int i = 0; i < 10; i++) {
        x[i+1] = r * x[i] - d;
        cout << x[i+1] << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using namespace std;

int main(){
	int n; cin >> n;
	string s; cin >> s;
	s += '0';
	int cnt = 0;
	for( int i = 0; i < n; ++i ){
		if( s[i] != s[i+1] ) ++cnt;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 512
using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
  bool ans=true;
  rep(i,s.size()/2){
    if(s[i]!=s[s.size()/2+i]){
      ans=false;
      break;
    }
  }
  return ans;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int A,B;
  cin>>A>>B;
  int ans=A/B;
  if(ans*B==A)
    cout<<ans<<endl;
  else
    cout<<ans+1<<endl;
}


Measured memory_bytes: 256
#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)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; --i)
#define ALL(a) begin(a), end(a)
#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))
#define X first
#define Y second

using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

constexpr int MOD = 1e9 + 7;
constexpr int INF = 1e9 + 1;
constexpr ll LLINF = 4 * 1e18 + 1;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, k;
	cin >> n >> k;
	vi a(n);
	REP(i, n) cin >> a[i];
	cout << CEIL(n-1, k-1) << "\n";
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{
     int a,b,c;
     cin>>a>>b>>c;
     if(c%__gcd(a,b)==0)
     {
         cout<<"YES"<<endl;
         return 0;
     }
     else
     {
         cout<<"NO"<<endl;
     }
}


Measured memory_bytes: 3604
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


int main(){
    ll n,m;
    cin>>n>>m;
    string s;
    cin>>s;
    if(s[0]=='B'){
        for(int i=0;i<m;i++){
            if(s[i]=='B'){s[i]='R';}
            else{s[i]='B';}
        }
    }
    ll l=0;
    while(l<m && s[l]=='R'){l++;}
    if(l==m){
        ll ans=1;
        vector<ll> dp(n,0);
        vector<ll> sum(n,0);
        dp[0]=sum[0]=1;
        for(int i=2;i<n;i++){
            dp[i]=sum[i-2];
            sum[i]=dp[i]+sum[i-1];
            sum[i]%=MOD;
        }
        for(ll i=2;i<=n;i++){
            ans+=sum[n-i]*i%MOD;
        }
        ans%=MOD;
        cout<<ans<<endl;
        return 0;
    }
    if(n&1){cout<<(l==m?1:0)<<endl; return 0;}
    ll mi=E;
    if(l&1){mi=l;}
    else{mi=l+1;}
    for(ll i=l;i<m;i++){
        if(s[i]=='R'){
            ll w=i;
            while(i<m && s[i]=='R'){i++;}
            if(i!=m){
                ll L=i-w;
                if(L&1){mi=min(mi,L);}
            }
        }
    }
    vector<ll> dp(n,0);
    vector<ll> sum(n,0);
    dp[0]=sum[0]=1;
    for(int i=2;i<n;i+=2){
        ll r=sum[i-2];
        ll l=(i-mi-3>=0?sum[i-mi-3]:0LL);
        dp[i]=r-l;
        dp[i]%=MOD;
        sum[i]=sum[i-2]+dp[i];
        sum[i]%=MOD;
        //cout<<dp[i]<<" "<<sum[i]<<endl;
    }
    ll ans=0;
    for(ll i=2;i<=mi+1 && n-i>=0;i++){
        ans+=dp[n-i]*i%MOD;
        ans%=MOD;
    }
    if(l==m){ans++;}
    ans%=MOD;
    if(ans<0){ans+=MOD;}
    cout<<ans<<endl;
    
    
    
    return 0;
}


Measured memory_bytes: 3716
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

X, K, D = LI()

"""
X 
K回数 D移動
"""

X = abs(X)
tmp = X - D * K
if tmp <= 0:
    if X % D < abs(X % D - D):
        if (X - X % D) // D % 2 == K % 2:
            ans = X % D
        else:
            ans = abs(X % D - D)
    else:
        if (X - (X % D - D)) // D % 2 == K % 2:
            ans = abs(X % D - D)
        else:
            ans = X % D

else:
    ans = tmp

print(ans)


Measured memory_bytes: 10948
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner stdin = new Scanner(System.in);
	int x = stdin.nextInt();
	int y = stdin.nextInt();
        int w = 0;
	if(y<x){
	    w = y;
	    y = x;
	    x = w;
	}
	while(x!=0 || y!=0){
	    System.out.println(x+" "+y);
	    x = stdin.nextInt();
	    y = stdin.nextInt();
	    if(y<x){
		w = y;
		y = x;
		x = w;
	    }
	}
    }
}

	

Measured memory_bytes: 35768
#include<stdio.h>
int main(void)
{
    int A,B,M;
    int a[200000],b[200000],x[200000],y[200000],c[200000];
    int i,j,m[200000];
    scanf("%d %d %d",&A,&B,&M);

    for(i=0;i<A;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<B;i++){
        scanf("%d",&b[i]);
    }
    for(i=0;i<M;i++){
        scanf("%d %d %d",&x[i],&y[i],&c[i]);
    }
    int amin=a[0],bmin=b[0];
    for(i=0;i<A;i++){
        if(a[i]<amin) amin=a[i];
    }
    for(i=0;i<B;i++){
        if(b[i]<bmin) bmin=b[i];
    }
    for(i=0;i<M;i++){
        m[i]=a[x[i]-1]+b[y[i]-1]-c[i];
    }
    int mmin=m[0];
    for(i=0;i<M;i++){
        if(m[i]<mmin) mmin=m[i];
    }
    if(mmin>amin+bmin){
        printf("%d\n",amin+bmin);
    } else {
        printf("%d\n",mmin);
    }
    return 0;
}

Measured memory_bytes: 4608
#include <bits/stdc++.h>
using namespace std;
map<int,int> m;
map<int,int>::iterator m_it;
int main()
{
	int i,n,k,sum=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&k);
		if(m.count(k)==0)
			m[k]=1;
		else
			m[k]++;
	}
	for(m_it=m.begin();m_it!=m.end();++m_it)
	{
		if(m_it->first<=m_it->second)
			sum+=m_it->second-m_it->first;
		else
			sum+=m_it->second;
	}
	printf("%d",sum);
	return 0;
}

Measured memory_bytes: 4736
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[] mtn = new int[10];
		for(int i = 0; i<mtn.length; i++){
			mtn[i] = sc.nextInt();
		}
		for(int i = 0; i<mtn.length-1; i++){
			for(int j = i+1; j<mtn.length; j++){
				if(mtn[i] < mtn[j]){
					int tmp;
					tmp = mtn[i];
					mtn[i] = mtn[j];
					mtn[j] = tmp;
				}
			}
		}
		for(int i = 0; i<3; i++)
			System.out.println(mtn[i]);
	}
}

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

int main(){
  long long int N;
  cin  >> N;
  long long int sum = 0;

  for (long long int i = 1; i < N + 1; i++){
    if (i % 5 != 0 && i % 3 != 0 && i % 15 != 0){
      sum += i;
    }
  }

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 3636
//abc109_b.cpp
//Sat Sep  8 20:56:53 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	unordered_map<string, int> mp;


	int flag = 0;
	char endchar;
	for (int i=0;i<n;i++){
		string temp;
		cin >> temp;
		if (i==0){
			endchar = temp[temp.length()-1];
		}else {
			if (temp[0] != endchar){
				flag = 1;
			}
			endchar = temp[temp.length()-1];
		}

		if (mp[temp] == 1){
			flag = 1;
		}
		mp[temp] = 1;
	}


	if (flag == 1){
		cout << "No" << endl;
	}else {
		cout << "Yes" << endl;
	}
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 256
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 10**5
    for a in A:
        a = prime_factorize(a)
        ans = min(ans, a.count(2))
    if (ans == 10 ** 5):
        ans = 0
    print(ans)
    return


resolve()

Measured memory_bytes: 38640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define repin(a,n) vector<ll> a(n);rep(i,n){cin>>a[i];}
#define in(a) ll a;cin>>a;
#define ins(a) string a;cin>>a;
#define ind(a) double a;cin>>a;
template<class T>
inline void out(T a){cout<<a<<endl; }
inline void out(double a){ printf("%.10f\n", a);} 

ll mod = 1000000007;

ll mmul(ll a, ll b) {
	return ((a % mod) * (b % mod)) % mod;
}

ll mpow(ll a, ll b) {
	if (b == 0) return 1;
	if (b % 2 == 0) {
		ll d = mpow(a, b / 2);
		return (d * d) % mod;
	}
	return (a * mpow(a, b - 1)) % mod;
}

ll mdiv(ll a, ll b) {
	return mmul(a, mpow(b, mod - 2));
}

int main()
{
    ins(s);
    rep(i,s.size()){
		if((i+1)%2==1){
			if(s[i]=='R'){
			}else if(s[i]=='U'){
			}else if(s[i]=='D'){
			}else{
				out("No");
				return 0;
			}
		}else if((i+1)%2==0){
			if(s[i]=='L'){
			}else if(s[i]=='U'){
			}else if(s[i]=='D'){
			}else{
				out("No");
				return 0;
			}
		}
	}
	out("Yes");
}

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

using namespace std;

#define ipair pair<int,int>
#define rep(I,N) for(int I=0; I<N; I++)
#define rrep(I,N) for(int I=N; I>=0; I--)
#define repj(i,j,n) for(int i=j;i<n;i++)

#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()

#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl

int main() {
  int N;
  cin >> N;

  long ans = 1;
  repj(i, 1, N+1) {
    ans *= i;
    // long val = ans;
    // rep(j, i) {
    //   ans += val;
    ans = ans % (long)(exp10(9) + 7);
    //}
  }

  printf("%ld\n", ans);
  return 0;
}



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


typedef long long ll;

int N,M,H,W,K,A,B,S,T;

using namespace std;

int main() {
  cin >> A>>B>>T;
  N = T/A;
  cout << B*N << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;

ll gcd(ll a, ll b){
    if(a<b) swap(a, b);
    if(b==0) return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b){
    return a/gcd(a, b)*b;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b;
    cin >> a >> b;

    cout << lcm(a, b) << endl;

    return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }


int
main(void){  
  ll n, t;
  cin >> n >> t;
  ll a[n];
  ll a_min[n];
  int count = 0;
  REP(i, n){
    cin >> a[i];    
  }
  
  ll diff_m=0LL;
  ll temp_m;
  a_min[0] = a[0];
  FOR(i, 1, n) {
    a_min[i] = min(a_min[i-1], a[i]);
    temp_m = (a[i] - a_min[i-1]);
    if(temp_m > diff_m) {
      diff_m = temp_m;
      count = 1;
    }
    else if (temp_m == diff_m) {
      ++count;
    }
  }
 
  cout << count << endl;
  
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define INF 1023456789
#define sacnf scanf
#define scnf scanf
#define scnaf scanf
#define CRLF <<'\n';
#define ALL(v) v.begin,v.end()
#define SIZE(v) (int)v.size()
#define PRPAIR(x) x.first << x.second
#define DEBUG(x) do { std::cerr <<(x)<<'\n'; } while (0)
#define rep(i,a,b) for(int i=(a);i!=(int)b-((a)>(b));(a)>(b)?--i:++i)
using namespace std;
typedef pair<int,int> ii;
typedef pair<int,ii> pip;
typedef vector<int> vi;
typedef long long ll;

int main(){
    int n;
    scanf("%d",&n);
    if (n >= 30){
        cout << "Yes";
    }else
        cout << "No";

}


Measured memory_bytes: 3692
inf = 10000

a#b = abs (a-b)

solv a b c ls = go ls (0,0,0) 0 where
  go [] (la,lb,lc) cost
    | la==0 || lb==0 || lc==0 = inf
    | otherwise = cost + a#la + b#lb + c#lc
  go (l:ls) (la,lb,lc) cost = minimum [forA, forB, forC, unuse] where
    forA = go ls (la+l, lb, lc) $ if la>0 then cost+10 else cost
    forB = go ls (la, lb+l, lc) $ if lb>0 then cost+10 else cost
    forC = go ls (la, lb, lc+l) $ if lc>0 then cost+10 else cost
    unuse = go ls (la,lb,lc) cost

main = do
  [n,a,b,c] <- map read . words <$> getLine
  ls <- map read . words <$> getContents
  print $ solv a b c ls


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ar array

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

const int maxn = 2e5 + 5;

signed main(void)
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #ifdef LOCAL
    freopen("A.INP", "r", stdin);
    freopen("A.OUT", "w", stdout);
  #endif // LOCAL
  string s; cin >> s;
  cout << s.substr(0, 3);
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define for_int(i,a,b) for(int i=(a);i<=(b);++i)
#define rep_int(i,a,b) for(int i=(a);i>=(b);--i)
#define for_ll(i,a,b) for(ll i=(a);i<=(b);++i)
#define rep_ll(i,a,b) for(ll i=(a);i>=(b);--i)
#define ull unsigned long long
#define ll long long
#define db double
#define HPMAX 1005
#define KMP_MAX 1005
#define prime_MAX 1e6+5
#define quick_pow_mod 1e9+7
#define PII pair<int,int>
const int factor_N = 1e7 + 5;
const int tree_arr_N = 1e6 + 5;
using namespace std;
//快读
int read() {
	char c = getchar();
	int x = 0, f = 1;
	for (; !isdigit(c); c = getchar())
		if (c == '-') f = -1;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - 48;
	return x * f;
}
int n;
int main() {
	n = read();
	long long ans = 1000;
	vector<int>a(n + 2, 0);
	for_int(i, 1, n) a[i] = read();
	for_int(i, 2, n)
		if (a[i] > a[i - 1]) {
			ll cnt = ans / a[i-1];
			ans += cnt * (a[i] - a[i-1]);
		}
	cout << ans << endl;
	return 0;
}

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

int main() {
    int N;
    cin >> N;

    string W[N];
    for (int i = 0; i < N; i++){
        cin >> W[i];
    }

    for (int i = 1; i < N; i++){
        for (int j = 0; j < i; j++){
            if (W[j] == W[i]){
                cout << "No" << endl;
                return 0;
            }
        }
        if (W[i - 1].back() != W[i].front()){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node { int p, l, r; };
struct Node T[MAX];
int n;

void preParse(int u) {
  if ( u == NIL ) return;
  printf( " %d", u );
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u) {
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf( " %d", u );
  inParse(T[u].r);
}

void postParse(int u) {
  if ( u == NIL ) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d", u);
}

int main() {
  int i, v, l, r, root;

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

  for ( i = 0; i < n; i++ ) {
    scanf( "%d %d %d", &v, &l, &r );
    T[v].l = l;
    T[v].r = r;
    if ( l != NIL ) T[l].p = v;
    if ( r != NIL ) T[r].p = v;
  }

  for ( i = 0; i < n; i++ ) if ( T[i].p == NIL ) root = i;

  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");

  return 0;
}


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

#define zton(i,n) for(int i=0;i<=n;i++)
#define oneton(i,n) for(int i=1;i<=n;i++)
#define fo(i,n) for(int i=0;i<n;i++)
#define fab(i,a,b) for(int i=a;i<b;i++)
#define loop(i,b,a) for(int i=a;i>=b;i--)
#define dsort(arr,n) sort(arr, arr + n, greater<int>())
#define vsortd(a) sort(a.begin(), a.end(), greater<double>())
#define vsort(a) sort(a.begin(), a.end())
#define ll long long int
#define test int tc;cin>>tc;while(tc--)
#define dbg(x) cout<<#x<<'='<<(x)<<endl;
#define dbg2(x,y) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl;
#define dbg3(x,y,z) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl;
#define dbg4(x,y,z,w) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl<<#w<<"="<<(w);
#define minheap priority_queue <int, vector<int>, greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define ff first
#define ss second
#define mpr make_pair
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define mkv vector<int>
#define allzero(dp) memset(dp,0,sizeof(dp))
#define endl "\n"
#define print(x) cout<<x<<endl;

const int mod=1e9+7;
using namespace std;
bool sortcol( const vector<int>& v1,const vector<int>& v2 ) {return v1[1] < v2[1];}

void fastio()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}

bool sortbysecdesc(const pair<ll,ll> &a,const pair<ll,ll> &b){
    if(a.first>b.first)return true;
    if(a.first==b.first)return a.second<b.second;
    return false;
}

ll power(ll x, ll y){
    ll res = 1;x=x%mod;
    while(y>0){
        if(y&1)res=(res*x)%mod;
        y=y>>1;x=(x*x)%mod;}
    return res;
}



void solve()
{
    int a,b,c;cin>>a>>b>>c;
    int k;cin>>k;
    int num=0;
    while(b<=a){
        num++;
        b*=2;
    }
    while(c<=b){
        num++;
        c*=2;
    }
   // print(num)
    if(num<=k)print("Yes")
    else print("No")

}

int main()
{
  //  fastio();
   // test
    solve();
}


Measured memory_bytes: 3632
import sys

input = sys.stdin.readline

N, H = map(int, input().split())
katanas = []
for _ in range(N):
    a, b = map(int, input().split())
    katanas.append((a, b))

max_a = sorted(katanas, reverse=True)[0][0]
throws = []
for a, b in katanas:
    if max_a < b:
        throws.append(b)

ans = 0
for b in sorted(throws, reverse=True):
    H -= b
    ans += 1
    if H <= 0:
        print(ans)
        sys.exit()

print(ans + (H - 1) // max_a + 1)

Measured memory_bytes: 23828
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
    int k,a,b;
    cin >> k >> a >> b;
    for(int i=a;i<=b;++i){
        if(i%k == 0){
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3636
#include "bits/stdc++.h"
using namespace std;
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define N	    100001
#define rep(i,a,b)  for(int i=a;i<b;i++)
typedef long long ll;

void solve(){
	int n, k;
	cin>>n>>k;
	ll ans = 1e11;
	ll p = 1e11;
	ll x[n];
	rep(i, 0, n)
		cin>>x[i];
	rep(i, 0, n - k + 1) {
		if(x[i + k - 1] < 0) p = -x[i];
		else if(x[i] >= 0) p = x[i + k - 1];
		else p = min(abs(2 * x[i]) + x[i + k - 1], 2 * x[i + k - 1] + abs(x[i]));
		ans = min(p, ans);
	}
	cout<<ans<<endl;
}
int main() {
	int t;
//	cin>>t;
	t = 1;
	while(t--){
		solve();
	}
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A;
  cin >> N >> A;
  
  int amari;
  amari = N%500;
 
  if (amari > A) {
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
  
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    private static void solve(long X, long Y){
        int length = 1;
        while(2 * X <= Y){
            X = 2 * X;
            length ++;
        }
        System.out.print(length);
    }
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        long X = input.nextLong();
        long Y = input.nextLong();
        input.close();
        solve(X, Y);
    }
}

Measured memory_bytes: 22356
///
// File:  2440.cpp
// Author: ymiyamoto
//
// Created on Fri Nov 10 15:06:25 2017
//

#include <cstdint>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

enum status_t {
  Open,
  Close,
};

int32_t main()
{
  uint32_t N, U;
  cin >> N;

  vector<string> registered;
  for (uint32_t i = 0; i < N; i++) {
    string str;
    cin >> str;
    registered.push_back(str);
  }

  cin >> U;
  bool is_close = true;
  for (uint32_t i = 0; i < U; i++) {
    string str;
    cin >> str;
    uint32_t j = 0;
    for (; j < registered.size(); j++) {
      if (str == registered[j]) {
        if (is_close) {
          cout << "Opened by " << str << endl;
        } else {
          cout << "Closed by " << str << endl;
        }
        is_close = !is_close;
        break;
      }
    }

    if (j == registered.size()) {
      cout << "Unknown " << str << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
#define se second
#define fi first
#define ll long long
#define ld long double
#define pll pair<ll ,ll >
#define pii pair<int, int> 
#define mod 1000000007
ll power(ll a,ll b){
    ll res=1;
    while(b>0){
        if(b%2!=0) res=(res*a);
        a=(a*a);
        b/=2;
    }
    return res;
}
ll ncr(ll n,ll k){
    if(k==0||k==n) return 1ll;
    if(k>n-k) k=n-k;
    ll pro=1;
    for(ll i=0;i<k;i++){
        pro=(pro*(n-i));
        pro/=(i+1);
    }
    return pro;
}
int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,k;
    cin>>n>>k;
    vector<ll > siz,pat;
    siz.push_back(1ll);
    pat.push_back(1ll);
    for(int i=1;i<=n;i++){
        siz.push_back(2*siz[i-1]+3ll);
        pat.push_back(2*pat[i-1]+1ll);
    }
    ll ans=0;
    for(ll i=n;i>=0;i--){
        if(k==siz[i]){
            ans+=pat[i];
            break;
        }
        else if(k==1ll || k==0ll) {
            break;
        }
        assert(i>0);
        if(k<=1ll+siz[i-1]){
            k--;
        }
        else{
            ans+=1ll+pat[i-1];
            k-=(2ll+siz[i-1]);
        }
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    string answer = "APPROVED";
    for (int i = 0; i < N; i++)
    {
        ll num;
        cin >> num;
        if(num % 2 == 0)
        {
            if(num % 3 != 0 && num % 5 != 0)
            {
                answer = "DENIED";
            }
        }
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
import itertools

N = input()
L = list(map(int, input().split()))
cnt = 0

for group in itertools.combinations(L, 3):
    if group[0] != group[1] and \
        group[1] != group[2] and \
        group[2] != group[0] and \
        group[0] + group[1] > group[2] and \
        group[1] + group[2] > group[0] and \
        group[2] + group[0] > group[1]:
            cnt += 1

print(cnt)

Measured memory_bytes: 9192
#include <iostream>
#include <iomanip>
#include <vector>
int main()
{
  int N, K;
  std::cin >> N >> K;

  int ans = 0;

  //std::vector<int> h(N);
  int h;
  for (int i = 0; i < N; i++) {
    std::cin >> h;
    if (h >= K) ans++;
  }

  std::cout << ans << std::endl;

  return 0;

}



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

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef unordered_map<int,int> umii;
typedef unordered_map<ll,ll> umll;

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define bs(v,val) binary_search(v.begin(),v.end(),val)
#define mod 1e9+7
#define ff first
#define ss second
#define fi(n) for(int i=0;i<n;i++)
#define fj(n) for(int j=0;j<n;j++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define m_p make_pair
#define endl '\n'



// ********** CODE STARTS HERE ****************//
string convertToTitle(ll n) {
        string ans = "";
        while(n)
        {
            n--;
            ans += (char)(n%26+'a');
            n/=26;
        }
        reverse(ans.begin(), ans.end());
        return ans;
    }
int main()
{
	fastio;
    
    ll N;
    cin >> N;
    cout<<convertToTitle(N)<<endl;
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
  int a;
  string s;
  cin >> a >> s;
  if(a >= 3200) cout << s << endl;
  else cout << "red" << endl;
}


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

int main(){
    int a, b, c;
    char op;
    cin >> a >> op >> b;
    while( op != '?' ){
        if ( op == '+' ){
            c = a + b;
        }
        if ( op == '-' ){
            c = a - b;
        }
        if ( op == '*' ){
            c = a * b;
        }
        if ( op == '/' ){
            c = a / b;
        }
        cout << c << endl;
        cin >> a >> op >> b;
    }
    return 0;
}


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

int main()
{
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for (int i = 1; i < n; i++)
  {
    ans = (double)(ans + v[i]) / 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3752
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

SA, SB, SC = [list(sys.stdin.readline().rstrip()) for _ in range(3)]
SA.reverse()
SB.reverse()
SC.reverse()

turn = 'a'
while True:
    if turn == 'a':
        if len(SA) == 0:
            print('A')
            exit()
        turn = SA.pop()
    elif turn == 'b':
        if len(SB) == 0:
            print('B')
            exit()
        turn = SB.pop()
    elif turn == 'c':
        if len(SC) == 0:
            print('C')
            exit()
        turn = SC.pop()


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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rep(i, k, n) for (int i = (int)(k); i < (int)(n); ++i)
#define rrep(i, k, n) for (int i = (int)(n) - 1; i >= (int)(k); --i)

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vv_ii;
typedef pair<int,ii> i_ii;
typedef vector<i_ii> vi_ii;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;

template <class T>
inline ostream& operator<<(ostream & o, vector<T> const& v) {
    for (int i = 0; i < (int)(v.size()) - 1; ++i)
        o << v[i] << ' ';
    if (!v.empty())
        o << v.back();
    return o;
}

template <class T, class Q>
inline ostream& operator<<(ostream & o, pair<T,Q> const& p) {
    o << "(" << p.fi << "," << p.se << ")";
    return o;
}


int main(){

    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int n;
    cin >> n;

    int ans = 0;
    rep(i, 0, n) {
        int x;
        cin >> x;
        --x;
        if ((i - x) != ans)
            ++ans;
    }
    if (ans >= n)
        ans = -1;
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			BigInteger bi = scn.nextBigInteger();
			if (bi.isProbablePrime(17)) {
				System.out.println(bi);
			} else {
				System.out.println(bi.nextProbablePrime());
			}
		}
	}
}


Measured memory_bytes: 23380
def LI():return map(int,input().split())
def I(): return input().split()

a,b,c,x,y=LI()
lst=[]
ans=0
for i in range(10**5+1):
    lst.append(2*i*c+max(0,x-i)*a+max(0,y-i)*b)
print(min(lst))

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

int main() {
    int H,W;
    cin>>H>>W;
    string p[H];
    for(int i=0;i<H;i++){
       cin>>p[i]; 
    }
    for(int k=0;k<W+2;k++) cout<<"#";
    cout<<endl;
    for(int l=0;l<H;l++){
       cout<<"#"<<p[l]<<"#"<<endl; 
    }
    for(int m=0;m<W+2;m++) cout<<"#";
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
 
#define rep(i, n) for(int i = 0; i < (n); i++)
#define MP make_pair
 
using namespace std;
 
typedef pair<int, int> P;
 
vector<P> open;
int gx, gy;
int W, H, N;
char field[1002][1002];
 
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
 
bool visit[1001][1001];
bool check(int n){
    memset(visit, 0, sizeof(visit));
 
    rep(i, n){
        field[open[i].second][open[i].first] = '.';
    }
    for(int i = n; i < open.size(); i++){
        field[open[i].second][open[i].first] = '#';
    }
 
    //rep(i, 10){
    //  rep(j, 10){
    //      cout << field[i][j];
    //  }cout << endl;
    //}cout << endl;
 
    queue<P> q;
    q.push(MP(0, 0));
 
    while(!q.empty()){
        P p = q.front();
        q.pop();
         
        if(visit[p.second][p.first]) continue;
        visit[p.second][p.first] = true;
 
        if(field[p.second][p.first] == 't') return true;
 
        rep(i, 4){
            int nx = p.first+dx[i], ny = p.second+dy[i];
            if(nx < 0 || nx >= W || ny < 0 || ny >= H) continue;
            if(field[ny][nx] != '#') q.push(MP(nx, ny));
        }
    }
 
    return false;
}
 
int main(){
    cin >> W >> H;
    rep(i, H) rep(j, W) cin >> field[i][j];
    cin >> N;
    rep(i, N){
        int x, y;
        cin >> x >> y;
        if(field[y][x] == '.'){
            x = y = 1001;
        }
        open.push_back(MP(x, y));
    }
    int lb = -1, ub = N+1;
    while(ub - lb > 1){
        int mid = (lb+ub)/2;
        if(check(mid))ub = mid;
        else lb = mid;
    }
    if(ub == N+1) ub = -1;
    cout << ub << endl;
 
    return 0;
}

Measured memory_bytes: 3228
N,K= map(int,input().split())
p=10**9+7
q=0

def calc(n,k):
  if k==1:
    return n+1
  else:
    maxi = k*n- k*(k-1)//2
    mini=  k*(k-1)//2
    #print(k,maxi,mini,maxi-mini+1)
    return maxi-mini+1
  
ans=0
for i in range(K,N+2):
  ans = ( ans+calc(N,i) )%p
  
print(ans)

Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
 
int main () {
  string s;
  cin >>s;
  bool kai = true;
  for (int i=0;i<s.size()/2;i++){
    if (s[i] != s[(s.size()/2)-1-i])kai =false;
  }
  for (int i=(s.size()+1)/2;i<s.size()+1;i++){
    if(s[i] != s[s.size()-1-i])kai =false;
  }
  if(kai == true){
    cout <<"Yes"<<endl;
  }else {
    cout <<"No"<<endl;
  }

return 0;
}


Measured memory_bytes: 256