akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static void Main(string[] args)
    {
		int[] t = new int[5];

        for(var i = 0; i < 5; i++)
		{
			t[i] = int.Parse(Console.ReadLine());
		}
		List<int> list0 = new List<int>();
		List<int> list = new List<int>();
		for(var i=0;i<5;i++)
		{
			if (t[i] % 10 == 0) { list0.Add(t[i]); }
			else { list.Add(t[i]); }
		}
		int ans = 0;
		if (list0.Count > 0)
		{
			while (list0.Count > 0)
			{
				ans += list0[0];
				list0.RemoveAt(0);
			}
		}
		if (list.Count > 0)
		{

			list.Sort((a, b) => (a % 10) - (b % 10));
			ans += list[0];
			list.RemoveAt(0);
			if (list.Count > 0)
			{
				while (list.Count > 0)
				{
					ans += list[0] - (list[0] % 10) + 10;
					list.RemoveAt(0);
				}
			}
		}

		Console.WriteLine(ans);


            
	}
}





Measured memory_bytes: 11220
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<utility>
using namespace std;
 
typedef long long ll;
 
int main(){
  ll n,a,b, ans=0;
  cin >> n >> a >> b;
  ans = (n/(a+b))*a;
  if(a>n%(a+b)){
  	ans += n%(a+b);
  }else{
  	ans += a;
  }
  cout << ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
#define REP(i, d, n) for(int i=(d); i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {

    int n;
    cin >> n;
    int f[100][10];
    rep(i, n){
        rep(j, 10){
            cin >> f[i][j];
        }
    }
    int p[100][11];
    rep(i, n){
        rep(j, 11){
            cin >> p[i][j];
        }
    }

    int ans = INT_MIN;
    for(int bit=1; bit<(1 << 10); bit++){
        int cmp = 0;
        rep(i, n){
            int cnt = 0;
            rep(j, 10){
                if(((bit>>j) & 1) && f[i][j]){
                    cnt++;
                }
            }
            cmp += p[i][cnt];
        }
        ans = max(ans, cmp);
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll INF = 1LL << 30;

int main(void){
    ll N,K; cin >> N >> K;
    vector<pair<int,int>> p(N);
    for(int i = 0; i < N; i++){
        cin >> p[i].first >> p[i].second;
    }
    
    sort(p.begin(), p.end());
    int ans;
    int i = 0;
    while(K > 0){
        K -= p[i].second;
        if(K <= 0) ans = p[i].first;
        i++;
    }
    
    cout << ans << "\n";
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)



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

	string S;
	cin >> S;
	map<char, int>mp;
	for (int i = 0; i < S.size(); i++)mp[S[i]]++;
	for (int i = 0; i < 26; i++) {
		if (mp['a' + i] == 0) {
			string ans = S + (char)('a' + i);
			puts(ans);
			return 0;
		}
	}

	for (int i = 25; i >= 0; i--) {
		map<char, int>mp;
		for (int j = 0; j < i; j++) {
			mp[S[j]-'a']++;
		}
		for (int j = S[i] - 'a' + 1; j < 26; j++) {
			if (!mp[j]) {
				string ans = S.substr(0, i) + (char)(j+'a');
				puts(ans);
				return 0;
			}
		}
	}
	puts(-1);

	return 0;
}

Measured memory_bytes: 764
#include <iostream>

using namespace std;

int main()
{
    int h, n, sum = 0;
    cin>>h>>n;
    for(int i = 0; i < n; i++)
    {
        int value;
        cin>>value;
        sum += value;
    }
    if(sum >= h) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}


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

int main(){
	vector<int> v;
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		int tmp;
		cin>>tmp;
		v.push_back(tmp);
	}
	for(int i=N-1;i>=0;i--){
		cout<<v[i];
		if(i==0)
			cout<<endl;
		else
			cout<<" ";
	}
	return 0;
}

Measured memory_bytes: 1216
#include <iostream>
using namespace std;
int main(){

	int n,m,x,y,z;
	cin >> n >> m;
	x = 0;
	y = 0;
	z = 0;
	for(int i=0;i<m;i++){
		int a,b;
		cin >> a >> b;

		if( a < n ){
                        y = n-a;
			x = x+y;
			z = max( z , y );
		}
	}

	cout << x-z << endl;

	return 0;
}


Measured memory_bytes: 3092
#include<bits/stdc++.h>
 
 using namespace std;
 typedef long long ll;
 #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
 
 
 
 int main() {
     int n; cin >> n;
     string tmp;
     map<string, int> ma;
     rep(i, n) {
         cin >> tmp;
         ma[tmp]++;
     }
     int m; cin >> m;
     rep(i, m) {
         cin >> tmp;
         ma[tmp]--;
     }
 
     int ans = 0;
     for(auto itr : ma) {
         ans = max(itr.second, ans);
     }
 
     cout << ans << endl;
 
     return 0;
     
 }

Measured memory_bytes: 3620
// wtf ... forgot to participate >_<
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cassert>
#include <queue>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
// head

const int N=501000;
struct node {
	int l,r,ind;
}pool[N*22];
int cur=1,rt[N];
priority_queue<pair<int,int> > Q;
map<int,int> hs;
int n,k,p[N],pos[N];
VI ret;
int build(int l,int r) {
	int p=cur++;
	if (l!=r) {
		int md=(l+r)>>1;
		pool[p].l=build(l,md);
		pool[p].r=build(md+1,r);
		pool[pool[p].l].ind++;
		pool[pool[p].r].ind++;
	}
	return p;
}
void adde(int p,int q,int l,int r,int tl,int tr) {
	if (l==tl&&r==tr) {
		pool[q].ind++;
	} else {
		int md=(l+r)>>1;
		if (tr<=md) adde(p,pool[q].l,l,md,tl,tr);
		else if (tl>md) adde(p,pool[q].r,md+1,r,tl,tr);
		else adde(p,pool[q].l,l,md,tl,md),adde(p,pool[q].r,md+1,r,md+1,tr);
	}
}
void dfs(int p) {
	if (pool[p].l==0) {
		Q.push(mp(hs[p],p));
	}
	else {
		if ((--pool[pool[p].l].ind)==0) dfs(pool[p].l);
		if ((--pool[pool[p].r].ind)==0) dfs(pool[p].r);
	}
}
void dele(int p,int q,int l,int r,int tl,int tr) {
	if (l==tl&&r==tr) {
		if ((--pool[q].ind)==0) dfs(q);
	} else {
		int md=(l+r)>>1;
		if (tr<=md) dele(p,pool[q].l,l,md,tl,tr);
		else if (tl>md) dele(p,pool[q].r,md+1,r,tl,tr);
		else dele(p,pool[q].l,l,md,tl,md),dele(p,pool[q].r,md+1,r,md+1,tr);
	}
}
int insert(int p,int l,int r,int x,int v) {
	if (l==r) {
		return v;
	} else {
		int q=cur++;
		int md=(l+r)>>1;
		if (x<=md) pool[q].l=insert(pool[p].l,l,md,x,v),pool[q].r=pool[p].r;
		else pool[q].r=insert(pool[p].r,md+1,r,x,v),pool[q].l=pool[p].l;
		pool[pool[q].l].ind++; pool[pool[q].r].ind++;
		return q;
	}
}
int main() {
	scanf("%d%d",&n,&k); --k;
	rep(i,1,n+1) {
		scanf("%d",p+i);
		pos[p[i]]=i;
	}
	rt[0]=build(1,n);
	rep(i,1,n+1) {
		int q=cur++;
		hs[q]=pos[i];
		adde(q,rt[i-1],1,n,max(1,pos[i]-k),min(n,pos[i]+k));
		rt[i]=insert(rt[i-1],1,n,pos[i],q);
	}
	pool[rt[0]].ind=-1;
	per(i,1,n+1) if (pool[rt[i]].ind==0) dfs(rt[i]);
	while (!Q.empty()) {
		int id=Q.top().fi; int q=Q.top().se; Q.pop();
		ret.pb(id);
		dele(q,rt[p[id]-1],1,n,max(1,id-k),min(n,id+k));
	}
//	printf("%d\n",SZ(ret));
	reverse(all(ret));
	rep(i,0,n) p[ret[i]]=i+1;
	rep(i,1,n+1) printf("%d\n",p[i]);
}


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

#define rin(i,a,b) for(int i=(a);i<=(b);++i)
#define irin(i,a,b) for(int i=(a);i>=(b);--i)
#define trav(i,a) for(int i=head[a];i;i=e[i].nxt)
#define Size(a) (int)a.size()
#define pb push_back
#define mkpr std::make_pair
#define fi first
#define se second
#define lowbit(a) ((a)&(-(a)))
typedef long long LL;

using std::cerr;
using std::endl;

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

const int MAXN=1005;

int n,s,t,ecnt=1,head[MAXN<<1];

struct Edge{
    int to,nxt,cap,cost;
}e[MAXN*20];

inline void add_edge(int bg,int ed,int ca,int co){
    ++ecnt;
    e[ecnt].to=ed;
    e[ecnt].nxt=head[bg];
    e[ecnt].cap=ca;
    e[ecnt].cost=co;
    head[bg]=ecnt;
}

int maxflow,cur[MAXN<<1];
LL mincost,dis[MAXN<<1];
bool book[MAXN<<1],insta[MAXN<<1];
std::queue<int> q;

bool spfa(){
    memset(dis,0x3f,sizeof dis);
    rin(i,1,t)cur[i]=head[i];
    while(!q.empty())q.pop();
    dis[s]=0,book[s]=true;q.push(s);
    while(!q.empty()){
        int x=q.front();q.pop();
        trav(i,x){
            int ver=e[i].to;
            if(e[i].cap&&dis[ver]>dis[x]+e[i].cost){
                dis[ver]=dis[x]+e[i].cost;
                if(!book[ver]){
                    book[ver]=true;
                    q.push(ver);
                }
            }
        }
        book[x]=false;
    }
    return dis[t]<1e18;
}

int dfs(int x,int pref){
    if(x==t||!pref)return pref;
    int temp=0,flow=0;insta[x]=true;
    for(int &i=cur[x];i;i=e[i].nxt){
        int ver=e[i].to;if(insta[ver])continue;
        if(dis[ver]==dis[x]+e[i].cost&&(temp=dfs(ver,std::min(pref,e[i].cap)))){
            e[i].cap-=temp;
            e[i^1].cap+=temp;
            flow+=temp;
            pref-=temp;
            mincost+=1ll*temp*e[i].cost;
            if(!pref)break;
        }
    }
    insta[x]=false;
    return flow;
}

void ek(){
    while(spfa())maxflow+=dfs(s,1e9);
}

int main(){
    n=read();
    int x0=n*2+1,x1=x0+1,x2=x1+1,x3=x2+1;
    s=x3+1,t=s+1;
    rin(i,1,n){
        int rx=read(),ry=read(),rc=read();
        add_edge(s,i,rc,0);
        add_edge(i,s,0,0);
        add_edge(i,x0,1e9,rx+ry);
        add_edge(x0,i,0,-rx-ry);
        add_edge(i,x1,1e9,rx-ry);
        add_edge(x1,i,0,-rx+ry);
        add_edge(i,x2,1e9,-rx+ry);
        add_edge(x2,i,0,rx-ry);
        add_edge(i,x3,1e9,-rx-ry);
        add_edge(x3,i,0,rx+ry);
    }
    rin(i,1,n){
        int bx=read(),by=read(),bc=read();
        add_edge(n+i,t,bc,0);
        add_edge(t,n+i,0,0);
        add_edge(x0,n+i,1e9,-bx-by);
        add_edge(n+i,x0,0,bx+by);
        add_edge(x1,n+i,1e9,-bx+by);
        add_edge(n+i,x1,0,bx-by);
        add_edge(x2,n+i,1e9,bx-by);
        add_edge(n+i,x2,0,-bx+by);
        add_edge(x3,n+i,1e9,bx+by);
        add_edge(n+i,x3,0,-bx-by);
    }
    ek();
    printf("%lld\n",-mincost);
    return 0;
}

Measured memory_bytes: 768
#include "bits/stdc++.h"
 
using namespace std;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vvvvll = vector<vector<vector<vector<ll>>>>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll (x);cin >>(x);
#define stin(x) str (x);cin >>(x);
#define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
#define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vllin3(a,b,c,n) vll (a)(n);vll (b)(n);vll (c)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >>(x)[i];}
#define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
#define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
#define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
#define SORT(x) sort(x.be, x.en)
#define rSORT(x) sort(x.rbegin(), x.rend())
#define say(x) cout<<(x);
#define sal(x) cout<<(x)<<endl;
#define says(x) cout<<(x)<<(' ');
#define sas cout<<(' ');
#define sayR(x) cout<<fixed<<setprecision(10)<<(x);
#define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
#define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define pow(a,b) ll(pow(a,b))

ll MOD=1000000007;

vll w;
vll v;
vvll m;

ll solve(ll i,ll wi){
	if(i==0){
		return (wi>=w[0]?v[0]:0);
	}
	if(m[i][wi]>0) return m[i][wi];
	if(wi>=w[i]){
		return m[i][wi]=max(solve(i-1,wi),solve(i-1,wi-w[i])+v[i]);
	}else{
		return m[i][wi]=solve(i-1,wi);
	}
}

signed main(){
	llin(n);
	llin(wm);
	vlling2(w,v,n);
	m.assign(n,vll(wm+1,0));
	sal(solve(n-1,wm));
}


Measured memory_bytes: 79488
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iomanip>
#include <map>

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
//#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl

using namespace std;
typedef long long  ll;

const long long MOD = 1e9+7;

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i, 0, n){
        cin >> a.at(i);
    }

    vector<ll> comb(n+1, 0);
    vector<ll> comb_self(n+1, 0);

    vector<ll> copy = a;
    sort(copy.begin(), copy.end());
    ll count = 1;
    ll tmp = copy.at(0);
    REP(i, 0, n){
        if(i == 0){ continue;}
        if(tmp != copy.at(i)){
            if(count >= 2){
                comb.at(tmp) = count*(count-1)/2;
                comb_self.at(tmp) = (count-2)*(count-1)/2;
            }
            tmp = copy.at(i);
            count = 1;
        } else {
            count++;
        }
    }

    if(count >= 2){
        comb.at(tmp) = count*(count-1)/2;
        comb_self.at(tmp) = (count-2)*(count-1)/2;
    }

    ll sum = accumulate(comb.begin(), comb.end(), 0LL);
    REP(i, 0, n){
        p(sum - comb.at(a.at(i)) + comb_self.at(a.at(i)));
    }
}

Measured memory_bytes: 8832
#include<stdio.h>

int main()
{
  
  int A,B,T,S,ans;
  
  scanf("%d %d %d",&A,&B,&T);
  
  S = T / A;
  
  ans = S * B;
  
  printf("%d\n",ans);
  
  return 0;
  
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a, b; cin >> a >> b;
    cout << 6 - (a + b) << endl;
    return 0;
}

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

int main() {
  
  int K, X;
  cin >> K >> X;
  
  int min = X-K+1;
  int max = X+K-1;
  
  for(int i=min; i<=max; i++){
  	cout << i << ' ';
  }
  
}

Measured memory_bytes: 256
#define mod 1000000007
#include<time.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<map>
#include<queue>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll INF=0x7fffffffffffffff;
const int inf=0x7fffffff;
const int N=2e5+5;
clock_t start,finish;
void time_in(){start=clock();}
void time_out(){finish=clock();double tim=(double)(finish-start)/CLOCKS_PER_SEC;printf("Running time is %lf\n",tim);}
ll mul(ll a,ll b){ll s=0;while(b){if(b&1)s=(s+a)%mod;a=(a<<1)%mod;b>>=1;}return s%mod;}
ll pow_mul(ll a,ll b){ll s=1;while(b){if(b&1)s=mul(s,a);a=mul(a,a);b>>=1;}return s;}
ll poww(ll a,ll b){ll s=1;while(b){if(b&1)s=(s*a)%mod;a=(a*a)%mod;b>>=1;}return s%mod;}
int t,cas;
int n,m,k;
int main()
{
	double x,y,w,h;
	while(~scanf("%lf%lf%lf%lf",&w,&h,&x,&y))
	{
		printf("%.6lf ",w*h/2);
		if(x*2==w&&y*2==h)printf("1\n");
		else printf("0\n");
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int M,K;
  cin >> M >> K;
  if (M==0&&K==0){
    cout << 0 << ' ' << 0 << endl;
  }
  else if (M==1&&K==0){
    cout << 0 << ' ' << 0 << ' ' << 1 << ' ' << 1 << endl;
  }
  else if (1<M&&K<(1<<M)){
    for (int i=0;i<(1<<M);i++){
      if (i!=K){
        cout << i << ' ';
      }
    }
    cout << K << ' ';
    for (int i=(1<<M)-1;i>=0;i--){
      if (i!=K){
        cout << i << ' ';
      }
    }
    cout << K << endl;
  }
  else {
    cout << -1 << endl;
  }
}

Measured memory_bytes: 1792
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
int main()
{
	string s;
	cin >> s;
	int cnt = 0;
	int p1 = 0, p2 = s.size() - 1;
	for (;;)
	{
		if (p1 >= p2)break;
		if (s[p1] == s[p2])p1++, p2--;
		else if (s[p1] == 'x')p1++, cnt++;
		else if (s[p2] == 'x')p2--, cnt++;
		else
		{
			printf("-1\n");
			return 0;
		}
	}
	printf("%d\n", cnt);
}

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

int main(){
  int n;
  cin >> n;
  long int arr[n];
  for(int i = 0; i < n; i++)
    {cin >> arr[i];}

  sort(arr, arr+n);
  int t = 0;
  for(int i = 0;i < (n-1); i++)
  {
    if(arr[i]==arr[i+1]){	t=1;break;}
  }
  if(t == 1){
    cout << "NO";
  }
  else {
    cout << "YES";
  }
  return 0;
}


Measured memory_bytes: 1792
s = list(input())
q = int(input())
for i in range(q):
  
  r =list(map(str, input().split()))
  cmd = r[0]
  a = int(r[1])
  b = int(r[2])
  
  if cmd == "print":
    for j in range(a, b+1):
      print(s[j], end="")
    print("")
  elif cmd == "reverse":
        s[a:b+1] = reversed(s[a:b+1])
  elif cmd == "replace":
    rep = list(r[3])
    count = 0
    for j in range(a,b+1):
      s[j] = rep[count]
      count = count + 1


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

int main() {
    int N;
    cin >> N;
    vector<int>a(N);
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }
    ll ans = 0;
    for (int i = 1; i < N; ++i) {
        if(a[i] == a[i-1]) {
            ans++;
            i++;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

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

/*
  UnionFind Tree
*/
class UnionFind {
    private: 
        vector<int> par;
        vector<int> rank;
        vector<int> cnt;
    
    public:
        UnionFind(int n);
        int find(int x);
        void unite(int x, int y);
        bool same(int x, int y);
        int count(int x);
        void printStatus();
};

UnionFind::UnionFind(int n) {
    for (int i = 0; i < n; i++) {
        par.push_back(i);
        rank.push_back(0);
        cnt.push_back(1);
    }
}
int UnionFind::find(int x) {
    if (par[x] == x) return x;
    else return par[x] = find(par[x]);
}
void UnionFind::unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) {
        cnt[y] += cnt[x];
        par[x] = y;
    } else {
        cnt[x] += cnt[y];
        par[y] = x;
        if (rank[x] == rank[y]) rank[x]++;
    }
}
bool UnionFind::same(int x, int y) {
    return find(x) == find(y);
}
int UnionFind::count(int x) {
    return cnt[find(x)];
}
void UnionFind::printStatus() {
    printf("----------------\n");
    for (int i = 0; i < par.size(); i++) {
        printf("[node %d]: parent = %d, rank = %d, count = %d\n", i, par[i], rank[i], cnt[i]);
    }
}

int main() {
  
  int N, M;
  cin >> N >> M;
  vector<int> a(M), b(M);
  rep(i,M) {
    cin >> a[i] >> b[i];
    a[i]--; b[i]--;
  }

  int ans = 0;

  rep(i,M) {
    UnionFind tree(N);
    rep(j,M) {
      if (i != j) tree.unite(a[j], b[j]);
    }
    bool flag = true;
    rep(j,N) {
      if (!tree.same(0,j)) flag = false;
    }
    if (!flag) ans++;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3600
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        int c = stdIn.nextInt();

        System.out.println(a < b && b < c ? "Yes" : "No");
    }
}

Measured memory_bytes: 17160
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(int (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define opf(i) cout<<fixed<<setprecision(10)<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;


void solve(long long a, long long b, long long h){
  op((a+b)*h/2)
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long a;
    scanf("%lld",&a);
    long long b;
    scanf("%lld",&b);
    long long h;
    scanf("%lld",&h);
    solve(a, b, h);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int a,b,sum;
  cin >> a;
  b=a;
  while(a) {
    sum+=a%10;
   a/=10;
}
  if(b%sum) cout << "No" <<endl;
  else cout << "Yes" <<endl;
}

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

#define max 100

//qsort(d, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}

int main()
{
    int i, j, n;
    double a[max], sum=0;
    
    scanf("%d", &n);
    for (i=0; i<n; i++) {
        scanf("%lf", &a[i]);
    }
    
    for (i=0; i<n; i++) {
        a[i]=1/a[i];
        sum=sum+a[i];
    }
    
    printf("%lf", 1/sum);

    return 0;
}




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

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

struct Edge {
    ll a;
    ll b;
    ll c;
};

Edge E[5005];
ll C[2505];
bool U[2505];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M, P;
    cin >> N >> M >> P;
    REP(i, M) {
        cin >> E[i].a >> E[i].b >> E[i].c;
        E[i].a--;
        E[i].b--;
        E[i].c -= P;
        E[i].c *= -1;
    }
    REP(i, N) {
        C[i] = INF;
    }
    memset(U, 0, sizeof(U));
    C[0] = 0;
    U[N - 1] = true;

    REP(_, N + 5) {
        bool update = false;
        REP(i, M) {
            auto &e = E[i];
            if (U[e.b])
                U[e.a] = true;
            if (C[e.a] == INF)
                continue;
            ll cost = C[e.a] + e.c;
            if (C[e.b] <= cost)
                continue;
            update = true;
            C[e.b] = cost;
        }
        if (!update)
            break;
    }

    REP(i, M) {
        auto &e = E[i];
        if (C[e.a] == INF)
            continue;
        ll cost = C[e.a] + e.c;
        if (C[e.b] <= cost)
            continue;
        if (U[e.b]) {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << std::max(0LL, -C[N - 1]) << endl;
    return 0;
}

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

int main()
{
    long long int N, K, C;
    cin >> N >> K;
    C = K;
    int ans = 1;
    int c = 0;
    while (c == 0)
    {
        if (N > C - 1)
        {
            C = C * K;
            ans++;
        }
        else
        {
            c = 1;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    t.pop_back();

    cout << (s == t ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 3620
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {

    static long iniPos = (long) Math.pow(10, 15);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int s = sc.nextInt() -1;
        int t = sc.nextInt() -1;
        int[][] yenEdges = new int[m][3];//{from, to, cost}
        int[][] snuukEdges = new int[m][3];
        for (int i = 0; i < m; i++) {
            int from = sc.nextInt() -1;
            int to = sc.nextInt() -1;
            int a = sc.nextInt(); // yen
            int b = sc.nextInt(); // snuuk
            yenEdges[i] = new int[]{from, to, a};
            snuukEdges[i] = new int[]{from, to, b};
        }
        int[][][] yenGraph = buildWeightedGraph(n, yenEdges);
        int[][][] snuukGraph = buildWeightedGraph(n, snuukEdges);
        long[] yenDis = dijkstra(n, yenGraph, s);
        long[] snuukDis = dijkstra(n, snuukGraph, t);
        // 各頂点で両替した時の最小コストを降順に保持する {cost, vertex}
        PriorityQueue<long[]> q =
                new PriorityQueue<long[]>((x, y) -> Long.compare(x[0], y[0]));
        for (int i = 0; i < n; i++) {
            long cost = yenDis[i] + snuukDis[i];
            q.add(new long[]{cost, i});
        }
        StringBuilder sb = new StringBuilder();
        long[] a = q.peek();
        for (int i = 0; i < n; i++) {
            while(a[1] + 1 <= i){
                q.poll();
                a = q.peek();
            }
            sb.append(iniPos - a[0]).append("\n");
        }

        System.out.println(sb.toString());
        sc.close();


    }

    public static int[][][] buildWeightedGraph(int n, int[][] edges){
        int m = edges.length;
        int[][][] graph = new int[n][][];
        int[] deg = new int[n];
        for (int i = 0; i < m; i++) {
            deg[ edges[i][0] ]++;
            deg[ edges[i][1] ]++;
        }
        for (int i = 0; i < n; i++) {
            graph[i] = new int[deg[i]][2];
        }
        for (int i = 0; i < m; i++) {
            int a = edges[i][0];
            int b = edges[i][1];
            int c = edges[i][2];
            graph[a][--deg[a]][0] = b;
            graph[a][deg[a]][1] = c;
            graph[b][--deg[b]][0] = a;
            graph[b][deg[b]][1] = c;
        }

        return graph;
    }

    public static long[] dijkstra(int n, int[][][] graph, int s) {
        // {sからの最短距離, 頂点}
        PriorityQueue<long[]> pq =
                new PriorityQueue<long[]>((x, y) -> Long.compare(x[0], y[0]));
        long[] d = new long[n]; // sからの最短距離
        Arrays.fill(d, Long.MAX_VALUE);
        d[s] = 0;
        pq.add(new long[]{0, s});
        while(!pq.isEmpty()){
            long[] a = pq.poll();
            int v = (int)a[1];
            if(d[v] < a[0]) continue;
            for (int[] g: graph[v]) {
                int to = g[0];
                int cost = g[1];
                if(d[to] > d[v] + cost){
                    d[to] = d[v] + cost;
                    pq.add(new long[]{d[to], to});
                }
            }
        }

        return d;
    }

}


Measured memory_bytes: 169408
import java.util.Scanner;

public class Main {

	public int getUse(int index, int use) {
		return (use >> index * 2) & 0x3;
	}
	
	public int getCost(int N, int A, int B, int C, int[] li, int use) {
		int total = 0;
		int[] len = {0, 0, 0};
		
		for (int i=0; i<N; i++) {
			int u = getUse(i, use);
			if (u == 3) {
				continue;
			}
			if (len[u] != 0) {
				total += 10;
			}
			len[u] += li[i];
			
		}

		for (int i=0; i<len.length; i++) {
			if (len[i] == 0) {
				return Integer.MAX_VALUE;
			}
		}
		
		total += Math.abs(len[0] - A);
		total += Math.abs(len[1] - B);
		total += Math.abs(len[2] - C);
		
		return total;
	}
	
	public int solve() {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int A = in.nextInt();
		int B = in.nextInt();
		int C = in.nextInt();
		
		int[] li = new int[N];
		
		for (int i=0; i<N; i++) {
			li[i] = in.nextInt();
		}
		
		in.close();
		
		int use = 1;
		int min = Integer.MAX_VALUE;
		while(true) {
			int cost = getCost(N, A, B, C, li, use);
			
			if (cost < min) {
				min = cost;
			}
			
			use++;
			if (use >= (0x1 << (N*2))) {
				break;
			}
		}
		
		return min;
	}
	
	public static void main(String[] args) {
		Main main = new Main();
		System.out.println(main.solve());
	}
}


Measured memory_bytes: 25428
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

int main() {
  int H, W, N; cin >> H >> W >> N;
  vi arr(N);
  rep(i,N) cin >> arr[i];

  Graph G(H, vi(W));
  int pos = 0;
  rep(i,N) {
    rep(j,arr[i]) {
      int hs = pos / W;
      int ws = pos % W;
      G[hs][ws] = i+1;
      ++pos;
    }
  }

  rep(i,H) if (i%2) reverse(all(G[i]));

  rep(i,H) {
    rep(j,W-1) cout << G[i][j] << ' ';
    cout << G[i][W-1] << endl;
  }
  return 0;
}


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

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

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

struct LazySegmentTree {
private:
    int n;
    vector<ll> node,lazy;
public:
    LazySegmentTree(vector<ll> v) {
        int sz = v.size();
        n = 1;
        while (n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1,0);
        for (int i = 0;i < sz;++i) node[i+n-1] = v[i];
        for (int i = n-2;i >= 0;--i) node[i] = max(node[i*2+1],node[i*2+2]);
    }

    void eval(int k,int l,int r) {
        if (lazy[k] != 0) {
            node[k] += lazy[k]/(r-l);
            if (r-l > 1) {
                lazy[2*k+1] += lazy[k]/2;
                lazy[2*k+2] += lazy[k]/2;
            }
            lazy[k] = 0;
        }
    }

    void add(int a,int b,ll x,int k = 0,int l = 0,int r = -1) {
        if (r < 0) r = n;
        eval(k,l,r);
        if (b <= l || r <= a) return;
        if (a <= l && r <= b) {
            lazy[k] += (r-l)*x;
            eval(k,l,r);
        } else {
            add(a,b,x,2*k+1,l,(l+r)/2);
            add(a,b,x,2*k+2,(l+r)/2,r);
            node[k] = max(node[2*k+1],node[2*k+2]);
        }
    }

    ll getmax(int a,int b,int k = 0,int l = 0,int r = -1) {
        if (r < 0) r = n;
        if (b <= l || r <= a) return -INT64_MAX;
        eval(k,l,r);
        if (a <= l && r <= b) return node[k];
        ll vl = getmax(a,b,k*2+1,l,(l+r)/2);
        ll vr = getmax(a,b,2*k+2,(l+r)/2,r);
        return max(vl,vr);
    }
};

int main() {
    int n,m;
    cin >> n >> m;
    vector<vector<P>> r(n+1);
    LazySegmentTree dp(vector<ll>(n+1,0));
    for (int i = 0;i < m;++i) {
        int a,b,c;
        cin >> a >> b >> c;
        r[b].push_back(P(a,c));
    }
    for (int i = 1;i <= n;++i) {
        dp.add(i,i+1,dp.getmax(0,i)-dp.getmax(i,i+1));
        for (P p : r[i]) dp.add(p.first,i+1,p.second);
    }
    cout << dp.getmax(0,n+1) << endl;
    return 0;
}

Measured memory_bytes: 19428
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>
#include <stack>
#include <vector>
#include <set>
#include <climits>
#include <functional> 

using namespace std;

#define ERROR_ID		0

#define PROCESS_ERROR(Condition)    \
{                                   \
		if (!(Condition))           \
		{                           \
			goto Exit0;             \
		}                           \
}

typedef unsigned char			BYTE;
typedef int						BOOL;
typedef unsigned long			DWORD;
typedef long long				LLONG;

inline int read() {
	int ret = 0, f = 1;
	char ch = getchar();
	while (ch<'0' || ch>'9') {
		if (ch == '-') f = -f;
		ch = getchar();
	}
	while (ch >= '0'&&ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
	return ret * f;
}//快读优化

int main(int argc, char* argv[])
{
	string			szWordAStr;
	string			szWordBStr;

	getline(cin, szWordAStr);
	getline(cin, szWordBStr);

	sort(szWordAStr.begin(), szWordAStr.end());

	sort(szWordBStr.begin(), szWordBStr.end(), greater<char>() );

	if (szWordAStr < szWordBStr)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

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

#define MAX ((int)100010)
#define endl '\n'

using namespace std;

int array1[ MAX ], array2[ MAX ];

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

	int n, ans = 0;
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> array1[ i ], array2[ i ] = array1[ i ];
	sort(array2, array2 + n);
	for(int i = 0 ; i < n ; i++)
		ans += abs(lower_bound(array2, array2 + n, array1[ i ]) - array2 - i) & 1;
	cout << (ans + 1) / 2 << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

template <typename T>
class SegmentTree {
public:
    SegmentTree(const vector<T> &v) {
        n = v.size();
        build(v);
    }

    int query(int l, int r) {
        return query(1, 0, n - 1, l, r);
    }

private:
    int n;
    vector<vector<T>> nodes;
    vector<T> next;

    void build(const vector<T> &v) {
        build_next_array(v);

        nodes.resize(4 * n + 1);

        setup(1, 0, n - 1);
    }

    void setup(int p, int l, int r) {
        if (l == r) {
            nodes[p] = {next[l]};
            return; 
        }

        int mid = (l + r) / 2;

        setup(2 * p, l, mid);
        setup(2 * p + 1, mid + 1, r);

        nodes[p] = merge(nodes[2 * p], nodes[2 * p + 1]);
    }

    void build_next_array(const vector<T> &v) {
        next.resize(n);
        vector<T> last(n + 1, n);

        ford (i, n - 1, 0) {
            next[i] = last[v[i]]; 
            last[v[i]] = i;
        }
    }

    int query(int p, int l, int r, int i, int j) {
        if (i <= l and r <= j) {
            int index = upper_bound(begin(nodes[p]), end(nodes[p]), j) - begin(nodes[p]);
            int total = nodes[p].size() - index;
            return total;
        }

        if (r < i or j < l) {
            return 0;
        }

        int mid = (l + r) / 2;
        return query(2 * p, l, mid, i, j) + query(2 * p + 1, mid + 1, r, i, j);    
    }

    vector<T> merge(const vector<T> &a, const vector<T> &b) {
        vector<T> result;

        int a_ptr = 0, b_ptr = 0;

        while (a_ptr < (int) a.size() or b_ptr < (int) b.size()) {
            if (a_ptr == (int) a.size()) result.push_back(b[b_ptr++]);
            else if (b_ptr == (int) b.size()) result.push_back(a[a_ptr++]);
            else if (a[a_ptr] < b[b_ptr]) result.push_back(a[a_ptr++]);
            else result.push_back(b[b_ptr++]);
        }

        return result;
    }
};

void solve() {
    int n, q;
    cin >> n >> q;

    vector<int> v(n);
    fori (i, 0, n) cin >> v[i];

    SegmentTree<int> st(v);

    fori (i, 0, q) {
        int l, r;
        cin >> l >> r;

        cout << st.query(l - 1, r - 1) << "\n";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}



Measured memory_bytes: 120388
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T &a, T b) {
  if(a<b) {
    a=b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T &a, T b) {
  if(a>b) {
    a=b;
    return 1;
  }
  return 0;
}
const ll INF = 1LL << 60;

int N;
ll h[100010];

ll dp[100010];

int main() {
  int N; cin >> N;
  for (int i=0; i<N; i++) cin >> h[i];

  for (int i=0; i<N; i++) dp[i] = INF;
  dp[0] = 0;

  for(int i=1; i<N; i++) {
    chmin(dp[i],dp[i-1]+abs(h[i]-h[i-1]));
    if(i>1) chmin(dp[i],dp[i-2]+abs(h[i]-h[i-2]));
  }
  cout << dp[N-1] << endl;
}


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


int main()
{
  int a, p;
  cin >> a >> p;
  p += a * 3;
  cout << p / 2 << endl;
  return 0;
}

Measured memory_bytes: 256
// Problem : E - Replace Digits
// Contest : AtCoder - ACL Beginner Contest
// URL : https://atcoder.jp/contests/abl/tasks/abl_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// $%U%$
// Mere bas ka nahi hai
// still i'm trying
// apna time aayega
//
//        .--------------.  
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |  
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'                          		  
//
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll power(ll x,ll y,ll m){if(y==0)return 1;ll p=power(x,y/2,m)%m;p=(p*p)%m;return (y%2==0)?p:(x*p)%m;}
ll nCr(ll n,ll r,ll m){if(r>n)return 0;ll a=1,b=1,i;for(i=0;i<r;i++){a=(a*n)%m;--n;}while(r){b=(b*r)%m;--r;}return (a*power(b,m-2,m))%m;}
#define Test int t;cin>>t;while(t--)
#define endl '\n'
const ll mod=998244353;
vector<ll> tree,po,lazy;
#define data dat
vector<vector<ll>> dat;
void build(int l,int r,int index)
{
	if(l==r)
	{
		tree[index]=1;
		return;
	}
	int mid=(l+r)>>1;
	build(l,mid,2*index+1);
	build(mid+1,r,2*index+2);
	tree[index]=(tree[2*index+1]*po[r-mid])%mod+tree[2*index+2];
	tree[index]%=mod;
}

void update(int l,int r,int index,int tl,int tr,int d)
{
	int mid=(l+r)/2;
	int c1=2*index+1,c2=2*index+2;
	if(lazy[index])
	{
		if(l!=r)
		lazy[c1]=lazy[c2]=lazy[index];
		tree[index]=data[r-l+1][lazy[index]];
		lazy[index]=0;
	}
	if(tl<=l && r<=tr)
	{
		if(l!=r)
		lazy[c1]=lazy[c2]=d;
		tree[index]=data[r-l+1][d];
		return;
	}
	if(tl>r || tr<l)
	return;
	update(l,mid,c1,tl,tr,d);
	update(mid+1,r,c2,tl,tr,d);
	tree[index]=(tree[2*index+1]*po[r-mid])%mod+tree[2*index+2];
	tree[index]%=mod;
}

void solve()
{
	int n,q;
	cin >> n >> q;
	tree = lazy = vector<ll>(4*n);
	po = vector<ll>(n+1);
	ll t=1;
	for(int i=0;i<=n;++i)
	{
		po[i]=t;
		t*=10;
		t%=mod;
	}
	build(0,n-1,0);
	data = vector<vector<ll>>(n+1,vector<ll>(10));
	for(int i=1;i<=n;++i)
	{
		for(int j=1;j<=9;++j)
		{
			data[i][j]=data[i-1][j]*10;
			data[i][j]%=mod;
			data[i][j]+=j;
			data[i][j]%=mod;
		}
	}
	while(q-->0)
	{
		int l,r,d;
		cin >> l >> r >> d;
		--l;--r;
		update(0,n-1,0,l,r,d);
		cout << tree[0] << endl;
	}
}




int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//Test
	solve();
	return 0;
}


Measured memory_bytes: 40668
#include <iostream>
#include <algorithm>
#include <string>
#include <typeinfo>
#include <cmath>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007
using namespace std;


int main(){
  int n;
  cin >> n;
  vector<int> a(4,0);
  
  rep(i,n){
	char w;
	cin >> w;
	if(w == 'P')a[0] = 1;
	if(w == 'W')a[1] = 1;
	if(w == 'G')a[2] = 1;
	if(w == 'Y')a[3] = 1;
  }

  int ans = 0;
  rep(i,4) ans+=a[i];
  if(ans == 3) cout << "Three" << endl;
  else cout << "Four" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<map>
#include<set>
using namespace std;
int N,R=0;
char S[1500];
string f;
map<string,vector<string> >E;
map<string,int> F;
set<string>G;

void dfs(string g)
{
	for(vector<string>::iterator I=E[g].begin();I!=E[g].end();I++)
	{
		if(E.find(*I)!=E.end())
		{
			if(!F[*I])
			{
				F[*I]=1;
				dfs(*I);
			}
		}
		else G.insert(*I);
	}
}

int main()
{
	for(;scanf("%d\n",&N),N;)
	{
		for(int i=R=0;i<N;i++)
		{
			gets(S);
			char *p=strtok(S,":");
			string s=string(p);
			if(i==0)f=s;
			E[s];F[s];
			for(;p=strtok(NULL,",.");)
				E[s].push_back(string(p));
		}
		dfs(f);
		printf("%d\n",G.size());
		E.clear();
		F.clear();
		G.clear();
	}
}

Measured memory_bytes: 1248
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a==b&&b==c)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}

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

using namespace std;

int n, m;
map<int, int> mm;
long long ans, sum, ta;

int main() {
	mm[0] = 1;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &ta);
		sum += ta;
		sum %= m;
		ans += mm[sum];
		mm[sum]++;
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3200
N = int(input())
A = list(map(int,input().split(" ")))
flag = True
for a in A:
    if(a%2 == 0):
        if(a%3 != 0 and a%5 != 0):
            print("DENIED")
            flag = False
            break
if(flag):
    print("APPROVED")

Measured memory_bytes: 3060
import collections
n, m = [int(i) for i in input().split()]
todc = collections.defaultdict(lambda: [])
lendc = collections.defaultdict(lambda: -1)


for k in range(m):
    i, j = [int(n) for n in input().split()]
    todc[j] += [i]


def maxlen(n):
    if len(todc[n]) == 0:
        lendc[n] = 0
        return 0
    else:
        m = 0
        for i in todc[n]:
            if lendc[i] == -1:
                lendc[i] = maxlen(i)
            m = max(m, lendc[i]+1)
        return m
       

def maxlen_stack(org_n):
    stack = [org_n]
    while stack:
        n = stack.pop()
        if len(todc[n]) == 0:
            lendc[n] = 0
        else:
            m = 0
            recursive = []
            for i in todc[n]:
                if lendc[i] == -1:
                    recursive.append(i)
                else:
                    m = max(m, lendc[i]+1)
            if recursive:
                stack += [n] + recursive
            else:
                lendc[n] = m         
    return lendc[org_n]

k = 0
for i in range(1, n+1):
    if lendc[i] == -1:
        #lendc[i] = maxlen(i)
        lendc[i] = maxlen_stack(i)
    k = max(k, lendc[i])
print(k)


Measured memory_bytes: 42208