akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> F(6);
  for (int i = 0; i < 6; i++){
    cin >> F[i];
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++){
    int t, f;
    cin >> t >> f;
    for (int j = 0; j < 6; j++){
      if (t == F[j]){
        t = j;
        break;
      }
    }
    for (int j = 0; j < 6; j++){
      if (f == F[j]){
        f = j;
        break;
      }
    }
    int r;
    if (t == 0 && f == 1) r = 2;
    if (t == 0 && f == 2) r = 4;
    if (t == 0 && f == 3) r = 1;
    if (t == 0 && f == 4) r = 3;
    if (t == 1 && f == 0) r = 3;
    if (t == 1 && f == 2) r = 0;
    if (t == 1 && f == 3) r = 5;
    if (t == 1 && f == 5) r = 2;
    if (t == 2 && f == 0) r = 1;
    if (t == 2 && f == 1) r = 5;
    if (t == 2 && f == 4) r = 0;
    if (t == 2 && f == 5) r = 4;
    if (t == 3 && f == 0) r = 4;
    if (t == 3 && f == 1) r = 0;
    if (t == 3 && f == 4) r = 5;
    if (t == 3 && f == 5) r = 1;
    if (t == 4 && f == 0) r = 2;
    if (t == 4 && f == 2) r = 5;
    if (t == 4 && f == 3) r = 0;
    if (t == 4 && f == 5) r = 3;
    if (t == 5 && f == 1) r = 3;
    if (t == 5 && f == 2) r = 1;
    if (t == 5 && f == 3) r = 4;
    if (t == 5 && f == 4) r = 2;
    cout << F[r] << endl;
  }
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LONG_LONG_MAX / 2;
const ll mod = 1000000000 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  ll ans = a * c;
  ans = max(ans, a * d);
  ans = max(ans, b * c);
  ans = max(ans, b * d);
  cout << ans << endl;
}


Measured memory_bytes: 3612
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#include<assert.h>
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())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
const ll mod=1000000007;
const double PI = acos(-1.0);
const double epsilon = PI / 180.0;//角度转弧度 
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;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
const int N = 2e5+10, M = 1e6+10;
int fa[N], sz[N];
int find(int x) {
	if(fa[x] == x) return x;
	return fa[x] = find(fa[x]);
}
void join(int c1, int c2) {
	int f1 = find(c1), f2 = find(c2);
	if(f1 != f2) fa[f1] = f2, sz[f2] += sz[f1];
}
int n, m;
int main() {
	cin>>n>>m;
	for(int i = 1;i <= n;i++) fa[i] = i, sz[i] = 1;
	for(int i = 1;i <= m;i++) {
		int a, b;
		cin>>a>>b;
		join(a, b);
	}
	int ans = 0;
	for(int i = 1;i <= n;i++) {
		if(fa[i] == i) ans = max(ans, sz[i]);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 5168
#include <cstdio>
#include <queue>
#include <iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include<string.h>
#include<fstream>

#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
using namespace std;

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
       
    ll i,j,k,x,y,z,p,q;
    ll n,m,tmp;
    string s[200000];
    string str;
    ll sum=0;
    ll strr[200005];
    cin>>n;
    vector<int> a(n);
    rep(i,n)   cin >> a[i];
    j=1;
    rep(i,n){
        if(a[i]==j){
            j++;
        }
    }
    if(j!=1){
    cout<<n-j+1<<endl;
    }else{
        cout<<-1<<endl;
    }
    return 0;
}

Measured memory_bytes: 2560
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

c = abs(a-b)

if c == 0:
    print("YES")
    exit(0)
if v-w <=0:
    print("NO")
    exit(0)
if c / (v-w) > t:
    print("NO")
else:
    print("YES")














Measured memory_bytes: 9184
from sys import stdin

def canMake(i, mi):
    global A, dp
    if mi == 0:
        return True
    elif i >= n:
        return False
    else:
        try:
            return dp[(i, mi)]
        except KeyError:
            dp[(i, mi)] = canMake(i+1, mi) or canMake(i+1, mi-A[i])
            return dp[(i, mi)]

n = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
q = int(stdin.readline().rstrip())
m = [int(x) for x in stdin.readline().rstrip().split()]

for mi in m:
    dp = {}
    if canMake(0, mi):
        print("yes")
    else:
        print("no")


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

int sum(int x)
{
	int cnt = 0;
	while(x)
	{
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}

int main()
{
	int n;
	cin >> n;
	int best = 1000000;
	for(int i = 1; i < n; i++)
		best = min(best, sum(i) + sum(n-i));
	cout << best << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int X = sc.nextInt();
        System.out.print("");
        int A = sc.nextInt();

        if(X < A){
            System.out.println(0);
        }else{
            System.out.println(10);
        }
    }
}


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

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

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

    ll A,B,K; cin >> A >> B >> K;

    cout << max(0LL,A-K) << " " << max(min(B,A+B-K),0LL) << endl;

    return 0;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s[] = new int[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.nextInt();
		}

		int q = sc.nextInt();
		int t[] = new int[q];

		for (int i = 0; i < q; i++) {
			t[i] = sc.nextInt();
		}

		System.out.println(countNumbers(n, s, q, t));
	}

	public static boolean isIncludeNumber(int n, int s[], int num) {
		for (int i = 0; i < n; i++) {
			if (s[i] == num) {
				return true;
			}
		}
		return false;
	}

	public static int countNumbers(int n, int s[], int q, int t[]) {
		int count = 0;
		for (int j = 0; j < q; j++) {
			if (isIncludeNumber(n, s, t[j])) {
				count++;
			}
		}
		return count;
	}
}



Measured memory_bytes: 66512
#include <bits/stdc++.h>
using namespace std;
long long a[200100], l[200100], r[200100];
stack < pair<long long, long long> > ll, rr;
int main(){
    long long i, N;
    cin>>N;
    for(i=1; i<=N; i++) cin>>a[i];
    a[0] = 0;
    a[N+1] = 0;
    for(i=1; i<=N+1; i++){
        while(ll.size() > 0){
            if(ll.top().first > a[i]){
                r[ll.top().first] = i - ll.top().second-1;
                ll.pop();
            }else{
                break;
            }
        }
        ll.push(make_pair(a[i], i));
    }
    for(i=N; i>=0; i--){
        while(rr.size() > 0){
            if(rr.top().first > a[i]){
                l[rr.top().first] = rr.top().second-i-1;
                rr.pop();
            }else{
                break;
            }
        }
        rr.push(make_pair(a[i], i));
    }
    long long cnt=0;
    for(i=1; i<=N; i++){
        long long K = l[i] + r[i] + 1;
        K *= (K+1);
        K /= 2;
        K-=( (l[i] * (l[i]+1) / 2 ) ) + ( (r[i] * (r[i]+1) / 2 ) );
        cnt+=K*(long long)i;
    }
    printf("%lld", cnt);
}


Measured memory_bytes: 6896
#include<iostream>
using namespace std;
int main(){
    int A,B;
    cin>>A>>B;
    if(A==1){
        A+=13;
    }
    if(B==1){
        B+=13;
    }
    if(A>B){
        cout<<"Alice"<<endl;
    }else if(A<B){
        cout<<"Bob"<<endl;
    }else if(A==B){
        cout<<"Draw"<<endl;
    }
}



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

int main(void){
    int s,t,u;
    cin >> s;

    t = s / 100;
    u = s % 100;
    if(1 <= t && t <= 12){
        if(1 <= u && u <= 12) cout << "AMBIGUOUS";
        else cout << "MMYY";
    } else{
        if(1 <= u && u <= 12) cout << "YYMM";
        else cout << "NA";
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

//++時計回り --反時計回り
// int dx[4] = {1, 0, -1, 0};
// int dy[4] = {0, 1, 0, -1};

int main() {
  int N;
  cin >> N;
  ll H[N];
  REP(i, N) cin >> H[i];
  int count = 0;
  int ans = 0;
  REP(i, N - 1) {
    if (H[i] >= H[i + 1]) {
      count++;
    } else {
      count = 0;
    }
    ans = max(ans, count);
  }
  cout << ans << '\n';
}


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

int main(){
  int l,r,d;
  cin >> l >> r >> d;
  int cut = 0;


    for(int i=l; i<=r; i++){
      if(i%d==0){
        cut++;
      }
    }
    
  cout << cut << endl;
  return 0;
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

#define rep(i,n) for(int i=0;i< (n);++i)
#define REP(i,n) for(int i=1;i<=(n);++i)
#define for_lowercase(c) for(int c='a';c<='z';++c)
#define for_uppercase(c) for(int c='A';c<='Z';++c)
#define ALL(a) (a).begin(),(a).end()
using LLI = long long int;
LLI GCD(LLI a,LLI b){ if(a<b) return GCD(b,a); else if(a%b==0) return b; else return GCD(b,a%b); }
LLI LCM(LLI a,LLI b){ return (a/GCD(a,b))*b; }
using VI  = std::vector<LLI>;
using PI  = std::pair<LLI,LLI>;
using VVI = std::vector<VI>;
using VPI = std::vector<PI>;
template<class T> bool is_odd (T x){ return   x%2 ; }
template<class T> bool is_even(T x){ return !(x%2); }

int main() {
    std::ios::sync_with_stdio(false);
    LLI A,B,C,D,E,F;
    std::cin >> A >> B >> C >> D >> E >> F;

    double max = -0.1;
    LLI ans_sum,ans_sugar;
    rep(a,30+1){
        rep(b,15+1){
            if(a+b == 0)continue;
            LLI water = 100 * (a*A+b*B);
            LLI sugar_max = std::min(F-water,(a*A+b*B)*E);
            if(sugar_max<0) continue;
            // if sugar_max>=0
            for(int c=0;c*C<=sugar_max;++c){
                int d = (sugar_max-c*C)/D;
                LLI sugar = c*C + d*D;
                double concentration = (100.*sugar)/(water+sugar);
                if(concentration>max){ //update
                    max = concentration;
                    ans_sum = water+sugar;
                    ans_sugar = sugar;
                    1+1;
                }
            }
        }
    }
    std::cout << ans_sum << " " << ans_sugar << std::endl;
    return 0;
}

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

int main() {
  int n,m;
  cin >> n;
  vector<int> v1(n),v2(n);
  r(i,n){
    cin >> v1[i];
    v2[i]=v1[i];
  }
  sort(v2.begin(),v2.end());
  m=(v2[n/2-1]+v2[n/2])/2;
  r(i,n){
    if(v1[i]<=m)cout<<v2[n/2]<<endl;
    else cout<<v2[n/2-1]<<endl;
  }
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
int min(int x, int y){
	if(x > y)return y;
    else return x;     
}
int main(void){
  int N, A, B;
  cin >> N >> A >> B;
  cout << min(A*N, B) <<endl;
  return 0;
}


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


int main(){
    int N,M,temp,sum=0;
    cin>>N>>M;
    for(int i=0;i<M;i++){
        cin>>temp;
        sum+=temp;
    }
    if((N-sum)>=0) cout<<N-sum<<endl;
    else cout<<-1<<endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 2e5+5;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

char s[maxn];

int main()
{
    fastio();
    cin>>s;
    for(int i=0;s[i];i++){
        if(s[i]=='?') cout<<'D';
        else cout<<s[i];
    }
    return 0;
}


Measured memory_bytes: 3840
#include<cstdio>
#include<iostream>
#include<cstring>
#include<queue>
#include<map>
#define RG register
using namespace std;
const int N=1e5+10, M=2e5+10;
const long long mod=1e5+7;
struct dabt{
	int next,to,dis;
}e[M*6],hsh[1000000];
struct node{
	int u,dis;
	bool operator < (const node&x)const{return x.dis<dis;}
};
int n,m,head[N+2*M],k,dist[N+2*M],st[2*M],ed[2*M],cnt,kk;
int kh,h[mod+1];
bool vis[N+2*M];
template<typename I> inline void read(I &ot){
	I ch=getchar(), x=0, f=1;
	while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();	}
	while(ch>='0' && ch<='9'){x=x*10+ch-'0'; ch=getchar();	}
	ot=x*f;}
template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}
inline void add(int from,int to,int d){
	e[++k]=(dabt){head[from],to,d}; head[from]=k;
	e[++k]=(dabt){head[to],from,d}; head[to]=k;
}
inline void adde(int from,int to,int d){hsh[++kh]=(dabt){h[from],to,d}; h[from]=kh;}
inline int id(int a,int b){
	int ss=((long long)a*n%mod+b)%mod;
	for(int i=h[ss];i;i=hsh[i].next)
	{
		int v=hsh[i].to;
		if(st[v]==a && ed[v]==b) return hsh[i].dis;
	}
	st[++kk]=a; ed[kk]=b;
	adde(ss,kk,++cnt);
	return cnt;
}
/*
map<pair<int,int>,int> P;
int id(int u,int c) {
    if(P.find(make_pair(u,c))!=P.end())
        return P[make_pair(u,c)];
    return P[make_pair(u,c)]=++cnt;
}*/
inline void dij()
{
	priority_queue<node> pn;
	while(!pn.empty()) pn.pop();
	for(int i=1;i<=n+m*2;i++) dist[i]=2e9;
	pn.push((node){1,0}); dist[1]=0;
	while(!pn.empty())
	{
		node u=pn.top(); pn.pop();
		int x=u.u; vis[x]=1;
		for(int i=head[x];i;i=e[i].next)
		{
			int v=e[i].to;
			if(dist[v]>dist[x]+e[i].dis)
			{
				dist[v]=dist[x]+e[i].dis;
				if(!vis[v]) pn.push((node){v,dist[v]});
			}
		}
	}
}
int main()
{
//	freopen("Snuke's Subway Trip.in","r",stdin);
//	freopen(". out","w",stdout);
	read(n,m); cnt=n;
	for(int i=1,a,b,c;i<=m;i++)
	{
		read(a,b,c);
		int id1=id(a,c), id2=id(b,c);
		add(a,id1,1); add(id1,id2,0); add(id2,b,1);
	}
	dij();
	printf("%d\n",dist[n]==2e9 ? -1 : dist[n]/2);
//	for(int i=1;i<=9;i++) printf("%d\n",dist[i]);
	//fclose(stdin); fclose(stdout);
	return 0;
}

Measured memory_bytes: 31988
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second
#define PI (acos(-1))

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;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;
const int INF=1e9;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	vector<vector<int>> x(n),y(n);
	rep(i,n){
		int a;
		cin>>a;
		rep(j,a){
			int b,c;
			cin>>b>>c;
			b--;
			x[i].push_back(b);
			y[i].push_back(c);
		}
	}
	int ans=0;
	rep(i,1<<n){
		vector<bool> flag(n);
		int cnt=0;
		rep(j,n){
			if(1<<j & i){
				flag[j]=true;
				cnt++;
			}else{
				flag[j]=false;
			}
		} 
		//cout<<flag<<endl;
		bool now=true;
		rep(j,n){
			if(flag[j]){//jが正直者の時
				rep(k,x[j].size()){
					if(y[j][k]==1){
						if(!flag[x[j][k]]){
							now=false;
							break;
						}
					}else{
						if(flag[x[j][k]]){
							now=false;
							break;
						}
					}
				}
			}
			if(!now){
				break;
			}
		}
		if(now){
			chmax(ans,cnt);
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
ls=[1,2,4,8,16,32,64,128,256,512,3,9,27,81,243,729,
    25,125,625,36,216,49,343,100,1000,
   121,144,169,196,225,289,324,361,400,
   441,484,529,576,625,676,781,841,900,961,1001]
ls.sort()
n=int(input())
for i in range(len(ls)):
  if ls[i]>n:
    print(ls[i-1])
    break
  


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

int main() {
  int n;
  cin >> n;
  int i = 1;
  int64_t ans = 0;

  while(true){
    if(i % 3 != 0 && i % 5 != 0)
    ans += i;
    if(i == n) break;
    i++;
  }

  cout << ans;
}



Measured memory_bytes: 3612
// ACR061 C ManyFormula.go 
//  

package main

import (
    "fmt"
    "strings"
    "strconv"
)

var Pat [][]bool

func factorial(i int) int {

    if i == 0 {
        return 1
    }

    return 2*factorial(i-1)
}


func calfunc(Q []string,Pati []bool) int{
    var n string
    var res int = 0
    var tmp int

    n = Q[0]
    for i := 0; i < len(Pati); i++ {
        if Pati[i] {  // true :+
           tmp,_ = strconv.Atoi(n)
           res += tmp
           //fmt.Println("n=",n)
           n = Q[i+1]

        } else {   // false 
           n +=Q[i+1]
        }
    }
    
    tmp,_ = strconv.Atoi(n)
    res += tmp
    //fmt.Println("n=",n)
    //fmt.Println("res=",res)
    return res
}


func main() {
    var In string
    var N []string
    var Sum int = 0
    var digit int
    var mask uint =1

    fmt.Scan(&In)
    slice := strings.Split(In,"")

    N = make([]string,len(slice))
    N = slice

    //fmt.Println(N)


    digit = factorial(len(N)-1)
    //fmt.Println("digit=",digit)

    Pat = make([][]bool,digit)
    for i :=0; i < digit; i++ {
        Pat[i] = make([]bool,len(N)-1)
    }

    
    for i:= 0; i < digit; i++ {
        k := uint(i)
        //fmt.Printf("%b\n",i)
        for j := 0; j < len(N)-1; j++ {
            if k&mask == 1 {
                Pat[i][j] = true
            } else {
                Pat[i][j] = false
            }
            //fmt.Printf("%8b\n",k&mask)
            k=k>>1
        }
    }
    
//    for i:=0; i < digit;i++ {
//        fmt.Println(Pat[i])
//    }

    for i:=0; i < digit; i++ {
        Sum += calfunc(N,Pat[i])
    }

    fmt.Println(Sum)

}



Measured memory_bytes: 640
total_square, total_toll_gate, current_square = map(int, input().split())
toll_gate_square = list(map(int, input().split()))
route1 = 0
route2 = 0
for i in range(total_toll_gate):
    if toll_gate_square[i] < current_square:
        route1 += 1
    else:
        route2 += 1
print(min(route1, route2))

Measured memory_bytes: 9172
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int N;
    cin >> N;
    ll A[N], sum = 0;
    for(int i = 0; i < N; ++i) {
        cin >> A[i]; sum += A[i];
    }
    //ll sum1 = 0, sum2 = 0;
    ll ans[N];
    ans[0] = ans[1] = sum;
    for(int i = 0; i < N/2; ++i) {
        ans[0] -= 2*A[2*i+1];
        ans[1] -= 2*A[2*i+2];
    }
    for(int i = 2; i < N; ++i) {
        ans[i] = ans[i-2] + 2*A[i-1] - 2*A[i-2];
    }
    for(int i = 0; i < N; ++i)
        cout << ans[i] << " ";
    cout << endl;
    return 0;
}

Measured memory_bytes: 2816
#include <stdio.h>
 
int main(void) {
 
    int n, i, j;
    int all[52];
    int cards[52];
    char symbol;
    int number;
    int snum;
    int card;
 
    for (i = 0; i < 52; i++) {
     
        all[i] = 1;
 
    }
 
    scanf("%d", &n);
 
    for (j = 0; j < n; j++) {
        scanf("\n%c %d", &symbol, &number);
 
        switch (symbol) {
 
        case 'S':
            snum = 0;
            break;
        case 'H':
            snum = 1;
            break;
        case 'C':
            snum = 2;
            break;
        case 'D':
            snum = 3;
            break;
        }
 
        cards[j] = snum * 13 + number - 1;
 
    }
 
    for (j = 0; j < n; j++) {
 
        card = cards[j];
 
        all[card] = 0;
 
    }
 
    for (i = 0; i < 52; i++) {
 
        if (all[i] == 1) {
 
            number = (i + 1) % 13;
            if (number == 0) {
                number = 13;
            }
 
            snum = (i - number + 1) / 13;
 
            switch (snum) {
 
            case 0:
                symbol = 'S';
                break;
            case 1:
                symbol = 'H';
                break;
            case 2:
                symbol = 'C';
                break;
            case 3:
                symbol = 'D';
                break;
 
            }
 
            printf("%c %d\n", symbol, number);
 
        }
    }
 
    return(0);
 
}


Measured memory_bytes: 2044
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[1000],b[1000],c[1000],sum=0;
	cin>>n;

	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
		c[i]=b[i]-a[i]+1;
		sum+=c[i];
		
	}
	cout<<sum<<endl;
	return 0; 
} 

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

int main(){
    int n, x, acc = 0;
    cin >> n;
    char c;
    for(int i = 0; i < n; i++){
        cin >> c >> x;
        acc += (c=='(' ? 1 : -1)*x;
        if(acc < 0) break;
    }
    cout << (acc==0 ? "YES" : "NO") << endl;
    return 0;
}


Measured memory_bytes: 3116
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int st[200001],d[200001],top,n;
int main()
{
	scanf("%d",&n);
	for(int i=n; i>=1; --i)
		scanf("%d",&d[i]);
	for(int i=1; i<=n; ++i) {
		if(d[i]>=st[top])
			st[++top]=d[i];
		else {
			int loc=upper_bound(st+1,st+top+1,d[i])-st;
			st[loc]=d[i];
		}
	}
	printf("%d",top);
	return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	x=0;char c=getchar();bool f=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return  x;
}
template<class t> inline void write(t x){
	if(x<0){putchar('-'),write(-x);}
	else{if(x>9)write(x/10);putchar('0'+x%10);}
}

#define int long long

const int N=2e5+5;
int ans,n,s,d;

struct seg{
	int i,l,r;
	inline bool operator < (const seg &nt) const {
		int d1=i%d*s%d,d2=nt.i%d*s%d;
		if(d1^d2) return d1<d2;
		if(l^nt.l) return l<nt.l;
		return r>nt.r;
	}
}f[N];

int calc(int l,int r){
	return (l+r)*(r-l+1)/2;
}

signed main(){
	read(n);read(s);read(d);
	if(d==0){
		if(s==0) write(1);
		else write(n+1);
		return 0;
	}
	for(int i=0;i<=n;i++) f[i]=(seg){i,i*s/d+calc(0,i-1),i*s/d+calc(n-i,n-1)};
	sort(f,f+1+n);
	for(int i=0,j;i<=n;i=j+1){
		j=i;
		while(j+1<=n&&f[j+1].i%d*s%d==f[i].i%d*s%d) j++;
		int l=f[i].l,r=f[i].r;
		ans+=r-l+1;
		for(int k=i+1;k<=j;k++){
			if(f[k].r<=r) continue;
			if(f[k].l<=r){
				ans-=r-l+1;
				r=f[k].r;
				ans+=r-l+1;
			}
			else{
				l=f[k].l;
				r=f[k].r;
				ans+=r-l+1;
			}
		}
	}
	write(ans);
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	vector<int> x(5);
	int ans;
	rep(i,5){
		cin>>x[i];
		if(x[i]==0){
			ans=i+1;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

// long long pow_mod(long long a, long long b){
// 	if(a == 0)
// 		return 0ll;
// 	if(b == 0)
// 		return 1ll;
// 	if(b == 1)
// 		return a%MOD;
// 	long long x = pow_mod(a,b/2);
// 	return ((b%2 == 1) ? (((x*x)%MOD)*a)%MOD : (x*x)%MOD);
// }

// long long pow_int(long long a, long long b){
// 	if(a==0)
// 		return a;
// 	if(b==0)
// 		return 1;
// 	if(b==1)
// 		return a;
// 	long long x = pow_int(a,b/2);
// 	return ((b%2 == 1) ? x*x*a : x*x);
// }

// int pow_int(int a, int b){
// 	if(a==0)
// 		return a;
// 	if(b==0)
// 		return 1;
// 	if(b==1)
// 		return a;
// 	int x = pow_int(a,b/2);
// 	return ((b%2 == 1) ? x*x*a : x*x);
// }


// void print_vec(vector<int>& a){
// 	for(int i=0;i<a.size();i++)
// 		cout << a[i] << (i<n-1 ? " ":"\n");
// }

// void print_vec(vector<long long>& a){
// 	for(int i=0;i<a.size();i++)
// 		cout << a[i] << (i<n-1 ? " ":"\n");
// }

// void solve_kick_start(int test_case){

// }

void solve(){
	int n;
	cin>>n;
	vector<long long> arr(n,0ll);

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

	long long x=0,y=0;
	int l=0,r=n-1;
	while(l<=r){
		if(x <= y){
			x += arr[l];
			l++;
		}
		else{
			y += arr[r];
			r--;
		}
	}
	long long ans = abs(x-y);
	cout << ans <<"\n";
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);

	// // CodeChef Template
	// int t;       
	// cin >> t;
	// while(t--){
	// 	solve();
	// }

	// Single test case input
	solve();

	// // Kick Start Template	
	// int test_cases;
	// cin >> test_cases;
	// for(int i=1;i<=test_cases;i++){
	// 	solve_kick_start(i);
	// }

	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;

int main(){

    int n, k; cin >> n >> k;

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

    int ans = 1e9;
    for(int i=0; i<=n-k; i++){
        int temp;
        if(x[i] >= 0 && x[k+i-1] >= 0){
            temp = x[k+i-1];
        }
        else if(x[i] <= 0 && x[k+i-1] <= 0){
            temp = abs(x[i]);
        }
        else{
            temp = min(2*abs(x[i])+abs(x[k+i-1]), 2*abs(x[k+i-1])+abs(x[i]));
        }
        ans = min(ans, temp);
    }

    cout << ans;

    return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		TreeMap<Integer, int[]> tMap = new TreeMap<>();
		for (int i = 0; i < M; i++) {
			int[] a = new int[2];
			a[0] = sc.nextInt();
			a[1] = i;
			int b = sc.nextInt();
			tMap.put(b, a);
		}

		String[] ans = new String[M];
		int[] num = new int[N + 1];

		for (int[] c : tMap.values()) {
			num[c[0]]++;
			ans[c[1]] = String.format("%06d%06d", c[0], num[c[0]]);
		}

		for (int i = 0; i < M; i++) {
			System.out.println(ans[i]);
		}
	}

}

Measured memory_bytes: 160400
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;

struct Sieve {
    int n;
    vector<int> f, primes;
    Sieve(int n = 1) : n(n), f(n + 1) {
        f[0] = f[1] = -1;
        for (ll i = 2; i <= n; ++i) {
            if (f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for (ll j = i * i; j <= n; j += i) {
                if (!f[j]) f[j] = i;
            }
        }
    }
    bool isPrime(int x) {
        return f[x] == x;
    }
    vector<int> factorList(int x) {
        vector<int> res;
        while (x != 1) {
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<pair<int, int>> factor(int x) {
        vector<int> fl = factorList(x);
        if (fl.size() == 0) return {};
        vector<pair<int, int>> res(1, pair<int, int>(fl[0], 0));
        for (int p : fl) {
            if (res.back().first == p) {
                res.back().second++;
            } else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

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

    int ans = 0;
    for (int i = 1; i <= N; i += 2) {
        int tmp = 1;
        for (auto e : sieve.factor(i)) {
            tmp *= (e.second + 1);
        }
        if (tmp == 8) ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
main = do
    str <- getLine
    let [h, w] = map read $ words $ str :: [Int]
    if h == 0 && w == 0
        then return ()
        else do
            let list = [if even x then "#" else "." | x <- [0..w]]
            putStrLn . unlines $ [if even y then concat $ init list else concat $ tail list | y <- [0..h-1]]
            main

Measured memory_bytes: 4072
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
#include <set>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (ll i = 0; i < n; ++i) cin >> a[i];
    vector<ll> res(n);
    ll s = a[0];
    for (int i = 1; i < n; ++i)
    {
        s ^= a[i];
    }
    for (int i = 0; i < n; ++i)
    {
        res[i] = s ^ a[i];
    }
    for (int i = 0; i < n; ++i)
    {
        cout << res[i];
        if (i != n - 1) cout << " ";
        else cout << "\n";
    }
    return 0;
}


Measured memory_bytes: 6276
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

ll fc(vector<int> &ld, vector<int> &c, int d){
  ll ret = 0;
  rep(i, 26){
    ret += c.at(i)*(d - ld.at(i));
  }
  return ret;
}

int main(){
  vector<int> ld(26, -1);
  int d;
  cin >> d;
  vector<int> c(26);
  rep(i, 26) cin >> c.at(i);
  vector<vector<int>> s(d, vector<int>(26));
  rep(i, d){
    rep(j, 26){
      int in;
      cin >> in;
      s.at(i).at(j) = in;
    }
  }
  ll ans = 0;
  rep(i, d){
    int t;
    cin >> t;
    t--;
    ld.at(t) = i;
    ans += s.at(i).at(t);
    ans -= fc(ld, c, i);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 3648
n, a, b = map(int, input().split())

sum_lst = []

for i in range(1, n+1):
    i_lst = list(str(i))
    sums = 0
    for j in i_lst:
        sums += int(j)
    if a <= sums <= b:
        sum_lst.append(int(i))

print(sum(sum_lst))

Measured memory_bytes: 3296
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>
#include <deque>
#include <bitset>
#include <cassert>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
const int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
// adjust problem by problem
const double EPS=1e-8;
const double PI=acos(-1.0);
#ifdef __GNUC__
int popcount(int n){return __builtin_popcount(n);}
int popcount(ll n){return __builtin_popcountll(n);}
#endif
#ifndef __GNUC__
template<class T> int popcount(T n){int cnt=0;while(n){if(n%2)cnt++;n/=2;}return cnt;}
#endif
template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> void PrintSeq(T &a,int sz){for(int i=0;i<sz;i++){cout<<a[i];if(sz==i+1)cout<<endl;else cout<<' ';}}
bool EQ(double a,double b){return abs(a-b)<EPS;}
void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}
vector<string> split(string str,char del){
  vector<string> res;
  for(int i=0,s=0;i<SIZE(str);i++){
    if(str[i]==del){if(i-s!=0)res.push_back(str.substr(s,i-s));s=i+1;}
    else if(i==SIZE(str)-1){res.push_back(str.substr(s));}
  }
  return res;
}


int main(){

  string str;
  string exp;
  vector<string> v;
  while(getline(cin,str)){
    if(str=="=")break;
    v.push_back(str);
  }
  int now=StringToInt<int>(v[0]);
  for(int i=1;i<(int)v.size();i++){
    string str=v[i];
    if(str=="+"){
      i++;
      int num=StringToInt<int>(v[i]);
      now+=num;
    }
    else if(str=="-"){
      i++;
      int num=StringToInt<int>(v[i]);
      now-=num;
    }
    else if(str=="*"){
      i++;
      int num=StringToInt<int>(v[i]);
      now*=num;
    }
    else{
      i++;
      int num=StringToInt<int>(v[i]);
      now/=num;
    }
  }
  cout<<now<<endl;
  
  return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void IO()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

void solve()
{
    int n,m;
    cin>>n>>m;
    if(m>=n){
        cout<<"Yes\n";
    }
    else
    {
        cout<<"No\n";
    }
    
}

int main()
{
    //IO();
    int t=1;
    //cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

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

const int64_t MOD = 1000000007;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef unsigned long long ull;


// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
      v[k][j] %= MOD;
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;


signed main() {
  int h,w;
  cin >> h >> w;
 
  string s[h];
  int row[h][w] = {};
  int col[h][w] = {};
  for(int i=0;i<h;i++){
    cin >> s[i];
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if('.'==s[i][j]){
        if(i>0){
          col[i][j] = col[i-1][j] + 1;
        }
        else{
          col[i][j] = 1;
        }
        if(j>0){
          row[i][j] = row[i][j-1] + 1;
        }
        else{
          row[i][j] = 1;
        } 
      }
    }
  }
  int maxGrid = 0;
  for(int i=h-1;i>=0;i--){
    for(int j=w-1;j>=0;j--){
      if(i<h-1 && col[i][j]>0 && col[i][j]<col[i+1][j]){
         col[i][j] = col[i+1][j];
      }
      if(j<w-1 && row[i][j]>0 && row[i][j]<row[i][j+1]){
         row[i][j] = row[i][j+1];
      }
      maxGrid = max(maxGrid, row[i][j]+col[i][j]-1);
    }
  }

  cout << maxGrid << endl;

  return 0;
}




Measured memory_bytes: 42388
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<set>
#include<stdio.h>
#include<ctype.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int ans = 0;
	int a;
	cin >> a;
	int b;
	for (int i = 1; i < n; i++)
	{
		cin >> b;
		if (a < b)
		{
			ans++;
		}
		a = b;


	}
	cout << ans << endl;
}




Measured memory_bytes: 3116
s=input()

def check(s):
    if s=="A" or s=="T" or s=="G" or s=="C":
        return True
    else:
        return False

count=0
max_count=0
for i in s:
    if check(i):
        count+=1
    else:
        
        max_count=max(max_count,count)
        count=0

print(max(max_count,count))

Measured memory_bytes: 3060
import math
n,a,b=map(int,input().split())
mod=10**9+7
a_tmp=1
b_tmp=1
for i in range(a):
    a_tmp*=(n-i)
    a_tmp%=mod
for i in range(b):
    b_tmp*=(n-i)
    b_tmp%=mod

nca=a_tmp*pow(math.factorial(a),mod-2,mod)%mod
ncb=b_tmp*pow(math.factorial(b),mod-2,mod)%mod

print((pow(2,n,mod)-1-nca-ncb)%mod)

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

int main() {
    int h, w;
    cin >> h >> w;
    char s[h][w];
    rep(y, h) rep(x, w) cin >> s[y][x];

    int ans = 0;
    rep(y, h) rep(x, w) {
        if (s[y][x] == '.') continue;

        bool ok = false;
        for (int dy = -1; dy <= 1; dy += 2) {
            int my = y + dy;
            if (my >= 0 && s[my][x] == '#') ok = true;
        }
        for (int dx = -1; dx <= 1; dx += 2) {
            int mx = x + dx;
            if (mx >= 0 && s[y][mx] == '#') ok = true;
        }

        if (!ok) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}


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

bool solve(){
	ll n,m;
	ll x[500005];
	cin >> n >> m;
	if(n + m == 0){
		return false;
	}

	for(ll i=0;i<n;i++){
		cin >> x[i];
	}
	ll i,j;
	ll ans = -100;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(i == j)continue;
			if(x[i] + x[j] <= m){
				ans = max(ans,x[i] + x[j]);
			}
		}
	}
	if(ans == -100){
		cout << "NONE" << endl;
	}else{
		cout << ans << endl;
	}
	return true;

}



int main(){
	while(solve()){}
	
}



Measured memory_bytes: 3092
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#define ll long long
#define l long
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define pii pair<int,int>
#define maxn 100005
using namespace std;
signed main()
{
    fast;
    
    int n;
    cin>>n;
    string s;
    cin>>s;
    if(n&1)cout<<"No";
    else
    {
    	string s1 = s.substr(0,n/2);
    	string s2 = s.substr(n/2,n/2);
    	if(s1.compare(s2)==0) cout<<"Yes";
    	else cout<<"No";
    }
}

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

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);


// AGC013A - Sorted Arrays
int main(){
  int n; // 1 <= N <= 1e5
  cin >> n;
  vector<int64_t> A(n+10, 0); // 1 <= Ai <= 1e9
  rep(i, n) {
    cin >> A[i];
  }

  // 単調非減少または単調非増加な列
  int splitCount = 0;
  int64_t elemFirstA = 0;
  int64_t elemSecondA = 0;
  int64_t elemLatestA = 0;
  bool elemNonDec = true; // 単調非減少:true, 単調非増加:false
  rep(i, n) {
    const int64_t ai = A[i];
    if (elemFirstA == 0) { // 1個目を確定
      elemFirstA = ai;
      elemLatestA = ai;
      //cout << "1個目確定 i:" << i << ",elemFirstA:" << elemFirstA << endl;
    } else if (elemSecondA == 0) { // まだ方向性が決まっていない
      if (elemFirstA != ai) { // 方向性確定
        elemSecondA = ai;
        elemLatestA = ai;
        if (elemFirstA < elemSecondA) {
          elemNonDec = true;
        } else {
          elemNonDec = false;
        }
      //cout << "方向性確定 i:" << i << ",elemSecondA:" << elemSecondA << ",elemNonDec:" << elemNonDec << endl;
      }
    } else { // すでに方向性が決まっている
      //cout << "check i:" << i << ",elemLatestA:" << elemLatestA << ",ai:" << ai << endl;
      if (elemNonDec) {
        // 単調非減少
        if (elemLatestA > ai) {
          // 数列を分ける必要がある
          //cout << "split NonDec i:" << i << ",ai:" << ai << endl;
          ++splitCount;
          elemFirstA = ai;
          elemSecondA = 0;
        }
        elemLatestA = ai;
      } else {
        // 単調非増加
        if (elemLatestA < ai) {
          //cout << "split NonInc i:" << i << ",ai:" << ai << endl;
          // 数列を分ける必要がある
          ++splitCount;
          elemFirstA = ai;
          elemSecondA = 0;
        }
        elemLatestA = ai;
      }
    }
  }

  cout << splitCount + 1 << endl;
  return 0;
}



Measured memory_bytes: 1024
/*{{{*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
using namespace std;
typedef pair<int, int> PP;
typedef long long LL;
#define pb push_back
#define fr first
#define sc second
#define bitcnt __builtin_popcount
#define all(x) x.begin(), x.end()
inline int ri() {int x; scanf("%d", &x); return x;}
#define rep2(i, n, ...) for (int i = 0; i < (n); i ++) 
#define rep3(i, a, b, ...) for (int i = (a); i < (b); i ++)
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define drep2(i, n, ...) for (int i = (n) - 1; i >= 0; i --)
#define drep3(i, a, b) for (int i = (a) - 1; i >= (b); i --)
#define drep(...) GET_MACRO(__VA_ARGS__, drep3, drep2)(__VA_ARGS__)
template<typename T>inline bool smax(T&a, T b){if(a<b){a=b;return true;}return false;} 
template<typename T>inline bool smin(T&a, T b){if(a>b){a=b;return true;}return false;} 
/*}}}*/


int n, a[10000];
multiset<int> s;

bool rm(int x) {
  //cerr << x << endl;
  if (s.find(x) != s.end()) {
    s.erase(s.find(x));
    return true;
  }
  cout << "Impossible" << endl;
  exit(0);
  return false;
}
int main() {
  #ifdef _TEST_
  freopen("input.txt", "r", stdin);
  //freopen("out.txt", "w", stdout);
  #endif
  cin >> n;
  rep(i, n)  cin >> a[i];
  sort(a, a + n);
  rep(i, n) s.insert(a[i]);
  int d = a[n - 1];
  rep(i, d + 1) 
    rm(max(d - i, i));

  for (int x : s) if (x <= (d + 1) / 2) {
    rm(-1);
  }
  cout << "Possible" << endl;

  return 0;
}


Measured memory_bytes: 384
n = int(input())
A = list(map(int, input().split()))

# n = 5
# A = [2,4, 6]

cnt = 0

while True:
    exist_odd = False
    for a in A:
        if a % 2 == 0:
            continue
        else:
            exist_odd = True
            break 
    if exist_odd: 
        break
    A = [a/2 for a in A]
    cnt = cnt + 1
print(cnt)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 30;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - '0';}
char myitoc(int N) {return '0' + N;}

struct edge
{
  int to, cost;
  edge(int to, int cost) : to(to), cost(cost) {}
};

signed main()
{
  int N, M, P;
  cin >> N >> M >> P;
  vector<vector<edge>> G(N);
  for (int i = 0; i < M; i++)
  {
    int a, b, c;
    cin >> a >> b >> c;
    a--, b--;
    G.at(a).push_back(edge(b, P - c));
  }

  vector<int> d(N, INF);
  d.at(0) = 0;
  for (int i = 0; i < 2 * N; i++)
  {
    for (int v = 0; v < N; v++)
    {
      for (int k = 0; k < G.at(v).size(); k++)
      {
        edge e = G.at(v).at(k);
        if (d.at(v) != INF && chmin(d.at(e.to), d.at(v) + e.cost))
        {
          if (i >= N - 1)
          {
            d.at(e.to) = -INF;
          }
        }
      }
    }
  }

  if (-d.at(N - 1) >= INF)
    cout << -1 << endl;
  else
    cout << max((int)0, -d.at(N - 1)) << endl;
}


Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin >> a >> b;
    int r=0;
    for(int i=a;i<=b;i++){
        int e = i % 10;
        int f = i / 10000 % 10;
        int g = i / 10 % 10;
        int h = i / 1000 % 10;
        if(e == f && g == h){
            r++;
        }
    }
    cout << r << endl;
    return 0;
}

Measured memory_bytes: 256