akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main(){
    long sum = 0;
    string s;
    cin >> s;
    for(int bit = 0; bit < (1 << (s.length() - 1)); bit++){
        long tmp = 0;
        for(int i = 0; i < (s.length()); i++){
            tmp += (int)(s[i] - '0');
            if (bit & (1 << i) || i+1 == s.length()){
                sum += tmp;
                tmp = 0;
            }else{
                tmp = tmp*10;
            }
        }
    }
    cout << sum << '\n';
}

Measured memory_bytes: 256
import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		String s = sc.next();

		if(a>=3200)
		{
			System.out.println(s);
		}
		else if(a<3200)
			System.out.println("red");
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n;
	ll m;
	scanf("%lld%lld",&n,&m);
	int n2=sqrt(n);
	int flag=0;
	ll res=-1;
	if(n==m)
	{
		res=n+1;
		flag=1;
	}
	for(int i=2;i<=n2;i++)
	{
		
		ll ans=0;
	        ll k=n;
		while(k)
		{
			ans+=(k%i);
			k/=i;
		}
		if(ans==m)
		{
			flag=1;
			res=i;
			break;
		}
	}
//	printf("**%lld**\n",res);
	if(!flag) 
	{
		ll o=n-m;
		int o2=sqrt(o);
	//	printf("%lld\n",o);
		for(int i=1;i<=o2;i++)
		{
			if(o%i==0)
			{
				ll k=o/i+1;
			//	printf("%lld\n",k);
				ll x=n/k;
				ll y=n%k;
				if(x+y==m)
				{
					res=k;
					flag=1;
				}
			}
		//	printf("**%lld**\n",res);
		}
	}
	printf("%lld\n",res);
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        int mod = 1_000_000_007;
        long[][] dp = new long[N+1][K+1];
        int[] a = new int[N];
        for (int i=0;i<N;i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        dp[0][0] = 1;
        for (int i=0;i<N;i++) {
            for (int j=0;j<K+1;j++) {
                long tmp = 0;
                // for (int k=Math.max(0, j-a[i]);k<=j;k++) {
                //     tmp = (tmp+dp[i][k])%mod;
                // }
                if (j-1>=0) tmp = (tmp+dp[i+1][j-1])%mod;
                tmp = (tmp+dp[i][j])%mod;
                if (j-a[i]-1>=0) tmp -= dp[i][j-a[i]-1];
                if (tmp<0) tmp+=mod;
                dp[i+1][j] = tmp;
            }
        }
        System.out.println(dp[N][K]);
    }
}

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

using namespace std;

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

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}
string code(const string& s, ll k) {
    string res = "";
    res += s[0];
    rep(i, 1, s.size()) {
        if (res.size() >= k) return res;
        switch (s[i-1]) {
        case 'a':
        case 'i':
        case 'u':
        case 'e':
        case 'o':
            res += s[i];
        }
    }
    return res;
}
ll solve(const ll n) {
    vector<string> s(n); cin >> s;
    rep(i, 1, 60) {
        set<string> codes;
        rep(j, n) codes.insert(code(s[j], i));
        if (codes.size() == n) return i;
    }
    return -1;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    while (cin >> n, n) {
        cout << solve(n) << endl;
    }
}

Measured memory_bytes: 3212
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    string S1, S2;
    cin >> S1 >> S2;
    
    int dp[1001][1001];
    
    dp[0][0] = 0;
    for(int i = 0; i <= S1.size(); i++) dp[i][0] = i;
    for(int j = 0; j <= S2.size(); j++) dp[0][j] = j;
    
    for(int i = 0; i < S1.size(); i++){
        for(int j = 0; j < S2.size(); j++){
            dp[i+1][j+1] = min(dp[i+1][j]+1, dp[i][j+1]+1);
            if(S1[i] == S2[j]) dp[i+1][j+1] = min(dp[i][j], dp[i+1][j+1]);
            else dp[i+1][j+1] = min(dp[i][j]+1, dp[i+1][j+1]);
        }
    }
    
    cout << dp[S1.size()][S2.size()] << endl;
    return 0;
}



Measured memory_bytes: 7092
#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>;

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

const long long INF = 1LL << 60;
const long long mod = 1000000007;


int main(void){
    int n;cin >> n;
    int ans=0;
	for(int i=0;i<=n;i++){
	int keta=0;
	int k=i;
      while( k != 0 ){
	    k = k/10;
	    keta++;
      }
	if(keta%2==1)ans++;
    
    }
  	cout << ans << endl;
    return 0;
}


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

# define mp make_pair
# define pb push_back
# define PI acos(-1)
# define ff first 
# define ss second 
# define endl '\n'
# define vt vector
# define all(c) (c).begin(), (c).end()
# define rep(i,a,b) for(int i = a ; i < b ; ++i)

typedef long long ll ; 
typedef long double ld ; 
typedef pair<int,int> pii ; 
typedef pair<ll,ll> pll ;

template<class T> bool umin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool umax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

const int MOD = 1e9+9 ;
const ll inf = 1e18 ;  
const ll mod = 1e9+7 ;  

ll nCr(ll n,ll r){ll t=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){t*=(n-i);t/=(i+1);}return t;}
ll power(ll a, ll n) { ll r=1;while(n){if(n&1)r=(r*a)%MOD;n>>=1;a=(a*a)%MOD;}return r%MOD;}



vt<pii> dir =  {{-1,0} , {1, 0} , {0,-1} , {0,1}} ; 

// ==========Start Here==============



int main() 
{ 
	int n ; 
    cin >> n ; 
    vt<ll> a(n-1) ; 
    ll sum = 0 ;  
    rep(i,0,n-1) {
        cin >> a[i] ; 
    }
    sum += a[0] ;
    int tmp = 1e9+1 ; 
    rep(i,1,n-1) {
        sum += min(a[i],a[i-1]) ; 
    }
    cout << sum + a[n-2] ; 
    return 0; 
} 

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define oo 0x3f3f3f3f

ll C[5005];
ll P[5005];

ll dp[32][5005];
ll up[32][5005];

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll n,k;
    cin>>n>>k;
    for(int i=1; i<=n; i++)cin>>P[i];
    for(int i=1; i<=n; i++)cin>>C[i];

    for(int i=1; i<=n; i++)
    {
        up[0][i]=P[i];
        dp[0][i]=C[P[i]];
    }

    for(int j=1; j<=31; j++)
    for(int i=1; i<=n; i++)
    {
        dp[j][i] = dp[j-1][i] + dp[j-1][up[j-1][i]];
        up[j][i] = up[j-1][up[j-1][i]];
    }

    ll res = LLONG_MIN;

    for(int i=1; i<=n; i++)
    {
        ll c = 0;
        ll left = k;
        int pos = i;

        int z = 0;
        while(left > 0 && z < n)
        {
            z++;
            left--;
            pos = P[pos];
            c += C[pos];
            res=max(res, c);
        }

        for(int j=31; j>=0 && left > n; j--)
            while((1LL << j) <= left && left - (1LL << j) > n){
                left -= (1LL << j);
                c += dp[j][pos];
                res = max(res, c);
                pos = up[j][pos];
            }

        while(left > 0)
        {
            left--;
            pos = P[pos];
            c += C[pos];
            res=max(res, c);
        }
    }

    cout<<res;
}


Measured memory_bytes: 6232
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main(){

	int stack[100];
	int i=0, tmp;
	char str[100];
	while(scanf("%s",str)!=EOF){
		if(str[0]=='+'){
			stack[i-2]+=stack[i-1];
			i--;
		}else if(str[0]=='-'){
			stack[i-2]-=stack[i-1];
			i--;
		}else if(str[0]=='*'){
			stack[i-2]*=stack[i-1];
			i--;
		}else{
			tmp=atoi(str);
			stack[i]=tmp;
			i++;
		}
	}
	printf("%d\n",stack[0]);
	return 0;
}

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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll n,x,t;
	cin>>n>>x>>t;
	cout<<((n+x-1)/x)*t<<'\n';
	return 0;
}


// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""
 


Measured memory_bytes: 3616
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,d,x;cin>>n>>d>>x;
  int ans=0;
  FOR(i,0,n){
    int a;cin>>a;
    int t=1;
    while(t<=d){
      ans++;
      t+=a;
    }
  }
  cout<<ans+x<<endl;
  return 0;
}

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

int main()
{
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i < n + 1; i++)
    {
        ll a = i;
        ll keta = 0;
        while (a != 0)
        {
            a /= 10;
            keta++;
        }
        if (keta % 2 != 0)
        {
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <queue>
using namespace std;
typedef long long ll;

char s[110][110];
int v[110][110];
int n,m;

void dfs(int x,int y,char c)
{
	v[x][y] = 1;
	int i,nx,ny;
	int xx[] = {0,0,1,-1};
	int yy[] = {1,-1,0,0};

	for(i = 0;i < 4;i++){
		nx=x+xx[i],ny=y+yy[i];
		if(nx>=0 && nx<n && ny>=0 && ny<m && s[nx][ny] == c && !v[nx][ny]){
			v[nx][ny] = 1;
			dfs(nx,ny,c);
		}
	}
}

int main()
{
	while(cin >> n >> m && n+m){
		memset(v,0,sizeof(v));
		int ans = 0,i,j,k;
		for(i = 0;i < n;i++)
			for(j = 0;j < m;j++)
				cin >> s[i][j];
		char c[]={'#','*','@'};
		for(k = 0;k < 3;k++)
		for(i = 0;i < n;i++)
			for(j = 0;j < m;j++)
				if(s[i][j] == c[k] && !v[i][j]){
					v[i][j] = 1;
					dfs(i,j,c[k]);
					ans++;
				}
				cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 4248
N,K = map(int,input().split())
h = [0] + list(map(int,input().split()))

dp = [0] * (N+1)

for i in range(2,N+1):
    scope = min(i-1,K)
    jump = [dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,scope+1)]
    dp[i] = min(jump)

print(dp[N])

Measured memory_bytes: 52960
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
using namespace std;

int main(){
	string str;
	string max_len_str;
	string most_many_str;
	int most=-1;
	int i;
	vector<pair<string, int> > v;
	string::iterator vi;
	cin>>str;
	v.push_back(pair<string, int>(str, 0));
	max_len_str == v[0].first;
	while(cin>>str){
		for(i=0;i<v.size();i++){
			if(v[i].first == str){
				v[i].second++;
				break;
			}
		}
		if(i==v.size()){
			if(max_len_str.size() < strlen(str.c_str())){
				max_len_str = str;
			}
			v.push_back(pair<string, int>(str, 0));
		}
	}
	for(i=0;i<v.size();i++){
		if(most < v[i].second){
			most = v[i].second;
			most_many_str = v[i].first;
		}
	}
	cout << most_many_str << " " << max_len_str << endl;
	
	return 0;
}

Measured memory_bytes: 1200
public class Main {
	public static void main(String[] args) {
		var sc = new java.util.Scanner(System.in);
		var n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		long cnt = 0;
		long tmpMax = a[0];
		for (int i = 1; i < n; i++) {
			if (tmpMax > a[i]) {
				cnt += tmpMax - a[i];
			} else {
				tmpMax = a[i];
			}
		}
		System.out.println(cnt);
	}
}


Measured memory_bytes: 62604
#include<bits/stdc++.h>
#define up(j,k,i) for(ll i=j;i<k;i++)
#define down(j,k,i) for(ll i=j;i>k;i--)
#define M 1000000007
#define pp(n) printf("%lld\n",ll(n))
#define ps(n) printf("%lld ",ll(n))
#define pd(x,y) printf("%lld %lld\n",ll(x),ll(y))
#define is(n) scanf("%lld",&n)
#define inf LLONG_MAX
#define id(n,m) scanf("%lld%lld",&n,&m)
#define it(n,m,k) scanf("%lld%lld%lld",&n,&m,&k)
#define pb push_back
#define F first
#define S second
#define pll pair<ll,ll> 
#define db cout<<"######\n"
#define null(a) memset(a,0,sizeof(a))
#define neg(a) memset(a,255,sizeof(a))
typedef long double ld;
typedef long long int ll;
using namespace std;
ll i,j,k,z,t,n,m,sum,ans,x,y,maxm=0,minm=inf; bool flag;
void solve(ll x,ll n)
{
	if(n==0)
	{
	
		minm=min(minm,x); return;
	
	}
	
	solve(x+k,n-1); solve(2*x,n-1);
}
int main()
{
	id(n,k);
	
	solve(1,n);
	
	pp(minm);
}


Measured memory_bytes: 256
package main
import (
  "fmt"
  // "math"
)

func main() {
  var (
    S string
  )
  fmt.Scan(&S)

  if S[0] == S[1] && S[1] == S[2] {
    fmt.Println("Yes")
  } else if S[1] == S[2] && S[2] == S[3] {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e9 + 7;

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

  ll n, x;
  cin >> n >> x;

  ll a[n], s[n];
  REP(i, n){
    cin >> a[i];
    s[i] = a[i];
  }

  ll ans = 1e15, rec;
  REP(i, n){
    rec = i * x;
    REP(j, n){
      s[j] = min(s[j], a[(j - i + n) % n]);
      rec += s[j];
    }
    ans = min(ans, rec);
  }

  cout << ans << endl;

  return 0;
}


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

typedef pair<int, int> P;

int h, w, s;
int allsum;
int u[32][32];
int psum[33][33];
int sum[32][32][32][32];
P dp[32][32][32][32];

P dfs(int ly, int lx, int hy, int hx){
    if(dp[ly][lx][hy][hx].first != 0){
        return dp[ly][lx][hy][hx];
    }

    P res = P(1, s - (allsum - sum[ly][lx][hy][hx]));

    for(int i=ly; i<hy; i++){
        if(allsum - sum[ly][lx][i][hx] > s) continue;
        if(allsum - sum[i+1][lx][hy][hx] > s) continue;


        P a = dfs(ly, lx, i, hx);
        P b = dfs(i+1, lx, hy, hx);
        P ab = P(a.first + b.first , min(a.second, b.second));
        res = max(res, ab);
    }

    for(int i=lx; i<hx; i++){
        if(allsum - sum[ly][lx][hy][i] > s) continue;
        if(allsum - sum[ly][i+1][hy][hx] > s) continue;

        P a = dfs(ly, lx, hy, i);
        P b = dfs(ly, i+1, hy, hx);
        P ab = P(a.first + b.first , min(a.second, b.second));
        res = max(res, ab);
    }

    return dp[ly][lx][hy][hx] = res;
}

int main(){
    while(1){
        allsum = 0;
        memset(psum, 0, sizeof(psum));
        memset(sum, 0, sizeof(sum));
        memset(dp, 0, sizeof(dp));

        cin>>h>>w>>s;
        if(h == 0) return 0;

        for(int i=0; i<h; i++){
            for(int j=0; j<w; j++){
                cin>>u[i][j];
                allsum += u[i][j];
            }
        }

        for(int i=0; i<h; i++){
            for(int j=0; j<w; j++){
                psum[i+1][j+1] = psum[i+1][j] + u[i][j];
            }
        }

        for(int i=0; i<w; i++){
            for(int j=0; j<h; j++){
                psum[j+1][i+1] += psum[j][i+1];
            }
        }

        for(int i=0; i<h; i++){
            for(int j=i; j<h; j++){
                for(int k=0; k<w; k++){
                    for(int l=k; l<w; l++){
                        sum[i][k][j][l] = psum[j+1][l+1] - psum[i][l+1] - psum[j+1][k] + psum[i][k];
                    }
                }
            }
        }

        P ans = dfs(0, 0, h-1, w-1);

        cout << ans.first << " " << ans.second << endl;
    }
}


Measured memory_bytes: 15380
#include <iostream>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define ul unsigned long long int 

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

	ul counts[5]={};
	char cur;
	string str;

	for (unsigned i=0;i<n;i++) {
		cin >> str;
		cur = str.c_str()[0];
		switch (cur) {
			case 'M':
				counts[0]++;
			break;
			case 'A':
				counts[1]++;
			break;
			case 'R':
				counts[2]++;
			break;
			case 'C':
				counts[3]++;
			break;
			case 'H':
				counts[4]++;
			break;
			default:
			
			break;
		}
	}

	ul total = 0;
	for (unsigned i=0;i<3;i++) {
		for (unsigned j=i+1;j<4;j++) {
			for (unsigned k=j+1;k<5;k++) {
				total += counts[i] * counts[j] * counts[k];
			}
		}
	}

	cout << total << endl;
	
	return 0;
}


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

int main(){
  int A,B,mx;
  
  cin >> A >> B;
  if(A == B){
    mx = 2*A;
  }else if(A < B){
    mx = B + B -1;
  }else if(A > B){
    mx = A + A - 1;
  }
  cout << mx << endl;
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  string s;
  bool cont = true;
  while(cont) {
    if (N >= 0) {
      int a = N % (- 2);
      string b = to_string(a);
      s = b + s;
      N /= -2;
    }
    else {
      int a = - (N % (- 2));
      string b = to_string(a);
      s = b + s;
      N = (N - a) / (- 2);
    }
    if (N == 0) {
      cont = false;
    }
  }
  cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll A,V,B,W,T; cin >> A >> V >> B >> W >> T;
  if((abs(B-A)/T)>V-W){
    cout << "NO" << endl;
    return 0;
  }
  if(abs(B-A)%T!=0 && abs(B-A)/T==V-W){
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl 	"\n"

typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())

#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))

int main()
{	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	
	ll n;
	cin>>n;
	string s;
	cin>>s;

	stack<char> st;
	st.push(s[0]);
	for(ll i=1; i<n; i++)
	{
		if(s[i]!= st.top())
			st.push(s[i]);
	}
	cout<<st.size();

	return 0;
}

Measured memory_bytes: 512
#!/usr/bin/env python3
n = int(input())
s = input()
white = sum([1 for i in s if i == "."])
ans = white#全部黒にするとき
l = 0 # i までのwhiteの数
for i in range(n):
    if s[i] == ".": l += 1
    #print(ans,i+white-2*l)
    ans = min(ans,i+1+white-2*l)
print(ans)

Measured memory_bytes: 52960
#include<bits/stdc++.h>
#define ll long long
#define rep(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
int main()
{
  int a,b[200],m;
  char s[200],t[200];
  cin >> a;
  rep(i,a)cin >> s[i];
  rep(i,a)b[i]=0;
  FOR(i,1,a){
    rep(l,a)t[l]=s[l];
    FOR(j,0,i){
      FOR(k,i,a){
        if(t[j]==t[k]){t[k]=0;
                       m=1;
                      }
      }
      if(m!=1){t[j]=0;
              }
      m=0;
    }
    FOR(j,0,i){if(t[j]!=0)b[i-1]++;
              }
  }
  sort(b,b+a-1);
  printf("%d",b[a-2]);  
}

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

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

  if (S == "hi" || S == "hihi" || S == "hihihi" || S == "hihihihi" ||
      S == "hihihihihi")
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

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

ll mod = 1e9+7;
ll a[50][50];
ll r[50][50];
ll r_[50][50];

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  ll n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      r[i][j] = i==j;
    }
  while (k) {
    if (k&1) {
      for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++) {
	  r_[i][j] = 0;
	  for (int k = 0; k < n; k++)
	    (r_[i][j] += r[i][k]*a[k][j]) %= mod;
	}
      for (int i = 0; i < n; i++)
	for (int j = 0; j < n; j++)
	  r[i][j] = r_[i][j];
    }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
	r_[i][j] = 0;
	for (int k = 0; k < n; k++)
	  (r_[i][j] += a[i][k]*a[k][j]) %= mod;
      }
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++)
	a[i][j] = r_[i][j];
    k >>= 1;
  }
  ll ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      (ans += r[i][j]) %= mod;
  cout << ans << endl;
}


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

#include <iostream>
#define pb push_back
#define sort_incr(v) sort(v.begin(),v.end());
#define sort_decr(v) {sort(v.begin(),v.end()); reverse(v.begin(),v.end());}
#define take_input(v,n) for(ll i=0,temp;i<n;i++){cin>>temp;v.pb(temp);}
#define fastio {ios_base::sync_with_stdio(false);    cin.tie(NULL);}
#define ALL(v) v.begin(),v.end()

typedef long long ll;
using namespace std; 



////*********           REMOVE DUPLICATES FROM VECTOR       **********///////


vector<int>  remove_duplicate_elements(vector<int> v)
{
    vector<int>::iterator ip;
    ip = unique(v.begin(), v.end()); 
    v.resize(std::distance(v.begin(), ip)); 
    return v;
}


//// **************                CONVERT STRING TO UNIQUE CHARACTERS              **************////                  
string make_unique_string(string s)
{
    string s1="";
    for(int i=0;i<s.length();i++)
    {
        bool flag=true;
        for(int j=0;j<s1.length();j++)
        {
            if(s1[j]==s[i])
            {flag=false;break;}
        }
        
        if(flag)
        s1=s1+s[i];
        
    }
    return s1;
}

//////// Three Element Vector 
struct vec_thre
{
    int first ,second,third;
};


/////// Comparing on sorting a vector


bool comp(vec_thre a , vec_thre b)
{
    if (a.first != b.first ) 
        return a.first < b.first; 
    if (a.second != b.second) 
            return a.second < b.second; 
}

/////////Sorting vector on the basis of second Element of vector 

bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 


// Driver function to sort the vector elements by  first element of pair in descending order, 
//if first is same than second is consdidered 
bool sortinrev(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 
    
        if(a.first!=b.first)
       return (a.first > b.first);
       
       return (a.second>b.second);

} 


int main() 
{
    char c;
    cin>>c;
    if(tolower(c)==c)
    {
        std::cout << "a" << std::endl;
    }
    else{
        cout<<"A";
    }
    
    
    return 0; 
} 
























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

const int N = (1e5) + 5;
char s[N];
char t[N];
const int ALPH = 26;
int nxt[N][ALPH];

void f(char s[], int n) {
  int lst[ALPH];
  for (int i = 0; i < ALPH; ++i) {
    lst[i] = nxt[n][i] = -1;
  }
  for (int i = n - 1; i >= 0; --i) {
    lst[s[i] - 'a'] = i + 1;
    for (int j = 0; j < ALPH; ++j) {
      nxt[i][j] = lst[j];
    }
  }
}

int main() { // claudio van
  scanf("%s", s);
  scanf("%s", t);
  int len_s = strlen(s);
  int len_t = strlen(t);
  f(s, len_s);
  ll ans = 0;
  int i = 0, prev_ind = 0;
  while (i < len_t) {
    int ind = nxt[prev_ind][t[i] - 'a'];
    if (ind != -1) {
      prev_ind = ind;
      ++i;
    } else {
      if (prev_ind == 0) {
        printf("-1\n");
        return 0;
      }
      prev_ind = 0;
      ans += len_s;
    }
  }
  ans += prev_ind;
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 10624
#include <iostream>

int main(){
	std::string m[3], w;
	while(std::cin >> m[0], m[0][0] != '0'){
		for(int i=1;i<3;i++)std::cin >> m[i];
		w = "NA";
		for(int i=0;i<3;i++){
			if(m[i][0] + m[i][1] - m[i][2] * 2 == 0 && m[i][0] - '+')w = m[i][0];
			if(m[0][i] + m[1][i] - m[2][i] * 2 == 0 && m[0][i] - '+')w = m[0][i];
		}
		if(m[0][0] + m[1][1] - m[2][2] * 2 == 0 && m[0][0] - '+')w = m[0][0];
		if(m[0][2] + m[1][1] - m[2][0] * 2 == 0 && m[0][2] - '+')w = m[0][2];
		
		std::cout << w << '\n';
	}
}

Measured memory_bytes: 0
#!/usr/bin/env python3
s = input()
n = len(s)
dp = {}
dp[(0, 1)] = 1
dp[(0, 2)] = 1
dp[(1, 2)] = dp[(0, 1)] + (s[0] != s[1])
dp[(1, 3)] = dp[(0, 1)] + 1
for i in range(2, n):
    for j in [1, 2]:
        dp[(i, i + j)] = 0
        for k in [1, 2]:
            now = s[i - k:i]
            nxt = s[i:i + j]
            dp[(i, i + j)] = max(dp[(i, i + j)], dp[(i - k, i)] + (now != nxt))
print(dp[(n - 1, n)])


Measured memory_bytes: 90092
use std::io;
use std::cmp;

// read a line(without line feed)
fn read_line() -> String {
    let mut in_str = String::new();
    io::stdin().read_line(&mut in_str).unwrap();
    return in_str.trim().to_string();
}

// read wods on a line
pub fn read_words_in_line() -> Vec<String> {
    let s = read_line();
    return s.split_whitespace().map(|x| x.to_string()).collect::<Vec<String>>()
}

// read type t on a line
pub fn read_t_in_line<T : std::str::FromStr>() -> Vec<T> {
    let mut v : Vec<T> = Vec::new();
    for e in read_words_in_line().iter().map(|x| x.parse::<T>()) {
        if let Ok(r) = e {
            v.push(r);
        }
        else{
            return Vec::new();
        }
    }
    return v;
}

// sort slice
pub fn sort<T : std::cmp::Ord>(slice : &mut [T]) {
    slice.sort();
}
// sort slice by reverse order
pub fn sort_rev<T : std::cmp::Ord>(slice : &mut [T]) {
    slice.sort_by(|x, y| y.cmp(x));
}

pub fn min<T : std::cmp::Ord>(a : T, b : T) -> T{
    return cmp::min(a, b);
}

pub fn max<T : std::cmp::Ord>(a : T, b : T) -> T{
    return cmp::max(a, b);
}


fn rec(i : i32, n : i32, k : i32) -> i32{
    if i == n {
        return 1;
    }
    let a = rec(i + 1, n, k);
    return cmp::min(a * 2, a + k);
}

fn main() {

    let n = read_line().parse::<i32>().unwrap();
    let k = read_line().parse::<i32>().unwrap();
    
    println!("{}", rec(0, n, k));

}


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

 
int main() {
    int n, x, t;
    cin >> n >> x >> t;
 
    int ans = (n+x-1)/x*t;
    cout << ans << endl;
}

Measured memory_bytes: 3596
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

int main(){
	ll n, temp, res=0, cnt=0,MAX=0;
	cin>>n;
	vector<ll> a(n);
	rep(i,n){
		cin>>a[i];
		MAX=max(a[i],MAX);
	}
	vector<ll> s(200001);
	rep(i,n){
		s[a[i]]++;
	}
	//自分を自分で消滅させることができる
	rep(i,MAX+1){
		if(s[i]>0){
			cnt++;
		}
		if(s[i]>1){
			if(s[i]%2==0){
				temp=1;
			}else{
				temp=0;
			}
		}
		if(res>temp){
			res-=temp;
		}else{
			res=temp-res;
		}
		temp=0;
	}

	if(cnt-res<1){
		cout<<1<<endl;
	}else{
		cout<<cnt-res<<endl;
	}
	
	return 0;
}














Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main(){
	string a, b, c;
	cin >> a >> b >> c;
	cout << a[0] << b[1] << c[2] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                    \
	sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(c i) \
	{
sim > struct rge
{
	c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifndef LOCAL
	~debug()
	{
		cerr << endl;
	}
	eni(!=) cerr << boolalpha << i;
	ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d)
{
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d)
{
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c &)
	{
		ris;
	}
#endif
}
;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define in insert
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define sz(v) (int)(v.size())
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define prec fixed << setprecision(12)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define test  \
	int t;    \
	cin >> t; \
	while (t--)
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;

const int mxn = 1e5 + 5;
int dp[mxn];

void solve()
{
	int n, m;
	cin >> n >> m;
	int x;
	rep(i, 0, m - 1) cin >> x, dp[x] = -1;
	dp[0] = 1;
	rep(i, 1, n)
	{
		if (dp[i] == -1)
			continue;
		if (dp[i - 1] != -1)
		{
			dp[i] = (dp[i] % mod + dp[i - 1] % mod) % mod;
		}
		if (i - 1 > 0 && dp[i - 2] != -1)
		{
			dp[i] = (dp[i] % mod + dp[i - 2] % mod) % mod;
		}
	}
	cout << dp[n];
}

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// test
	solve();
	return 0;
}


Measured memory_bytes: 4400
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int n,a[N],fa[N];
vector<int> e[N];
int L[N],R[N];
long long ans;
void dfs(int x){
    L[x]=R[x]=x;
    for (int i=0;i<e[x].size();i++){
        int v=e[x][i];
        dfs(v);
        L[x]=min(L[x],L[v]);
        R[x]=max(R[x],R[v]);
    }
    ans+=1ll*(x-L[x]+1)*(R[x]-x+1)*a[x];
}
int main()
{
    scanf("%d",&n);
    for (int i=1;i<=n;i++) scanf("%d",&a[i]);
    for (int i=1;i<=n;i++){
        int f=i-1,last=0;
        while (a[f]>a[i]) last=f,f=fa[f];
        if (last) fa[last]=i;
        fa[i]=f;
    }
    int root;
    for (int i=1;i<=n;i++)
        if (fa[i]) e[fa[i]].push_back(i);
            else root=i;
    dfs(root);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 26752
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int l = 0;
		int r = s.length - 1;
		int cnt = 0;
		while (l <= r) {
			if (s[l] == s[r]) {
				l++;
				r--;
			} else if (s[l] == 'x') {
				l++;
				cnt++;
			} else if (s[r] == 'x') {
				r--;
				cnt++;
			} else {
				cnt = -1;
				break;
			}
		}
		System.out.println(cnt);
	}
}


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

#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define mp make_pair

using namespace std;

using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvb = vector<vb>;

const int INF = 1e9;
const int MOD = 1e9+7;

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

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

    int N; cin >> N;
    vpi r(N), b(N);
    REP(i, N) cin >> r[i].second >> r[i].first;
    REP(i, N) cin >> b[i].first >> b[i].second;
    sort(ALL(r));
    sort(ALL(b));
    vb matched(N, false);
    int ans = 0;
    REP(i, N)
    {
        for(int j = N-1; j >= 0; j--)
        {
            if(b[i].first > r[j].second && b[i].second > r[j].first && !matched[j])
            {
                matched[j] = true;
                ans++;
                break;
            }
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<set>
#include<algorithm>
using namespace std;

int b[200000];
int c[200000];
int main() {
	int a;
	scanf("%d", &a);
	for (int d = 0; d < a; d++) {
		int e;
		scanf("%d", &e);
		b[d] = e;
	}
	int s = 0;
	set<int>t;
	for (int f = a - 2; f != -1; f--) {
		s = max(s, b[f + 1]);
		c[f] = s;
		t.insert(c[f] - b[f]);
	}
	auto q = t.end();
	q--;
	cout <<*q << endl;
}

Measured memory_bytes: 14052
#include<bits/stdc++.h>
#define ll long long int 
#define fori(i,n) for(i=0; i<n; i++)
#define ford(i,n) for(i=n-1; i>=0; i--)
#define vi vector<int> 
#define vs vector<string>
#define vll vector<ll>
#define di deque<int>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define pqi priority_queue<int>
#define pqll priority_queue<ll>
#define mod1 1000000007
#define mod2 998244353
#define pb push_back
#define fi first
#define se second

#define fast_cin() ios::sync_with_stdio(false); cin.tie(nullptr)

using namespace std;


int main(int argc, char const *argv[]){
    fast_cin();
	ll n,i;
	cin>>n;
	for(i=(int)sqrt(n); i>0; i--){
		if(n%i==0) break;
	}
	cout<<i + n/i -2<<"\n";
    return 0;
}



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

using ll = long long;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

ll cnt[26][100010];

int main(int argc, char **argv)
{
	string S; cin >> S;
	ll N = S.size();

	memset(cnt, 0, sizeof cnt);
	REP(i, N)
	{
		cnt[S[i] - 'a'][i+1] = 1;
	}

	REP(i, 26)
	{
		REP(n, N)
		{
			cnt[i][n+1] += cnt[i][n];
		}
	}

	// REP(i, 26)
	// {
	// 	REP(n, N+1)
	// 	{
	// 		std::cout << cnt[i][n] << " ";
	// 	}
	// 	std::cout << std::endl;
	// }

	ll ok{false};
	REP(c, 26)
	{
		REP(n, N-1)
		{
			if ((cnt[c][n] + 2 == cnt[c][n+1] + 1) &&
				(cnt[c][n+1] + 1 == cnt[c][n+2]))
			{
				std::cout << n+1 << " " << n+2 << std::endl;
				return 0;
			}
			if ((cnt[c][n] + 2 == cnt[c][n+1] + 1) &&
				(cnt[c][n+1] + 1 == cnt[c][n+2] + 1) &&
				(cnt[c][n+2] + 1 == cnt[c][n+3]))
			{
				std::cout << n+1 << " " << n+3 << std::endl;
				return 0;
			}
		}
	}
	
	std::cout << "-1 -1" << std::endl;
}


Measured memory_bytes: 20736
import java.awt.Event;
import java.awt.geom.Point2D;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.channels.FileChannel;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.IntStream;
 
public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
//		new TestA().doIt();
//		new TestB().doIt();
//		new TestC().doIt();
		new TestD().doIt();
	}
	class TestD{
		void doIt() {
			int N = sc.nextInt();
			int M = sc.nextInt();
			UnionFind uf = new UnionFind(N);
			for(int i = 0;i < M;i++) {
				int A = sc.nextInt() - 1;
				int B = sc.nextInt() - 1;
				uf.unionSet(A, B);
			}
			int MAX = 0;
			for(int i = 0;i < N;i++) {
				MAX = Math.max(MAX, uf.setSize[i]);
			}
			System.out.println(MAX);
		}
		class UnionFind{
			int[] p, rank, setSize;
			int numSets;
			
			public UnionFind(int N) {
				p = new int[numSets = N];
				rank = new int[N];
				setSize = new int[N];
				for(int i = 0;i < N;i++) {
					p[i] = i;
					setSize[i] = 1;
				}
			}
			
			int findSet(int i) {
				return p[i] == i ? i : (p[i] = findSet(p[i]));
			}
			
			boolean isSameSet(int i,int j) {
				return findSet(i) == findSet(j);
			}
			
			void unionSet(int i,int j) {
				if(isSameSet(i, j))return;
				numSets--;
				int x = findSet(i), y = findSet(j);
				if(rank[x] > rank[y]) {
					p[y] = x;
					setSize[x] += setSize[y];
				}else {
					p[x] = y;
					setSize[y] += setSize[x];
					if(rank[x] == rank[y])rank[y]++;
				}
			}
			
			int numDisjoinSets() {
				return numSets;
			}
			
			int sizeOfSet(int i) {
				return setSize[findSet(i)];
			}
		}
	}
}

Measured memory_bytes: 62576
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <cstring>

using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define FIND(x, target) find(x.begin(),x.end(),target)
#define pb(x) push_back(x)
#define output(x) cout<<x<<endl
#define ERASE(x, n) x.erase(x.begin(), x.begin()+n)
// #define int long long
#define P pair<int, int>
typedef long long ll;

const long long int MOD = 1e9+7;
const int INF = -1;
ll dp[100005][13];

signed main(void) {
	int A, B;
	cin >> A >> B;
	
	int max = A+B;
	if (max < A-B) {
		max = A-B;
	}

	if (max < A*B) {
		max = A*B;
	}
	cout << max << 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++)

int main() {
  long long A, B, K;
  cin >> A >> B >> K;
  if(A>=K) cout << A-K << " " << B << endl;
  else if(A+B>=K) cout << 0 << " " << B-(K-A) << endl;
  else cout << 0 << " " << 0 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int         long long   
#define double      long double
#define endl        "\n"
#define pb          push_back
#define PI          3.1415926535897932384626433832795l
#define F           first
#define S           second
#define mp          make_pair
#define f(i,n)      for(int i=0;i<n;i++)
#define fastio      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)      (v).begin(),(v).end()
#define sort(v)     sort((v).begin(),(v).end())
#define rall(v)     (v).rbegin(),(v).rend()
#define rsort(v)     sort((v).rbegin(),(v).rend())
#define gcd(a,b)    __gcd((a),(b))
#define minn(v)     *min_element(v.begin(), v.end());
#define maxx(v)     *max_element(v.begin(), v.end());
#define print(x)    cout<<(x)<<endl;
typedef pair<int,int> pii;  
typedef vector<int> vi;
//x.substr(start, length);

bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}
struct type{
    int k, i, j;
};
signed main() 
{
    cout<<fixed<<setprecision(12);
    fastio;
    int n,x;
    cin>>n;
    cin>>x;
    int ans=1;
    int maxx=x;
    f(i,n-1)
    {
        cin>>x;
        maxx=min(maxx,x);
        if(maxx>=x)ans++;
    }
    cout<<ans<<endl;
    
}


Measured memory_bytes: 256
//agc033_b
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt(), W = sc.nextInt(), N = sc.nextInt();
        int Sr = sc.nextInt(), Sc = sc.nextInt();
        String S = sc.next(), T = sc.next();
        sc.close();
        int left = 1, right = W, up = 1, down = H;
        boolean alive = true;
        for (int i = N - 1; i >= 0 && alive; i--) {
            switch (T.charAt(i)) {
                case 'L': right = Math.min(W, right + 1); break;
                case 'R': left = Math.max(1, left - 1); break;
                case 'U': down = Math.min(H, down + 1); break;
                case 'D': up = Math.max(1, up - 1); break;
            }
            switch (S.charAt(i)) {
                case 'L': left++; break;
                case 'R': right--; break;
                case 'U': up++; break;
                case 'D': down--; break;
            }
            if (left > right || up > down) alive = false;
        }
        boolean ans = alive && Sr >= up && Sr <= down && Sc >= left && Sc <= right;
        System.out.println(ans ? "YES" :"NO");
    }
}


Measured memory_bytes: 28840
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    set<pi>   spi;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   998244353
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define    all(x)   x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(12)<<fixed
#define    mems(dp,x)   memset(dp,x,sizeof(dp))
#define    fbo    find_by_order
#define    ook    order_of_key
#define    upb    upper_bound
#define    lowb   lower_bound 
#define    lte(v,x)   upb(all(v),x)-v.be()
#define    gte(v,x)   v.end()-lowb(all(v),x)
const    ld   PI=3.1415926535897932384626433832792884197169399375105820974944;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}
inline ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int main()
{       io 
int testcases=1;       //    cin>>testcases;
while(testcases--)
{

int k;
cin>>k;

string s;
cin>>s;

if(s.length()<=k)
cout<<s;

else
cout<<s.substr(0,k)<<"...";









}return 0;}

Measured memory_bytes: 3656
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    std::ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> b(n-1);
    for(int i=0;i<n-1;++i){
        cin >> b[i];
    }

    int ans = b[0];
    for(int i=1;i<n-1;++i) {
        ans += min(b[i-1], b[i]);
    }
    ans += b.back();
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
using namespace std;

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


//ABC122_b
int main() {
	string s;
	cin >> s;
	int res = 0;
	int tmp = 0;
	rep(i, s.length()) {
		if (s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T') {
			tmp++;
			res = max(res, tmp);
		}
		else {
			tmp = 0;
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 256