akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <queue>
#include <map>
#include <string>
#include <vector>
#include <set>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#define ll long long
#define chushihua(x,y) memset(x,y,sizeof x)
using namespace std;
const int MAXX = 100000 + 10;
const double PI = 3.14159265358979323846;
const ll mod = 1000000007;
int main() {
	int a, b, c;
	int x[10];
	while (cin >> a >> b >> c) {
		chushihua(x, 0);
		x[a]++;
		x[b]++;
		x[c]++;
		if (x[5] == 2 && x[7] == 1) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	
	return 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li a[100100];

int main() {
    li n;
    cin >> n;
    li last = 0;
    rep(i, n + 1) {
        cin >> a[i];
        last += a[i];
    }
    li branch = 1;
    li res = 0;
    rep(i, n + 1) {
        if (branch < a[i]) {
            puts("-1");
            return 0;
        }
        res += branch;
        branch -= a[i];
        last -= a[i];
        branch = min(branch * 2, last);
        //p3(i, res, branch);
    }
    cout << res << endl;


    return 0;
}

Measured memory_bytes: 4428
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
const ll INF = 10000000000000;
#define all(v) v.begin(), v.end()


int main(){
  ll K;
  cin >> K;
  cout << 50 << endl;
  rep(i,50){
    cout << (K+49-i)/50+50-(50+K-1-i)%50-1 << " ";
  }
  cout << endl;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
const int SIZE=262144;
struct SegTree{
	ll f[SIZE<<2]={};
	void addpoint(int pos,int v){
		pos+=SIZE-1; 
		f[pos]=v;
		while(pos){
			pos=pos-1>>1;
			f[pos]=min(f[pos+pos+1],f[pos+pos+2]);
		}
	}
	ll query(int l,int r,int l1=0,int r1=SIZE-1,int k=0){
		if(l<=l1&&r1<=r)return f[k];
		if(r<l1||r1<l)return (ll)1e18;
		int mid=l1+r1>>1;
		ll vl=query(l,r,l1,mid,k+k+1);
		ll vr=query(l,r,mid+1,r1,k+k+2);
		return min(vl,vr);
	}
}odd,even;
int n,cnt=0;
int a[222222],pos[222222];
set<pair<int,pair<int,int> > >S;
void add_set(int l,int r){
	if(l>=r)return;
	int T1=(l&1?odd.query(l,r-1):even.query(l,r-1)),T2=(pos[T1]&1?even.query(pos[T1],r):odd.query(pos[T1],r));
	if(T2>=3e5)return;
	S.insert(make_pair(T1,make_pair(l,r)));
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)pos[a[i]]=i;
	for(int i=1;i<=n;i+=2)odd.addpoint(i,a[i]),even.addpoint(i,inf);
	for(int i=2;i<=n;i+=2)even.addpoint(i,a[i]),odd.addpoint(i,inf);
	add_set(1,n);
	while(S.begin()!=S.end()){
		int v1=S.begin()->first;
		pair<int,int>segment=S.begin()->second;
		int v2=(pos[v1]&1?even.query(pos[v1],segment.second):odd.query(pos[v1],segment.second));
		cout<<v1<<" "<<v2<<" ";
		odd.addpoint(pos[v1],inf);even.addpoint(pos[v1],inf);
		odd.addpoint(pos[v2],inf);even.addpoint(pos[v2],inf);
		S.erase(S.begin());int l,r;tie(l,r)=segment;
		add_set(l,pos[v1]-1);add_set(pos[v1]+1,pos[v2]-1);add_set(pos[v2]+1,r);
	}
	return 0;
}

Measured memory_bytes: 16128
s=input()
n=[0]
ss=[]
for c in s:
    if c=='x':
        n[-1]+=1
    else:
        ss.append(c)
        n.append(0)
if all([ss[i]==ss[-1-i] for i in range(len(ss)//2)]):
    print(sum([abs(n[i]-n[-1-i]) for i in range(len(n)//2)]))
else:
    print(-1)

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

using namespace std;

template <typename T>
class fenwick {
 public:
  vector<T> fenw;
  int n;

  fenwick(int n) : n(n) {
    fenw.resize(n);
  }

  void modify(int x, T v) {
    while (x < n) {
      fenw[x] += v;
      x |= (x + 1);
    }
  }

  T get(int x) {
    T v{};
    while (x >= 0) {
      v += fenw[x];
      x = (x & (x + 1)) - 1;
    }
    return v;
  }
};

struct query {
  int l;
  int r;
  int id;
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  vector<pair<int, int>> a(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i].first >> a[i].second;
  } 
  sort(a.rbegin(), a.rend(), [](pair<int, int> x, pair<int, int> y) {
    return x.second > y.second;
  });
  fenwick<int> fenw(555);
  for (auto x : a) {
    fenw.modify(x.first, 1);
  }
  vector<query> b(q);
  for (int i = 0; i < q; ++i) {
    cin >> b[i].l >> b[i].r;
    b[i].id = i;
  }
  sort(b.rbegin(), b.rend(), [](query x, query y) {
    return x.r > y.r;
  });
  vector<int> ans(q);
  while (!b.empty()) {
    auto cur_query = b.back();
    while (!a.empty() && a.back().second > cur_query.r) {
      fenw.modify(a.back().first, -1);
      a.pop_back();
    }
    ans[cur_query.id] = fenw.get(554) - fenw.get(cur_query.l - 1);
    b.pop_back();
  }
  for (int i = 0; i < q; ++i) {
    cout << ans[i] << '\n';
  }
  return 0;
}

Measured memory_bytes: 4096
_ = input()
orders = [int(i) for i in input().split(" ")]
score = [int(i) for i in input().split(" ")]
c_score = [int(i) for i in input().split(" ")]

result = 0
before_dish_no = 0
for n in orders:
  result += score[n-1] + c_score[n-2] if (n is not 1) and (before_dish_no+1 == n) else score[n-1]
  before_dish_no = n

print(result)

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

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int get;
  cin >> get;
  long long sum = 0;
  for(int i = 1; i <= get; i++){
    if(!(i%3 == 0 || i%5 == 0))
      sum += i;
  }
  cout << sum;
  return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



struct Info{
	Info(int arg_num,int arg_loc){
		num = arg_num;
		loc = arg_loc;
	}
	bool operator<(const struct Info &arg) const{
		if(num != arg.num){
			return num < arg.num; //数字が大きいほど上
		}else{
			return loc > arg.loc; //数字が小さいほど上
		}
	}

	int num,loc;
};

int N,K;

int main(){

	scanf("%d %d",&N,&K);

	priority_queue<Info> Q;

	int tmp;
	int rest = N,need_out = N-K,out = 0;
	int pre_loc = BIG_NUM;

	for(int i = 0; i < N; i++){

		scanf("%d",&tmp);
		Q.push(Info(tmp,i));
		rest -= 1;

		if(out+rest >= need_out)continue; //まだ出力は不要

		printf("%d",Q.top().num);
		out += 1;
		pre_loc = Q.top().loc;

		while(Q.empty() == false && Q.top().loc <= pre_loc)Q.pop();
	}
	printf("\n");

	return 0;
}



Measured memory_bytes: 4852
// AUTHOR : Kishan Srivastav
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define in freopen("input.txt", "r", stdin)
#define out freopen("output.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}

int main() {
	ios
#ifndef ONLINE_JUDGE
	in;
	out;
#endif
	int p,q,r;
	cin>>p>>q>>r;
	cout <<p+q+r - max({p,q,r})<<endl;
}

Measured memory_bytes: 3512
def Fanc(x):
    ans = 0
    while x > 0:
        ans += x % 10
        x = x // 10
    return ans     
    
N,A,B = map(int,input().split())
sum = 0
for i in range(1,N + 1):
    if A <= Fanc(i) and Fanc(i) <= B:
        sum += i
print(sum)

Measured memory_bytes: 3060
using System;
using System.Linq;
using System.Collections.Generic;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var ws = new string[n];
        for (int i = 0; i < ws.Length; i++)
        {
            ws[i] = Console.ReadLine().Trim();
        }

        var set = new HashSet<string>(ws);
        if (set.Count < ws.Length)
        {
            Console.WriteLine("No");
            return;
        }

        for (int i = 1; i < ws.Length; i++)
        {
            if (ws[i - 1].Last() != ws[i].First())
            {
                Console.WriteLine("No");
                return;
            }
        }
        Console.WriteLine("Yes");
    }
}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9
#define MOD 1000000007

using namespace std;
typedef long long int lli;
typedef long long ll;

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

    lli ans = n*(n-1)/2;
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define ld double
#define mp make_pair
#define pb push_back
#define mod 1000000007
#define ff first
#define ss second
#define pll pair <ll,ll>
#define nl "\n"
const int L = 1<<22 + 5;
ll n;
ll a[22][22];
int dp[L];
ll getSetBits(ll mask)
{
	ll cnt=0;
	while(mask>0)
	{
		if(mask%2)cnt++;
		mask/=2;
	}
	return cnt;
}
ll fx(ll mask)
{
	ll idx = getSetBits(mask);
	if(idx == n)
	{
		if(mask == (1<<n) - 1)
			return dp[mask]=1;
		else
			return dp[mask]=0;
	}
	if(dp[mask] != -1)
		return dp[mask];
	ll su = 0;
	for(int i=0;i<n;i++)
	{
		if(mask&(1<<i))
			continue;
		if(a[idx][i])
			su = (su + fx(mask | (1<<i)))%mod;
	}
	return dp[mask] = su;
} 
int main()
{
	ios_base::sync_with_stdio(false);
	cin>>n;
	ll i,j;
	for(i=0;i<n;i++)
		for(j=0;j<n;j++)
			cin>>a[i][j];
	for(i=0;i<L;i++)
		dp[i]=-1;
	cout<<fx(0)<<nl;
	return 0;
}

Measured memory_bytes: 527908
#include <bits/stdc++.h>
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define sz(v) (int)(v).size()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int x, a;
	cin >> x >> a;
	if (x < a) cout << 0 << '\n';
	else cout << 10 << '\n';


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {

    int n;
    cin >> n;

    vector<int> v(n);

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

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

    cout << v[n/2] - v[n/2 - 1] << endl;

    return 0;
}

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

inline int read()
{
	int ret=0; char c=getchar();
	while(c<48||c>57)c=getchar();
	while(c>=48 && c<=57)ret=ret*10+c-48,c=getchar();
	return ret;
}

int main()
{
	int n,d;
	n=read();d=read();
	printf("%d",1+(n-1)/(d*2+1));
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define itn int
#define int long long
#define mod 1000000007
#define INFi 2147483647
#define INFl 9223372036854775807LL

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);    
    int a[1000000];
    int b,c,d=0,e=0,j=0,q,x,y;
    b=1,c=1;
    for(int i=0;i<b;i++){
      cin>>e;
      a[i]=e;
    }
    e=1;
    for(int i=0;i<b;i++){
      x=1;
      while(true){
	if(a[j]<=c) break;
	a[j]/=2;
	x++;
      }
      q=0;
      for(int k=0;k<x-1;k++) {
	y=2;
	y=y<<k;
	q=(y+q);//%1000000007;
      }
    j++;
    d=(d+q);//%1000000007;
    }
    cout<<d+b<<"\n";
}


Measured memory_bytes: 256
k, t = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
pre_index = 10**5
for i in range(k):
    max_value = 0
    max_index = 0
    for j in range(len(a)):
        if a[j] > max_value:
            max_value = a[j]
            max_index = j
    
    if pre_index != max_index:
        a[max_index] -= 1
        pre_index = max_index
    else:
        second_max_value = 0
        second_max_index = 0
        for j in range(len(a)):
            if j != max_index and a[j] > second_max_value:
                second_max_value = a[j]
                second_max_index = j
        if second_max_value == 0:
            a[max_index] -= 1
            pre_index = max_index
            ans += 1
        else:
            a[second_max_index] -= 1
            pre_index = second_max_index

print(ans)


Measured memory_bytes: 3064
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

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

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

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

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
void judgement(int a){
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  if(a){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int main(){
  ll i,ans;
  vec t(2),a(2),b(2),sa(2);
  rep(i,2)cin>>t[i];
  rep(i,2){cin>>a[i];a[i]*=t[i];}
  rep(i,2){cin>>b[i];b[i]*=t[i];}
  a[1]+=a[0];b[1]+=b[0];
  if(a[1]==b[1]){
    cout<<"infinity"<<endl;
    return 0;
  }
  if((a[0]<b[0]&&a[1]<b[1])||(a[0]>b[0]&&a[1]>b[1])){
    cout<<0<<endl;
    return 0;
  }
  rep(i,2)sa[i]=abs(a[i]-b[i]);
  //output(sa);
  if(sa[0]==sa[1]){
    cout<<2<<endl;
    return 0;
  }else if(sa[0]<sa[1]){
    cout<<1<<endl;
    return 0;
  }
  ans=sa[0]/sa[1];
  ans=ans*2+1;
  if(sa[0]%sa[1]==0)ans--;
  cout<<max(ans,1LL)<<endl;
  return 0;
}

Measured memory_bytes: 256
import math
a, b, h, m = map(int, input().split())

s = abs((h/12) * 360 + 30 *(m/60) - (m/60) * 360)
R = min(360 - s, s)
ans = (a**2 + b**2 - 2*a*b*math.cos(math.radians(R)))**(1/2)
print(ans)

Measured memory_bytes: 9568
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
	int a[1001]={};
	int b;
	for(int i=0;i<33;i++){
		b=i;
		for(int j=0;j<11;j++){
			b*=i;
			if(b>1000)break;
			else{a[b]=b;}
		}
	}
	int x,c=1;
	cin>>x;
	for(int i=0;i<=x;i++){
		if(a[i]!=0){
			c=a[i];
		}
	}
	cout<<c<<endl;
	return 0;
}					

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,q,l,r;
int a[100005];
string s;
int main()
{
    cin>>n>>q;
    cin>>s;
    for(int i=1;i<n;i++)
    { 
        if(s[i]=='C'&&s[i-1]=='A') a[i]++;
        a[i]+=a[i-1];
    }
    for(int i=1;i<=q;i++)
    {
        cin>>l>>r;
        l--,r--;
        cout<<a[r]-a[l]<<endl;
    }
    return 0;
}


Measured memory_bytes: 1408
aj = input()
a1 = [str(i%2) for i in range(len(aj))]
a2 = [str((i+1)%2) for i in range(len(aj))]
cnt1=cnt2=0
for i in range(len(aj)):
  if aj[i]==a1[i]:
    cnt1+=1
  if aj[i]==a2[i]:
    cnt2+=1
print(min(cnt1,cnt2))

Measured memory_bytes: 15860
ab = list(input().split())
a = int(ab[0])
b = ab[1]
ans = 0
# ans += a*int(b[0])
# ans += a*int(b[2])*0.1
# ans += a*int(b[3])*0.01


# import math
# anss = math.floor(ans)
# print(anss)

ans += a*int(b[0])*100
ans += a*int(b[2])*10
ans += a*int(b[3])
ans //= 100
print(ans)




Measured memory_bytes: 61860
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P  = pair<int,int>;
using v  = vector<ll>;
using vv = vector<v>;
//const int MOD = 1000000007;
const int MOD = 998244353;
const ll INF = 1001001001001;

int main(){
    ll n,s;cin>>n>>s;
    
    vv dp(n+1, v (s+2, 0));
    dp[0][0] = 1;
    
    ll a;
    
    rep(i,n){
        cin>>a;
        
        for(int j=s; j>=0; j--){
            dp[i+1][j] = 2 * dp[i][j];
            dp[i+1][j] %= MOD;
        }
        
        for(int j=s-a; j>=0; j--){
            dp[i+1][j+a] += dp[i][j];
            dp[i+1][j+a] %= MOD;
        }
    }
    
    cout << dp[n][s] << endl;
    
    return 0;
}

Measured memory_bytes: 73724
#include<bits/stdc++.h>
using namespace std;
//#pragma gcc optimize("O3")
//#pragma gcc optimize("unroll-loops")
#ifdef EVAH
    #define _WIN32_WINNT 0x0500
    #include<windows.h>
#endif
#define openFile(n) ShellExecute(nullptr,"open",n,nullptr,nullptr,SW_SHOWNORMAL);
#define closeP(n) system((string("taskkill /im ")+n+" /f").c_str());
#define closeConsole PostMessage(GetConsoleWindow(), WM_CLOSE, 0, 0);
#define opf "output.txt"
#define ipf "input.txt"
#define mem(n,x) memset(n,x,sizeof(n));
#define sf scanf
#define pf printf
#define ff first
#define ss second
#define pb push_back
#define PII pair<int,int>
#define For(x,n) for(int i=x; i<n; i++)
#define stv v+2*(mid-tl+1)
#define LL long long int
#define PI acos(-1.0)
#define N 100000000

LL trailingZeroes(LL n) {
    LL pows = log(n)/log(5),ans=0;
    for(LL i=1; i<=pows; i++) {
        LL temp = 2*round(pow(5,i));
        if(temp>n) break;
        ans += n/temp;
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    #ifdef EVAH
        //freopen(ipf,"r",stdin);
        //openFile(ipf);
        //closeConsole;
        //freopen(opf,"w",stdout);
    #endif

    LL n;
    cin >> n;
    if(n&1) cout << 0 << "\n";
    else cout << trailingZeroes(n) << "\n";

    #ifdef EVAH
        //openFile(opf);
        //Sleep(3000);
        //closeP("notepad.exe");
        //closeConsole;
    #endif
}


Measured memory_bytes: 4032
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int x = a + b + c;
  if(22<=x)
    cout << "bust" << endl;
  else
    cout << "win" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <sstream>
#include <fstream>
#include <iomanip>

#define rep(i,a,b) for(long long i=a;i<b;i++)
using namespace std;

int main(void) {

	long long N = 0, D = 0, A = 0, B = 0, C = 0;
	//char x[100] = {‘+’,’*’,’x’}

	string x = "+*x";

	cin >> A >>B;
	
if(A+B==15)
cout << x[0] << endl;
else if(A*B==15)
	cout <<x[1] << endl;
	else
cout << x[2]<< endl;

	return 0;

}


Measured memory_bytes: 256
import numpy as np
N=int(input())
A=[int(input()) for i in range(N)]
A=np.array(sorted(A))
ans=0

lenA=len(A)
mid=lenA//2

if lenA%2==0:
    ans+=A[mid]
    ans-=A[mid-1]
    if N>2:
        ans+=2*sum(A[mid+1:])
        ans-=2*sum(A[:mid-1])
else:
    ans+=A[mid]+A[mid+1]
    ans-=2*sum(A[:mid])
    
    tmp=2*sum(A[mid+1:])
    tmp-=A[mid]+A[mid-1]
    if N>3:
        ans+=2*sum(A[mid+2:])
        tmp-=2*sum(A[:mid-1])
    ans=max(ans,tmp)
print(ans)

Measured memory_bytes: 26520
n = int(input())
s = input()
num_e = [0]
num_w = [0]
ans = 999999999999

for i in range(n):
    num_w.append(num_w[i])
    if s[i] == "W":
        num_w[i + 1] += 1
    num_e.append(num_e[i])
    if s[i] == "E":
        num_e[i + 1] += 1

for i in range(n):
    now = num_w[i] + num_e[-1] - num_e[i + 1]
    if ans > now:
        ans = now

print(ans)


Measured memory_bytes: 17644
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//BEGIN CUT HERE
template <typename T,typename E>
struct SegmentTree{
  typedef function<T(T,T)> F;
  typedef function<T(T,E)> G;
  typedef function<E(E,E)> H;
  typedef function<E(E,int)> P;
  int n;
  F f;
  G g;
  H h;
  T d1;
  E d0;
  P p;
  vector<T> dat;
  vector<E> laz;
  SegmentTree(int n_,F f,G g,H h,T d1,E d0,
	      vector<T> v=vector<T>(),P p=[](E a,int b){return a;}):
    f(f),g(g),h(h),d1(d1),d0(d0),p(p){
    init(n_);
    if(n_==(int)v.size()) build(n_,v);
  }
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    dat.clear();
    dat.resize(2*n-1,d1);
    laz.clear();
    laz.resize(2*n-1,d0);
  }
  void build(int n_, vector<T> v){
    for(int i=0;i<n_;i++) dat[i+n-1]=v[i];
    for(int i=n-2;i>=0;i--)
      dat[i]=f(dat[i*2+1],dat[i*2+2]);
  }
  inline void eval(int len,int k){
    if(laz[k]==d0) return;
    if(k*2+1<n*2-1){
      laz[k*2+1]=h(laz[k*2+1],laz[k]);
      laz[k*2+2]=h(laz[k*2+2],laz[k]);
    }
    dat[k]=g(dat[k],p(laz[k],len));
    laz[k]=d0;
  }
  T update(int a,int b,E x,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return dat[k];
    if(a<=l&&r<=b){
      laz[k]=h(laz[k],x);
      return g(dat[k],p(laz[k],r-l));
    }
    return dat[k]=f(update(a,b,x,k*2+1,l,(l+r)/2),
		    update(a,b,x,k*2+2,(l+r)/2,r));
  }
  T update(int a,int b,E x){
    return update(a,b,x,0,0,n);
  }
  T query(int a,int b,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return d1;
    if(a<=l&&r<=b) return dat[k];
    T vl=query(a,b,k*2+1,l,(l+r)/2);
    T vr=query(a,b,k*2+2,(l+r)/2,r);
    return f(vl,vr);
  }
  T query(int a,int b){
    return query(a,b,0,0,n);
  }
  void update(int k,T x){
    query(k,k+1);//evaluate
    k+=n-1;
    dat[k]=x;
    while(k){
      k=(k-1)/2;
      dat[k]=f(dat[k*2+1],dat[k*2+2]);
    }
  }
};
//END CUT HERE
signed main(){
  int n,q;
  cin>>n>>q;
  SegmentTree<Int,Int> ch(n,
			  [](Int a,Int b){return a+b;},
			  [](Int a,Int b){return a+b;},
			  [](Int a,Int b){return a+b;},
			  0,0,vector<Int>(n,0),
			  [](Int a,Int b){return a*b;});
  for(int i=0;i<q;i++){
    int c,s,t,x;
    cin>>c;
    if(c){
      cin>>s>>t;
      cout<<ch.query(s-1,t)<<endl;
    }else{
      cin>>s>>t>>x;
      ch.update(s-1,t,x);
    }
  }
}

/*
  verified on 2017/12/01
  http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_G
*/



Measured memory_bytes: 8452
#include <stdio.h>
#include <math.h>
int main(void)
{
    double x1,y1,x2,y2;
    double x,y;
    scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
    x = x2 - x1;
    y = y2 - y1;
     
    printf("%lf\n",sqrt(x*x+y*y));
    return 0;
}


Measured memory_bytes: 2060
num = int(input())
string = [input() for _ in range(num)]
a = 1000
b = 1000
c = 1000
d = 1000
e = 1000
f = 1000
g = 1000
h = 1000
i1 = 1000
j = 1000
k = 1000
l = 1000
m = 1000
n = 1000
o = 1000
p = 1000
q = 1000
r = 1000
s = 1000
t = 1000
u = 1000
v = 1000
w = 1000
x = 1000
y = 1000
z = 1000

for i in range(num):
    a = min(string[i].count("a"), a)
    b = min(string[i].count("b"), b)
    c = min(string[i].count("c"), c)
    d = min(string[i].count("d"), d)
    e = min(string[i].count("e"), e)
    f = min(string[i].count("f"), f)
    g = min(string[i].count("g"), g)
    h = min(string[i].count("h"), h)
    i1 = min(string[i].count("i"), i1)
    j = min(string[i].count("j"), j)
    k = min(string[i].count("k"), k)
    l = min(string[i].count("l"), l)
    m = min(string[i].count("m"), m)
    n = min(string[i].count("n"), n)
    o = min(string[i].count("o"), o)
    p = min(string[i].count("p"), p)
    q = min(string[i].count("q"), q)
    r = min(string[i].count("r"), r)
    s = min(string[i].count("s"), s)
    t = min(string[i].count("t"), t)
    u = min(string[i].count("u"), u)
    v = min(string[i].count("v"), v)
    w = min(string[i].count("w"), w)
    x = min(string[i].count("x"), x)
    y = min(string[i].count("y"), y)
    z = min(string[i].count("z"), z)

for _ in range(a):
    print("a", end = "")
for _ in range(b):
    print("b", end = "")
for _ in range(c):
    print("c", end = "")
for _ in range(d):
    print("d", end = "")
for _ in range(e):
    print("e", end = "")
for _ in range(f):
    print("f", end = "")
for _ in range(g):
    print("g", end = "")
for _ in range(h):
    print("h", end = "")
for _ in range(i1):
    print("i", end = "")
for _ in range(j):
    print("j", end = "")
for _ in range(k):
    print("k", end = "")
for _ in range(l):
    print("l", end = "")
for _ in range(m):
    print("m", end = "")
for _ in range(n):
    print("n", end = "")
for _ in range(o):
    print("o", end = "")
for _ in range(p):
    print("p", end = "")
for _ in range(q):
    print("q", end = "")
for _ in range(r):
    print("r", end = "")
for _ in range(s):
    print("s", end = "")
for _ in range(t):
    print("t", end = "")
for _ in range(u):
    print("u", end = "")
for _ in range(v):
    print("v", end = "")
for _ in range(w):
    print("w", end = "")
for _ in range(x):
    print("x", end = "")
for _ in range(y):
    print("y", end = "")
for _ in range(z):
    print("z", end = "")

print()

Measured memory_bytes: 3320
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  
  int a;
  string s;
  cin>>a;
  cin>>s;
  if(a>=3200){
    cout<<s<<endl;
  }else{
    cout<<"red"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <set>          
#include <map>           
#include <list>
#include <ctime>
#include <deque>         
#include <bitset>        
#include <vector>
#include <list>
#include <stack>
#include <random>		 
#include <string>       
#include <numeric>      //  needed for  accumulate
#include <utility>     // needed for std:: move
#include <iterator> 
#include <fstream>
#include <iostream> 
#include <iomanip>  
#include <algorithm> 
#include <functional>    
#include <cmath>         
#pragma warning(disable:4996) // ignore this
#define ve vector
#define pb push_back
#define mp make_pair                     
#define srt(x) sort(x.begin(),x.end())         
#define mod static_cast<long long> (1e9+7)     
#define sumx(x) accumulate(x.begin(),x.end(),0LL)
#define int2 int64_t
#define pi 3.14159265358979323846
#define testing 0
#define code_chef 0
#define code_jam 0

using namespace std;
template<typename T>
istream& operator >> (istream& in, ve<T> &v)
{
	for (auto &x : v)
		scanf("%d",&x);
	return in;
}
template<typename T>
ostream& operator<<(ostream& in, ve<T> &v)
{
	for (auto &x : v)
		in << x << " ";
	return in;
}
long long fast(long long a,long long b,long long pr)
{
	if(b==0)
		return 1%pr;
	long long ans=1%pr;
	while(b)
	{
		if(b&1)
		{
			ans*=a;
			ans%=pr;
		}
		b>>=1;
		a*=a;
		a%=pr;
	}
	return ans;
}

class solve
{
public:
	solve()
	{
		string S;
		cin >> S;
		ve<int> v;
		for(auto &x:S)
			v.pb(x-'0');
		int op=0;
		for(int i=0;i<8;i++)
		{
			int ans=v[0];
			for(int j=1;j<4;j++)
			{
				if(i&(1<<(j-1)))
				{
					ans+=v[j];
				}
				else
					ans-=v[j];
			}
			if(ans==7)
			{
				cout << v[0];
				for(int j=1;j<4;j++)
			{
				if(i&(1<<(j-1)))
				{
					cout <<"+"<<v[j];
				}
				else
					cout <<"-"<<v[j];
			}
			cout <<"=7";
			return;
			}
		}
	}
};
int32_t main()
{
	int t = 1, i = 1;
	if (code_chef)
		scanf("%d", &t);
	while (t--)
	{
		if (code_jam)
			printf("Case #%d: ", i++);
		new solve;
	}
	return 0;
}

Measured memory_bytes: 256
import sys,random
input = sys.stdin.readline


def main():
    n = int(input())
    dg = 100000
    xy = []
    for _ in [0]*n:
        x,y = map(int,input().split())
        xy.append(x*dg+y)

    if n == 2:
        x,y = xy[0]//dg,xy[0]%dg
        a,b = xy[1]//dg,xy[1]%dg
        print(((x-a)**2+(y-b)**2)**0.5/2.0)
    else:
        res = -1
        for i in range(n):
            for j in range(i+1,n):
                for k in range(j+1,n):
                    a,b = xy[i]//dg,xy[i]%dg
                    c,d = xy[j]//dg,xy[j]%dg
                    e,f = xy[k]//dg,xy[k]%dg

                    d1 = ((a-c)**2+(b-d)**2)**0.5
                    d2 = ((a-e)**2+(b-f)**2)**0.5
                    d3 = ((e-c)**2+(f-d)**2)**0.5

                    if d1 < d2:
                        d1,d2 = d2,d1
                    if d1 < d3:
                        d1,d3 = d3,d1
                    
                    cos = (d2**2+d3**2-d1**2)/(2.0*d2*d3)
                    if cos <= 0 or cos >= 1.0-10**(-8):
                        res = max(res,d1/2.0)
                    else:
                        sin = (1-cos**2)**0.5
    
                        res = max(res,d1*0.5/sin)
              
        print(res)





    

if __name__ == '__main__':
    main()

Measured memory_bytes: 46060
#include<iostream>

int main(){
	
	int a1,a2,a3,b1,b2,b3,c;
	std::cin >>a1>>a2>>a3;
	
	b1=a1,b2=a2,b3=a3;
	if (b1>b2) c=b1, b1=b2, b2=c;
	if (b2>b3) c=b2, b2=b3, b3=c;
	if (b1>b2) c=b1, b1=b2 ,b2=c;
	
	std::cout << b1 <<" "<< b2 <<" "<< b3 <<"\n";
	
	return 0;
	
}

Measured memory_bytes: 1168
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;

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

//LLはlong long 型の接尾子？で<<はシフト演算子
const long long INF = 1LL << 60;

int N;
long long h[100010];

long long dp[100010];

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

  //最小化問題は0ではなく無限で初期化する
  for (int i = 0; i<100010; ++i)
    dp[i] = INF;

  dp[0] = 0;

  for (int i = 0; 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;
  
  return 0;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
// using Graph = vector<vector<int>>;
const ll mod = 998244353;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  int a[32] = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
               1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k;
  cin >> k;
  cout << a[k - 1] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <cmath>

using namespace std;

int main() {
	int N, ope;
	string A, B, C;
	cin >> N >> A >> B >> C;
	
	ope = 0;
	for (int i = 0; i < N; i++) {
		ope += max((A[i] != B[i]) + (B[i] != C[i]) + (C[i] != A[i]) - 1, 0);
	}
	
	cout << ope << endl;

	return 0;
}

Measured memory_bytes: 256
void main()
{
    long n = rdElem;

    Edge[][] edge = new Edge[][](n);
    foreach (i; 0 .. n-1)
    {
        long u, v, w;
        rdVals(u, v, w);
        --u, --v;
        edge[u] ~= Edge(v, w), edge[v] ~= Edge(u, w);
    }

    long[] color = new long[n];
    color[] = -1;

    void dfs(long x, long col)
    {
        color[x] = col;
        foreach (e; edge[x])
        {
            if (color[e.to] != -1) continue;
            if (e.cost & 1) dfs(e.to, !col);
            else dfs(e.to, col);
        }
    }

    dfs(0, 0);

    foreach (x; color)
    {
        x.writeln;
    }
}

struct Edge
{
    long to, cost;
}

enum long mod = 10^^9 + 7;
enum long inf = 1L << 60;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;

Measured memory_bytes: 23676
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define repp(i,j,k) for(int i=j;i>=k;i--)
#define llrep(i,j,k) for(long long int i=j;i<(long long int)k;i++)
#define Sort(x) sort(x.begin(),x.end()); 
#define vi vector<int>
#define vvi vector<vector<int>> 
#define ll long long
int mod=1e9+7;
const int INF = 1e9;

using namespace std;



int main(void) {
	string s;
	cin >> s;
	rep(i, 0, s.length() - 1) {
		if (s[i] == 'A' && s[i + 1] == 'C') {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<vector>
#include <algorithm>
#include <queue>
#include<string>
#include <map>
#include <cmath>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <utility>
#include <set>
#include <bitset>
typedef long long ll;
typedef long double ld;

#define REP(i,s,n)for(ll i=s;i<(n);++i)
#define rep(i,n) REP(i,0,n)
using namespace std;

int main() {
    ld A, B;
    cin >> A >> B;
    cout << A * B << endl;
    return 0;
}

Measured memory_bytes: 3768
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <set>
#include <map>


//マクロ
/*動かない・・・
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _roverload3(_1,_2,_3,name,...) name
#define _rrep(i,n) repi(i,0,n)
#define rrepi(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(...) _roverload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
//*/
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=1; i<=(int)(n); ++i)
#define RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)
//*/
#define All(a) (a).begin(),(a).end()
#define dump(x)  cerr << #x << " = " << (x) << endl;

//定数
#define INF 1e9
#define INFL 1e18
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
//*/
using namespace std;
using Graph = vector<vector<int>>;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数
int k, n;
vector<int> a;

//使用する関数
template<class T>bool chmax(T &a, const T &b) {
	if (a < b) { a = b; return 1; }
	return 0;
}
template<class T>bool chmin(T &a, const T &b) {
	if (a > b) { a = b; return 1; }
	return 0;
}



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

	cin >> k >> n;
	int a0;
	cin >> a0;
	int sum = a0;
	REP(i, n - 1) {
		int t;
		cin >> t;
		a.push_back(t-sum);
		sum = t;
	}
	a.push_back(k - sum + a0);
	sort(All(a));
	int ans = 0;
	REP(i, n-1) {
		ans += a[i];
	}
	cout << ans << endl;
}

Measured memory_bytes: 1400
from collections import defaultdict
INF = int(1e9+7)


def primeFactor(n, pf):
    # 素因数分解
    if n == 1:
        return
    f = 2
    while (f * f <= n):
        if (n % f == 0):
            pf[f] += 1
            n = n // f
        else:
            f += 1
    pf[n] += 1


def main():
    N = int(input())
    d = defaultdict(lambda: 0)
    for i in range(1, N + 1):
        primeFactor(i, d)
    ans = 1
    for i in d.values():
        ans *= i + 1
        ans %= INF
    print(ans)
    return


main()


Measured memory_bytes: 3316
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int a,b;
	for(int i=0;i<4;i++){
		cin>>a>>b;
		if(a==1)cout<<b*6000<<endl;
		if(a==2)cout<<b*4000<<endl;
		if(a==3)cout<<b*3000<<endl;
		if(a==4)cout<<b*2000<<endl;
	}return 0;
}

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

using namespace std;

const int Nmax = 10005, lim = 10000;
int n, i, j;
int a[Nmax], d[Nmax], d1[Nmax], d2[Nmax];

int main()
{
 //   freopen("input", "r", stdin);
  //  freopen("output", "w", stdout);
    cin.sync_with_stdio(false);

    cin >> n;
    for(i=1; i<=n; ++i) cin >> a[i];

    d1[0] = d2[lim+1] = n+1;

    for(i=1; i<=lim; ++i) d1[i] = 0, d2[i] = 0;

    for(i=1; i<=n; ++i)
    {
        for(j=1; j<=lim; ++j)
            d[j] = min(d1[j-1], d2[j+1]) + 1;

        d[a[i]] --;

        for(j=1; j<=lim; ++j) d1[j] = min(d1[j-1], d[j]);
        for(j=lim; j; --j) d2[j] = min(d2[j+1], d[j]);
    }

    cout << d1[n] << '\n';
    return 0;
}


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

using namespace std;
 
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}
typedef long long ll;
// #define int ll
 
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
// vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
// vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
// #define mp make_pair
//#define endl '\n'

signed main() {
    int n, d, x;
    cin >> n >> d >> x;
    int LL = d + x * (2 * n - 1);
    double mul = (d + LL) / 2.;

    double ans = 0;
    int num = n;
    for (int i = 0; i < n; i++) {
        ans += mul;
        ll mul2 = 1 * (2 * num - 1) + 3 * 1;
        mul *= mul2 / (2.0 * num);
        num--;
    }
    Sp(ans);
}

Measured memory_bytes: 3784
#include <iostream>
#include <string>

using namespace std;

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

    string kind = "Three";
    char c;
    for (int i = 0; i < n; i++) {
        cin >> c;
        if (c == 'Y') kind = "Four";
    }

    cout << kind << endl;
}

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vs = vector<string>;
using vvs = vector<vs>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "{";
    rep(i, (int)v.size()) {
        if (i)
            os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
    for (auto val : array)
        std::cout << val << ", ";
    std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int gcd(int x, int y) {
    if (y == 0) return x;
    return gcd(y, x%y);
}

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

    int n; std::cin >> n;
    vi x(n+1); rep(i, n+1) std::cin >> x[i];
    sort(rng(x));
    int ans = x[1]-x[0];
    srep(i, 2, n+1) {
        ans = gcd(ans, x[i]-x[i-1]);
    }
    std::cout << ans << "\n";
}


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

bool p_test(long long num);

int main(){
    long long A, B;
    std::cin >> A >> B;
    
    double A_d = (double)A;
    double max_sqrt = 1;
    double pre = 0;
    while(std::abs(max_sqrt - pre) > 0.01){
        pre = max_sqrt;
        max_sqrt = (pre + A_d / pre) / 2;
    }
    int max = (int)max_sqrt;
    std::vector< long long > A_pf;
    for(int i=1; i<=max; i++){
        if(A % i == 0){
            A_pf.push_back(i);
            if(i * i != A){
                A_pf.push_back(A / i);
            }
        }
    }
    double B_d = (double)B;
    max_sqrt = 1;
    pre = 0;
    while(std::abs(max_sqrt - pre) > 0.01){
        pre = max_sqrt;
        max_sqrt = (pre + B_d / pre) / 2;
    }
    max = (int)max_sqrt;
    std::vector< long long > B_pf;
    for(int i=1; i<=max; i++){
        if(B % i == 0){
            B_pf.push_back(i);
            if(i * i != B){
                B_pf.push_back(B / i);
            }
        }
    }
    std::sort(A_pf.begin(), A_pf.end());
    std::sort(B_pf.begin(), B_pf.end());
    int A_index = 0;
    int B_index = 0;
    
    int cnt = 0;
    while(A_index != A_pf.size() && B_index != B_pf.size()){
        if(A_pf[A_index] == B_pf[B_index]){
            if(p_test(A_pf[A_index])){
                cnt++;
            }
            A_index++;
            B_index++;
        }else if(A_pf[A_index] > B_pf[B_index]){
            B_index++;
        }else{
            A_index++;
        }
    }
        
    std::cout << cnt << std::endl;
    
    return 0;
    
}

bool p_test(long long num){
    double sqrt = 1;
    double pre = 0;
    while(std::abs(sqrt - pre) > 0.01){
        pre = sqrt;
        sqrt = (pre + num / pre) / 2;
    }
    int max = (int)sqrt;
    for(int i=2; i<=max; i++){
        if(num % i == 0){
            return false;
        }
    }
    return true;
}


Measured memory_bytes: 384