akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

long long max(long long x, long long y){return (x > y ? x : y);}
long long min(long long x, long long y){return (x < y ? x : y);}

#define ll long long
#define pb push_back
#define ld long double
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll> 

using namespace :: std;

const ll maxn=3e5+500;
const ll inf=1e17+7;

ll A[maxn];
vector<ll> in[maxn];
ll ans=0,k;

ll dfs(ll a){
	ll mx=0;
	for(ll i=0;i<in[a].size();i++){
		ll v=in[a][i];
		mx=max(mx,dfs(v)+1);
	}
	if(mx>=k-1 && A[a]!=1){
		ans++;
		return -1;
	}
	return mx;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);	
	ll n;
	cin>>n>>k;
	for(ll i=1;i<=n;i++){
		cin>>A[i];
	}
	if(A[1]!=1){
		ans++;
		A[1]=1;
	}
	for(ll i=2;i<=n;i++){
		in[A[i]].pb(i);
	}
	dfs(1);
	cout<<ans;
}



















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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

const ll INF = 1e18;

pll dp[2005][2005];
string S;
pll dfs(int l, int r){
	pll ret;
	if( dp[l][r] != pll(-INF,-INF) ) return dp[l][r];
	if( r-l <= 1 ) return dp[l][r] = pll(0,1);
	if( S[l] == S[r-1] ){
		ret = dfs(l+1, r-1);
	}else{
		auto r1 = dfs(l+1, r);
		auto r2 = dfs(l, r-1);
		if( r1.first != r2.first ){
			ret = min( r1, r2 );
		}else{
			ret = pll( r1.first, min(INF, r1.second+r2.second) );
		}
		ret.first++;
	}
	return dp[l][r] = ret;
}

bool flag = false;
string dfs(int l, int r, ll k){
	string ret;
	if( r-l <= 1 && k > 0 ) flag = true;
	if( r-l == 1 ) return S.substr(l,1);
	if( r-l <= 0 ) return "";
	if( S[l] == S[r-1] ){
		return S[l] + dfs(l+1, r-1, k) + S[l];
	}else{
		auto pl = dp[l+1][r];
		auto pr = dp[l][r-1];
		if( pl.first < pr.first ){
			return S[l] + dfs(l+1, r, k) + S[l];
		}else if( pl.first > pr.first ){
			return S[r-1] + dfs(l, r-1, k) + S[r-1];
		}else if( S[l] < S[r-1] ){
			if( k < pl.second ){
				return S[l] + dfs(l+1, r, k) + S[l];
			}else{
				return S[r-1] + dfs(l, r-1, k - pl.second) + S[r-1];
			}
		}else if( S[l] > S[r-1] ){
			if( k < pr.second ){
				return S[r-1] + dfs(l, r-1, k) + S[r-1];
			}else{
				return S[l] + dfs(l+1, r, k - pr.second) + S[l];
			}
		}
	}
	return "!";
}

int main(){
	ll k;
	cin >> S >> k;
	rep(i,2005) rep(j,2005) dp[i][j] = pll(-INF, -INF);

	dfs(0, S.length());
//	rep(i,10){
//		rep(j,10) cout << "(" << dp[i][j].first << "," << dp[i][j].second << ") ";
//		cout << endl;
//	}

	auto ans = dfs(0, S.length(), k-1);
	cout << (flag ? "NONE" : ans) << endl;

	return 0;
}

Measured memory_bytes: 66276
N, C, K = map(int, input().split())
Ts = []
for i in range(N):
  T = int(input())
  Ts.append(T)
Ts.sort()
r = 0
i = 0
while i < N:
  Imin = i
  Tmin = Ts[Imin]
  while i < N:
    if i < Imin+C and Ts[i] <= Tmin+K:
      i += 1
    else:
      break
  r += 1
print(r)


Measured memory_bytes: 7384
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cstdlib>
#include<cmath>
#include<numeric>
#include<iomanip>
#include<functional>
#include<cstdlib>
#include<queue>
#include<deque>
const double PI = acos(-1);
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
using ll =long long;
const int mod = 1000000007;

//map<string>a
class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% mod + mod) % mod) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint & a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator-=(const mint & a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint & operator*=(const  mint & a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint & a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint & a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint & a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint & a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint & a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream & os, const mint & m) {
		os << m.x;
		return os;
	}
};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
//組み合わせ
void recursive_comb(vector<int> indexes, int s, int rest, std::function<void(vector<int>)> f) {
	if (rest == 0) {
		f(indexes);
	}
	else {
		if (s < 0) return;
		recursive_comb(indexes, s - 1, rest, f);
		indexes[rest - 1] = s;
		recursive_comb(indexes, s - 1, rest - 1, f);
	}
}

// nCkの組み合わせに対して処理を実行する
void foreach_comb(int n, int k, std::function<void(vector<int>)> f) {
	vector<int>indexes(k);
	recursive_comb(indexes, n - 1, k, f);
}

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


int main() {
	int N;
		cin>> N;
	map<int, int>ans;
	vector<int>a(N);
	ll sum=0;
	rep(i, N) {
		cin >> a[i];
		ans[a[i]]++;
		sum += a[i];
	}
	int Q;
	cin >> Q;
	vector<int>b(Q);
	vector<int>c(Q);
	rep(i, Q) {
		cin >> b[i] >> c[i];

	}
	
	rep(i, Q) {
		sum +=(c[i]-b[i]) * ans[b[i]];
		ans[c[i]]+=ans[b[i]];
		ans[b[i]] = 0;
		cout << sum<<endl;
	}
	
}


Measured memory_bytes: 8808
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<cstdio>
#include<cctype>
#include<cassert>
#include<cstdlib>
#include<cstring>
#include<sstream>
#include<iostream>
#include<algorithm>

#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define lf else if

#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> Vi;

int IN(){
	int c,f,x;
	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
}

const int N=200000+19;
const int p=1e9+7;
const int oo=(1<<30)-1;

int Pow(int a,int b){
	int res=1;
	for (;b;b>>=1,a=1ll*a*a%p) if (b&1) res=1ll*res*a%p;
	return res;
}

int c[N],w[N],mn[N],wei[N],fac[N],inv[N],val[N];
int X,Y,amn,n,ans,m,id,ase;

int main(){
	//freopen("1.in","r",stdin);
	fac[0]=1;
	For(i,1,N) fac[i]=1ll*fac[i-1]*i%p;
	inv[N-1]=Pow(fac[N-1],p-2);
	for (int i=N-1;i;i--) inv[i-1]=1ll*inv[i]*i%p;
	amn=oo;ase=oo;
	For(i,0,N) mn[i]=oo;
	n=IN(),X=IN(),Y=IN();
	For(i,1,n+1){
		c[i]=IN(),w[i]=IN();
		if (w[i]<amn){
			ase=amn;
			amn=w[i];
			id=c[i];
		} lf (w[i]<ase){
			ase=w[i];
		}
		mn[c[i]]=min(mn[c[i]],w[i]);
	}
	For(i,1,n+1)
		if (c[i]==id){
			if (w[i]+amn<=X&&amn+ase<=Y||w[i]+ase<=Y){
				m++;
				val[c[i]]++;
			}
		} else{
			if (w[i]+amn<=Y||w[i]+mn[c[i]]<=X&&mn[c[i]]+amn<=Y){
				m++;
				val[c[i]]++;
			}
		}
	ans=fac[m];
	For(i,0,N) ans=1ll*ans*inv[val[i]]%p;
	printf("%d\n",ans);
}

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

const string YES = "Yes";
const string NO = "No";

void solve(std::string S){
    for(ll i=0; i< S.size(); i++){
        if(i%2==0 && S[i]=='L' ) {
            cout << NO << endl;
            return;
        }
        if(i%2 == 1 && S[i] == 'R'){
            cout << NO << endl;
            return;
        }
    }
    cout << YES << endl;
    return;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

using namespace std;
int main(void){
    int n;
    cin >> n;
    
    int x[n],y[n];
    for(int i=0;i<n;i++) cin >> x[i];
    for(int i=0;i<n;i++) cin >> y[i];
    
    double D_p1 = 0;
    for(int i=0;i<n;i++){
        D_p1 += fabs(x[i]-y[i]);
    } 
    
    double D_p2 = 0;
    for(int i=0;i<n;i++){
        D_p2 += pow(x[i]-y[i],2);
    } 
    D_p2 = sqrt(D_p2);

    double D_p3 = 0;
    for(int i=0;i<n;i++){
        D_p3 += pow(fabs(x[i]-y[i]),3);
    } 
    D_p3 = pow(D_p3,1.0/3.0);
    
    double D_p_inf = 0;
    for(int i=0;i<n;i++){
        if(fabs(x[i]-y[i])>D_p_inf) D_p_inf = fabs(x[i]-y[i]);
    } 

    cout << fixed << D_p1 << endl;
    cout << fixed << D_p2 << endl;
    cout << fixed << D_p3 << endl;
    cout << fixed << D_p_inf << endl;
    
}



Measured memory_bytes: 3456
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <set>
#include <cmath>
#include <math.h>
#include <sstream> 
 
using namespace std;


int main(){
    int n;
    cin>>n;
    vector<int> s(n);
    int sum=0;
    for(int i=0;i<n;i++){
        cin>>s[i];
        sum+=s[i];
    }
    
    if(sum%10==0){
        int m=sum;
        for(int i=0;i<n;i++){
            if(s[i]<m && s[i]%10!=0){
                m=s[i];
            }
        }
        sum-=m;
    }    
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
    int a,b,c;

    cin >> a;


if(a==1){
cout << "Hello World" << endl;
return 0;
}
else if(a==2){
        cin  >> b >> c;
        cout << b+c << endl;
}else{
    return 0;
}
}


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

using namespace std;

using ll = long long;
using ld = long double;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    // cout << setprecision(8) << setiosflags(ios::fixed);

    ll a, b;
    cin >> a >> b;

    if (b < a) swap(a, b);

    ll x = (a - b) / 2 + b;
    if (abs(a - x) != abs(b - x)) cout << "IMPOSSIBLE\n";
    else cout << x << "\n";

    return 0;
}


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

int main () {
  int N;
  cin >> N;
  vector <int> H(N);
  for (int i = 0; i < N; i++) cin >> H.at(i);
  int ans = 1;
  for (int i = 1; i < N; i++){
    bool view = true;
    for (int j = 0; j < i; j++){
      if (H.at(i) < H.at(j)) view = false;
    }
    if (view) ans++; 
  }  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>
#include <cmath>
#include <cstring>
#include <map>
#include <unordered_map>
#include <sstream>
#include <iomanip>

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; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

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

	ll N, K;
	cin >> N >> K;

	ll ans = N - K + 1;

	cout << ans << endl;

	//system("pause");
}

Measured memory_bytes: 256
def Kth_Substring(s , k):

    ans = []
    sset = set()

    for i in range(len(s)):
        for w in range(1, k + 1):
            sset.add(s[i:i + w])
    ans = sorted(list(sset))
    return ans[k - 1]

def main():
    s = str(input())
    k = int(input())
    print(Kth_Substring(s , k))

if __name__ == '__main__':
    main()

Measured memory_bytes: 40304
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+5;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
int a[N];
char ch[215];
void wt()
{
	for (int i=1;i<=210;i++) cout<<ch[i];
	cout<<endl;
}
signed main()
{
	int n;
	cin>>n;
	cout<<floor((2200-n-1)/200.0)<<endl;
}

Measured memory_bytes: 3784
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>


int main(){
  string S, T; cin >> S >> T;
  
  int s = 0;
  bool flag = false;
  while (true){
    s = S.find(T[0], s);
    if (s==-1) break;

    if (S.substr(s)+S.substr(0,s) == T){
      flag = true;
      break;
    }
    s++;

  }

  cout << (flag? "Yes" : "No") << endl;

  // cout << fixed << setprecision(6);
  return 0;
}



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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ll long long
#define db double
#define el "\n"
#define ld long double
#define rep(i,n) for(int i=0;i<n;i++)
#define rev(i,n) for(int i=n;i>=0;i--)
#define rep_a(i,a,n) for(int i=a;i<n;i++)
#define all(ds) ds.begin(), ds.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef vector< long long > vi;
typedef pair<long long, long long> ii;
typedef priority_queue <ll> pq;
#define o_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define graph vector<vi>

const ll mod = 1000000007;
const ll INF = (ll)1e18;
const ll MAXN = 1000006;

ll po(ll x, ll n ){ 
    ll ans=1;
     while(n>0){
         if(n&1) ans=(ans*x)%mod;
         x=(x*x)%mod;
         n/=2;
     }
     return ans;
}



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

    int T=1;
    //cin >> T;
    while(T--){
        ll n,x,t;
        cin>>n>>x>>t;
        ll ans=n/x;
        if(n%x!=0) ans++;
        cout<<ans*t<<el;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}

Measured memory_bytes: 3820
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>

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

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

#define amari(x) ((x) % 1000000007)

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end());
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<int>());
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin();
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin();

#define rep(i,n) for(int i=0; i<(n); i++)
#define isValidPoint(x, y, mx, my) x >= 0 && x  < mx && y >= 0 && y < my

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

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

  string s;

  cin >> s;

  int l = s.size();

  int res1 = 0;
  int res2 = 0;
  rep(i, l) {
    if (i%2 == (s[i] == '0') )res1++;
    if (i%2 == (s[i] == '1') )res2++;
  }

  cout << min(res1, res2) << endl;

  return 0;
}


Measured memory_bytes: 512
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
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; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
#define bn '\n'
template <typename T>
ostream& operator<<(ostream& os, vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
     os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;

bool dfs(int s, vector<vector<int>>& edge, vector<int>& dist){
    stack<int> st;
    st.push(s);
    while(not st.empty()){
        int v = st.top(); st.pop();
        for(auto u:edge[v]){
            if(dist[u]!=inf){
                if((dist[v]-dist[u])&1) continue;
                return true; //奇閉路
            }
            dist[u]=dist[v]+1;
            st.push(u);
        }
    }
    return false;
}

int bfs(int s, vector<vector<int>>& edge){
    int N = edge.size();
    queue<int> q;
    q.push(s);
    vector<int> dist(N,inf); dist[s]=1;

    int res = 0;
    while(not q.empty()){
        int v = q.front(); q.pop();
        for(auto u:edge[v]){
            if(dist[u]!=inf) continue;
            q.push(u);
            dist[u] = dist[v]+1;
            chmax(res, dist[u]);
        }
    }
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<vector<int>> edge(N);
    REP(i,N){
        string t; cin >> t;
        REP(j,N){
            if(t[j]=='1') edge[i].emplace_back(j);
        }
    }

    vector<int> dist(N,inf);
    dist[0]=0;
    if(dfs(0,edge,dist)){
        cout << -1 << bn;
        return 0;
    }

    int ans=0;
    REP(i,N){
        chmax(ans, bfs(i,edge));
    }

    cout << ans << endl;
}

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

int main() {

  int data;
  int cnt = 0;

  cin >> data;
 
  for(int i = 0;i<3; i++){
	if(data%2 == 1){
      cnt++;
    }
    data >>= 1;
  }
  
  cout << cnt << endl;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    st = [input() for i in range(n)]
    x = input()
    isStart = False
    sum = 0
    for i in st:
        s, t = i.split()
        if s == x:
            isStart = True
            continue
        if isStart:
            sum += int(t)
    print(sum)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
import math
def Sieve_of_Eratosthenes(N):
    if N<2:
        prime = [False for i in range(N+1)]
        return prime
 
    prime = [True for i in range(N+1)]
    prime[0] = False
    prime[1] = False
 
    for i in range(2, int(N**0.5)+1):
        if prime[i]:
            for j in range(i*2, N+1, i):
                prime[j] = False
 
    return prime

n=int(input())
prime=Sieve_of_Eratosthenes(int(n**0.5)+100)
ans=0
for p in range(len(prime)):
    if prime[p]==True:
        tp=p
        while n%tp==0:
            ans+=1
            n//=tp
            tp*=p
        
        while n%p==0:
            n//=p
if n!=1: ans+=1
print(ans)

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

struct UnionFind
{
    int i;
    vector<int> par;
    vector<int> size;
    UnionFind(int n): par(n),size(n,1){
        for(i = 0;i < n;++i){
            par.at(i) = i;
        }
    }
    
    int root(int x){
        if(par.at(x) == x){
            return x;
        }else{
            return par.at(x) = root(par.at(x));
        }
    }
    
    void unite(int x, int y){
        int rx = root(x);
        int ry = root(y);
        if(rx == ry){
            return;
        }else{
            if(size.at(rx) < size.at(ry)){
                swap(rx,ry);
            }
            par.at(ry) = rx;
            size.at(rx) += size.at(ry);
            return;
        }
    }
    
    bool same(int x, int y){
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    
    int get_size(int x){
        return size.at(root(x));
    }
};

int main()
{
    ll i,j;
    ll n, q;
    cin >> n >> q;
    UnionFind uf(n);
    rep(i,q){
        ll c;
        cin >> c;
        ll u,v;
        cin >> u >> v;
        if(c) cout << uf.same(u, v) << endl;
        else uf.unite(u,v);
    }

    return 0;
}

Measured memory_bytes: 4808
import sys
def main():
  n, *lst = map(int, sys.stdin.read().split())
  a = lst[:n+1]
  b = lst[n+1:]
  res = 0
  for i in range(n):
    if i == 0:
      tmp = min(a[i], b[i])
      res += tmp
      b[i] -= tmp
    else:
      tmp = min(a[i], b[i] + b[i - 1])
      res += tmp
      b[i] -= min(b[i], max(tmp - b[i - 1], 0))
  res += min(a[n], b[n - 1])
  print(res)


if __name__ == '__main__':
  main()

Measured memory_bytes: 25508
#include<stdio.h>
int main(void){
int h1,m1,h2,m2,k;
  scanf("%d%d%d%d%d",&h1,&m1,&h2,&m2,&k);
  int a=h2*60+m2-h1*60-m1;
  printf("%d",a-k);
  return 0;
}

Measured memory_bytes: 1732
/*
ID: Trump
TASK: 
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double lb;
//#define MARK
const ll losn=1e6+5;
const ll maxn=1e5+5;
const ll minn=1e3+5;
const ll tiny=1e2+5;
const ll inf=1e9;
const ll mod=1e9+7;
const ll hmod=4698571;
ll u[11],v[11];
ll tot=0;
ll mods=998244353;
ll tree[(maxn*2)<<2];

void push_up(ll rt){
	tree[rt]=tree[rt<<1]+tree[rt<<1|1];
	tree[rt]%=mods;
}

void build(ll l,ll r,ll rt){
	if(l==r){
		return ;
	}
	ll mid=(l+r)>>1;
	if(l<=mid){
		build(l,mid,rt<<1);
	}
	if(r>mid){
		build(mid+1,r,rt<<1|1);
	}
	push_up(rt);
}

ll query(ll a,ll b,ll l,ll r,ll rt){
	if(a<=l && r<=b){
		return tree[rt]%mods;
	}
	ll mid=(l+r)>>1;
	ll sums=0;
	if(a<=mid){
		sums+=query(a,b,l,mid,rt<<1);
	}
	if(b>mid){
		sums+=query(a,b,mid+1,r,rt<<1|1);
	}
	sums%=mods;
	push_up(rt);
	return sums;
}

void update(ll x,ll sums,ll l,ll r,ll rt){
	if(l==r){
		tree[rt]=sums;
		return ;
	}
	ll mid=(l+r)>>1;
	if(x<=mid){
		update(x,sums,l,mid,rt<<1);
	}
	if(x>mid){
		update(x,sums,mid+1,r,rt<<1|1);
	}
	push_up(rt);
}

int main(){
//#ifdef MARK
//    freopen("input.in", "r", stdin);
//    freopen("ouput.out", "w", stdout);
//    freopen("input.in", "r", stdin);
//    freopen("ouput.out", "w", stdout);
//#endif
	ll n,k;
	cin>>n>>k;
	for(ll i=1;i<=k;i++){
		cin>>u[i]>>v[i];
	}
	update(1,1,1,n,1);
	for(ll i=2;i<=n;i++){
		ll sums=0;
		for(ll j=1;j<=k;j++){
			if(u[j]>=i) continue;
			ll a=i-u[j],b=max((ll)1,i-v[j]);
			if(a>=1 && b>=1 && b<=a){
				sums+=query(b,a,1,n,1);
				sums%=mods;
			}
		}
		update(i,sums,1,n,1);
	}
	cout<<query(n,n,1,n,1)%mods<<endl;
	return 0;
}

Measured memory_bytes: 7736
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int a,v,b,w,t; cin >> a>>v>>b>>w>>t;
    if(w>=v){coutN; return 0;}

    if(abs(max(a,b)-min(a,b))<=t*(v-w)) coutY;
    else coutN;
}

Measured memory_bytes: 3640
#include <stdio.h>

int main(void)
{
        int x,a,b;
        int diffa,diffb;
        scanf("%d %d %d",&x,&a,&b);

        if(x >a){
                diffa = x-a;
        }else{
                diffa = a-x;
        }

        if(x>b){
                diffb = x-b;
        }else{
                diffb =b-x;
        }

        if(diffa >= diffb){
                printf("B");
        }else{
                printf("A");
        }
        return 0;
}


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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int tc; cin>>tc; while(tc--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
long long MOD = 1e9 + 7;
double PI = 4*atan(1);


ll poow( ll n, ll e)
{
    ll ans= 1;

    for(int i=1; i<=e; i++)
    {
        ans*= n;
        ans%= MOD;
    }
    return ans%MOD;
}

int main()
{
    optimize();

    long long n;

    cin>> n;

    ll res= poow(10LL, n ) % MOD;
    res-= (2 * (poow( 9LL, n)- MOD) );
    res%= MOD;
    res+= ( poow (8LL, n));   ////subtracting the overlap to prevent double counting [minus* minus= plus]
    res%= MOD;
    cout << res;
    nl;

    return 0;
}



//∣AUB∣ = ∣A∣ + ∣B∣ − ∣A∩B∣ //subtracting the overlap to prevent double counting
//
//A = Set of sequences that does not contain 0
//
//B = Set of sequences that does not contain 9
//
//n(A) = n(B) = pow(9,n)
//
//n(A intersection B) = pow(8,n)




Measured memory_bytes: 3660
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        int t = sc.nextInt();
        int s = sc.nextInt();
        
        if (d<=t*s) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 35848
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(ll i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define RES(a,i,j) a.resize(i);rep(ii,i)a[ii].resize(j); 
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout<<a<<" "<<b<<" "<<c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 
#define gre(n) greater<n>()

typedef long long ll;
//
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const double dINF = 1000000000;
const ll INF64 = 922337203685477580ll;
//const ll MOD = 1000000007ll;
const ll MOD = 998244353ll;
const dou pi=3.141592653589793;

//メモ
//二次元配列のresizeのしかた
//vv.resize(n);
//for(size_t i=0; i<n; i++){
// vv[i].resize(n);
//}

//メモ
//負の辺を持つ最短経路問題では到達不可経路でも初期化値より小さくなりうるので注意しよう
int main(){
    int n;
    std::cin >> n;
    std::vector<pair<dou,dou>> a(n);
    rep(i,n){
        std::cin >> a[i].fi>>a[i].se;
    }
    sort(all(a));
    dou ans=0;
    do{
        rep(i,n-1){
            ans+=sqrt(pow(a[i+1].fi-a[i].fi,2)+pow(a[i+1].se-a[i].se,2));
        }
    }while(next_permutation(all(a)));
    rrep(i,2,n+1){
        ans/=i;
    }
    std::cout <<keta(10)<< ans << std::endl;
}



Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <math.h>
#include <climits>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <map> 
#include <set>
#include <string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
const ll MD = 1000000007;

/* sample input

*/

int main()
{
	int n;
	int a[100];

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a, a + n, greater<int>());
	int numa=0, numb = 0;

	int pos = 0;

	while (pos <= n - 1) {
		if (pos % 2 == 0) {
			numa += a[pos];
		}
		else {
			numb += a[pos];
		}
		pos++;
	}

	cout << numa - numb << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void){
  char s[100];
  char p[100];
  int slen,plen,i,j,k,count  ;

  scanf("%s",s);
  scanf("%s",p);
  slen=strlen(s);
  plen=strlen(p);

  for(i=0;i<slen;i++){
    if(s[i]==p[0]){
      count=1;
      k=i;
      for(j=1;j<=plen;j++){
	if(k==slen-1){
	  k=-1;
	}
	if(s[++k]==p[j]){
	  count++;
	}
      }
    }
    if(count==plen){
      puts("Yes");
      break;
    }
  }

  if(count!=plen){
    puts("No");
  }

  return 0;

}

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

using namespace std;

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

  vector<int> xs(m), ys(m);
  for (int i = 0; i < m; ++i) {
    cin >> xs[i] >> ys[i];
    --xs[i], --ys[i];
  }

  vector<bool> visited(n);
  vector<int> counts(n, 1);
  visited[0] = true;

  for (int i = 0; i < m; ++i) {
    --counts[xs[i]];
    visited[ys[i]] = visited[ys[i]] || visited[xs[i]];
    if (counts[xs[i]] == 0) {
      visited[xs[i]] = false;
    }
    ++counts[ys[i]];
  }


  int ans = 0;
  for (auto&& e : visited) {
    if (e) {
      ++ans;
    }
  }

  cout << ans << endl;

  return 0;
}


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

const int MOD = 1e9+7;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);

  int n;
  cin >> n;
  vector<long long> arr(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  long long res = 0;
  long long power_of_two = 1;
  for (int i = 0; i < 60; ++i) {
    long long one = 0;
    for (long long &element : arr) {
      if (element % 2 == 1) {
        one++;
      }
      element /= 2;
    }
    long long presolve = (power_of_two * one) % MOD;
    res += (presolve * (n - one)) % MOD;
    res %= MOD;
    power_of_two = (power_of_two * 2) % MOD;
  }
  cout << res << endl;
}


Measured memory_bytes: 2560
N = int(input())
A = [int(i) for i in input().split()]
Q = int(input())
M = [int(i) for i in input().split()]
dp = [[-1] * (max(M) + 1) for _ in range(N + 1)]

def rec(i, m):
    if m == 0:
        return True
    if i >= N or m < 0:
        return False
    if dp[i][m] != -1:
        return dp[i][m]
    res = rec(i + 1, m) or rec(i + 1, m - A[i])
    dp[i][m] = res
    return res


for m in M:
    print('yes' if rec(0, m) else 'no')


Measured memory_bytes: 5964
import collections
n,m = map(int, raw_input().split(' '))
s,t = map(int, raw_input().split(' ')), map(int, raw_input().split(' '))
dp,prefix = [[0 for j in range(len(t))] for i in range(len(s))], [[0 for j in range(len(t))] for i in range(len(s))]
total = 1
mod = (10 ** 9) + 7
for ii in range(len(s)):
	for jj in range(len(t)):
		if s[ii] == t[jj]:
			dp[ii][jj] = 1+ (prefix[ii-1][jj-1] if ii-1>=0 and jj-1>=0 else 0)
			total += dp[ii][jj]
			total %= mod
		prefix[ii][jj] += prefix[ii - 1][jj] if ii - 1 >=0 else 0
		prefix[ii][jj] += prefix[ii][jj - 1] if jj - 1 >=0 else 0
		prefix[ii][jj] -= prefix[ii - 1][jj - 1] if (jj - 1 >=0) and (ii-1) >=0 else 0
		prefix[ii][jj] += dp[ii][jj]
		prefix[ii][jj] %= mod
		
print total


Measured memory_bytes: 95004
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

int main() {
  ll n; cin >> n;
  vector <ll> v(n);
  rep(i, n) cin >> v.at(i);
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  ll res = 0;
  for (ll i = 0; i < n; i++) {
    for (ll j = i+1; j < n; j++) {
      for (ll k = j+1; k < n; k++) {
        if (v.at(i)!=v.at(j) && v.at(j)!=v.at(k)) {
          if (v.at(i) < v.at(j)+v.at(k)) res++;
        }
      }
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
#include <vector>
using namespace std;
int main() {
	double n, m;
	for (int h = 0; h < 5; h++) {
		cin >> n >> m; long long a, b, ans = 0;
		int aa[12345] = { 0 }, bb[12345] = { 0 }, test[501] = { 0 }, uiop[501] = { 0 };
		if (n == 0 && m == 0) { cin >> n; return 0; }
		for (int i = 0; i < m; i++) {
			cin >> a >> b;
			aa[i] = a; bb[i] = b;
			if (a == 1) { test[b] = 1; uiop[b] = 1; ans++; }
		}
		for (int i = 0; i < m; i++) {
			if (test[aa[i]] == 1 && uiop[bb[i]] == 0) { uiop[bb[i]] = 1; ans++; }
			if (test[bb[i]] == 1 && uiop[aa[i]] == 0) { uiop[aa[i]] = 1; ans++; }
		}
		cout << ans - 1 << endl;
	}
	cin >> n;
}


Measured memory_bytes: 3300
#include<iostream>
#include<stdio.h>
#include<vector>
#include<stdlib.h>
#include<algorithm>
#include<string>
#include<string.h>
#include<queue>
using namespace std;
int main(){
  long long n,m;
  cin >> n >> m;
  cout << min(n,m/2)+max((long long)0,m-2*n)/4 << endl;
  return 0;
}

Measured memory_bytes: 256
import queue

a_cards = input()
b_cards = input()
c_cards = input()

a_c = list(a_cards)
b_c = list(b_cards)
c_c = list(c_cards)

a_que = queue.Queue()
b_que = queue.Queue()
c_que = queue.Queue()

for num in range(len(a_c)):
    a_que.put(a_c[num])

for num in range(len(b_c)):
    b_que.put(b_c[num])

for num in range(len(c_c)):
    c_que.put(c_c[num])




x = a_que.get()

while True:
    if x == 'a':
        if a_que.empty():
            answer = 'A'
            break
        x = a_que.get()
    elif x == 'b':
        if b_que.empty():
            answer = 'B'
            break
        x = b_que.get()
    else:
        if c_que.empty():
            answer = 'C'
            break
        x = c_que.get()

print(answer)
 

Measured memory_bytes: 9424
#include <iostream>
using namespace std;
int main(){
long long n,d,count=0;
cin>>n>>d;
while(n--){
    long long a,b;
    cin>>a>>b;
    long long c = ((a*a)+(b*b));

    if(c<=d*d) count ++;
}
cout<<count;
return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i,a,b) for(register int i=a;i<=b;++i)
#define rpd(i,a,b) for(register int i=a;i>=b;--i)
#define rep1(i,x) for(register int i=head[x];i;i=nxt[i])
typedef long long ll;
const int N=1e5+5;
using namespace std;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
struct data{int l,r;}a[N];
int n,L1,R1,L2,R2;
int work(int L1,int R1,int L2,int R2,int l,int r){
	L1=max(L1,L2);R1=min(R1,R2);
	return max(0,R1-L1+1)+max(0,r-l+1);
}
bool cmp(data i,data j){return i.l<j.l;}
int main(){
	n=read();rep(i,1,n)a[i].l=read(),a[i].r=read();
    sort(a+1,a+n+1,cmp);
	L1=a[1].l;R1=a[1].r;
	L2=a[2].l;R2=a[2].r;
	rep(i,3,n){
		int l=a[i].l,r=a[i].r;
		int ans1=work(L1,R1,l,r,L2,R2);
		int ans2=work(L2,R2,l,r,L1,R1);
		int ans3=work(L1,R1,L2,R2,l,r);
		if(ans1>=ans2){
			if(ans1>ans3)L1=max(L1,l),R1=min(R1,r);
			else L1=max(L1,L2),R1=min(R1,R2),L2=l,R2=r;
		}
		else{
			if(ans2>=ans3)L2=max(L2,l),R2=min(R2,r);
			else L1=max(L1,L2),R1=min(R1,R2),L2=l,R2=r;
		}
	}
	printf("%d\n",max(0,R1-L1+1)+max(0,R2-L2+1));
	return 0;
}

Measured memory_bytes: 1024
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        a: u64, b: u64, c: u64, d: u64,
    }
    print!("{}",
        std::cmp::max(a*b,c*d));
}


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

using namespace std;
using ll =long long;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;

const ll oo =0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-9;

#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORD(i,a,b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

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

    bool result = true;
    if (sz(t) <= sz(s)) {
        result = false;
    } else {
        FOR(i, 0, sz(s)) {
            if (s[i] != t[i]) {
                result = false;
                break;
            }
        }
    }

    if (result) cout << "Yes" << endl;
    else cout << "No" << endl;
} //cin.tie(0) bei schnellem Wechseln



Measured memory_bytes: 3640
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

namespace TOPSIC
{
	public class Program
	{
		public static void Main()
		{
			var n = int.Parse(ReadLine());
			var list = ReadLine().Split().Select(x => int.Parse(x)).ToList();

			for(int i = 0; i<n; i++)
			{
				list[i] -= i + 1;
			}
			list.Sort();
			var p = (n - 1) / 2;
			var q = (n - 0) / 2;
			var m = (list[p] + list[q]) / 2;
			var answer = list.Sum(x => (long)Math.Abs(x - m));
			
			WriteLine(answer);
		}
	}
}

Measured memory_bytes: 28892
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>
#include <fstream>
#include <bitset>
#include <ctime>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

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, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)
        n = a;
    if (n > b)
        n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i != 1 && i * i != n) {
                ret.push_back(n / i);
            }
        }
    }
    return ret;
}

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

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

struct ToUpper {
    char operator()(char c) { return toupper(c); }
};

struct ToLower {
    char operator()(char c) { return tolower(c); }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<pair<int, int>> X(N);
    cin >> X;

    vector<int> p(N);
    REP(i, N)
    p[i] = i;

    int c = 0;
    double ans = 0.0;
    do {
        double len = 0.0;
        REP(i, N - 1) {
            double x = X[p[i + 1]].first - X[p[i]].first;
            double y = X[p[i + 1]].second - X[p[i]].second;
            len += sqrt(x * x + y * y);
        }
        c++;
        ans += len;
    } while (next_permutation(p.begin(), p.end()));

    ans /= c;
    cout << ans << endl;
    return 0;
}

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

int main() {
  int n, t, a, h;
  cin >> n >> t >> a;
  int res,diff;
  int min = 1e6;
  
  for (int i=0; i<n; i++){
    cin >> h;
    
    diff = abs(1000*a - 1000*t + 6*h);
    if (min > diff){
      min = diff;
      res = i;
    }
  }
  
  cout << res + 1 << endl;
  
}

Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}





int main() {

	ll N, x = 0, an = 0;
	string S;
	cin >> N >> S;
	rep(i, N) {
		if (S.at(i) == 'I') {
			x++;
			an = max(an, x);
		}
		else {
			x--;
		}
	}
	cout << an << endl;
}


Measured memory_bytes: 256
/**************
*	Allocation
*************/

#include <iostream>
#include <vector>	//??£?¨?
#include <numeric>	//??¢??°
#include <algorithm>
using namespace std;

//??\???
vector<int> getLoadList(int n)//??????????????°
{	
	vector<int>loadList(n);//?????????
	
	for(int i=0; i<n; i++){
		cin >> loadList[i];
	}
	return loadList;//????????????
}

	//??????
bool check(vector<int>loadList, int k, int minP){
	int truck=1; 
	int sum  =0;
	for(int i=0; i< loadList.size(); i++){
		
		if(minP < (sum + loadList[i])){//
			truck ++;
			sum = 0 ;//??????????????????
		}
		sum += loadList[i];
	}
	if(k < truck){
		//????????????????????????????????????????????????????????£??????
		return false;
	}
	return true;
}

int main()
{
	//???????????°n??¨?????????????????°k??????????????????
	int n;
	cin >> n;
	
	int k;
	cin >> k;
	
	//?????????????????°??§??????????????????????????????
	vector<int> loadList = getLoadList(n);
	
	//?????????????±???????
	int minP = accumulate(loadList.begin(),loadList.end(),0)/n-1; 
	//?????????????????§??????
//	int minP = aveload+1;
	
	//minP????????§???????´???\???
	int max =(*max_element(loadList.begin(), loadList.end()));
	int maxP = ((double) n/k)*max;
	
	//?????????????????????????????¢??°???????????????????????°??????????????°??????????????????
	while((minP+1) != maxP){
	
		int p = (maxP+minP)/2;
		
		
		if( (p >= max) && (check(loadList, k, p ))){
			maxP = p;
		}else{
			minP = p;
		}
	}
	
	//?????§????????? P???????°?????????????
	cout << maxP << endl;
	
	return 0;
}

Measured memory_bytes: 1800
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>

const int INT_INF = 1000000000;                 // 10^9
const long long LONG_INF = 1000000000000000000; // 10^18

using namespace std;

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

    int ans = a - b * 2;
    if (ans < 0)
        ans = 0;

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

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H = INT()

print(sum([2**i for i in range(len("{:b}".format(H)))]))

Measured memory_bytes: 59736