akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
#include <cstring> 
using namespace std;
using ll=long long;

#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define LLONG_MAXs 9223372036854775800

#include <iostream>
#include <cmath>
using namespace std;
 

 
bool isPrimeNum( ll x ){ // 素数である場合 true を返す
  if( x <= 1 ){ // 1以下である場合は素数でないことがすぐにわかる
    return false;
  }
  // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト
  int n = (int)sqrt( (double)x );
  for( int i = 2; i <= n; i++ ){
    if( x % i == 0 ){ // 割り切る整数がある場合、即判定終了
      return false;
    }
  }
  return true; // 割り切る整数がない場合、素数である
}

constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
constexpr ll min(ll a,ll b){
if(a>=b)return b;
if(a<b)return a;
}

constexpr ll max(ll a,ll b){
if(a>=b)return a;
if(a<b)return b;
}

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

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
  ll ans=0;
  ll N;

  cin>>N;

  ll a1[N];
  ll a2[N];
  FOR(i,0,N-1){
    cin>>a1[i];
  }
  FOR(i,0,N-1){
    cin>>a2[i];
  }
  FOR(i,0,N-1){
    ll tmp=0;

    FOR(j,0,N-1){
      if(i>=j){
        tmp=tmp+a1[j];
      }
      if(i<=j){
        tmp=tmp+a2[j];
      }
    }

    ans=max(ans,tmp);
  }
cout<<ans<<endl;
return 0;

}
 


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

int main() {
    int N, Y;
    cin >> N >> Y;
    int res10000 = -1, res5000 = -1, res1000 = -1;
    for (int a = 0; a <= N; ++a) {  // 10000円の枚数を 0 〜 N で調べる
        for (int b = 0; b + a <= N; ++b) {  // 5000円の枚数を 0 〜 N-a で調べる
            int c = N - a - b;  // 1000円の枚数は決まる
            int total = 10000*a + 5000*b + 1000*c;
            if (total == Y) {  // 答えが見つかったら
                res10000 = a;
                res5000 = b;
                res1000 = c;
            }
        }
    }

    // 答えを出力 (見つかっていなくても -1 -1 -1 になるので OK です)
    cout << res10000 << " " << res5000 << " " << res1000 << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,k;cin>>n>>m>>k;
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=m;j++)
        {
            if(i*m+j*n-2*i*j==k)
            {
                puts("Yes");
                return 0;
            }
        }
    }
    puts("No");
    return 0;
}


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

using namespace std;

bool kaibun(string s){
    size_t len = s.length();
    for(int i = 0; i < len/2; i++){
        if(s[i] != s[len-i-1]) return false;
    }
    return true;
}

long int GCD(long int a,long int b){
    long int ans;
    if(a==0){
        return b;
    }else{
        return GCD(b%a,a);
   }
}


int main(){
    long int N,M,K;
    cin >> N;
    long int sum=0;
    for(long int i = 1; i < N+1; i++){
        for(long int j = 1; j < N+1;j++){
            for(long int k = 1;k < N+1;k++){
                long int tmp = GCD(i,j);
                sum += GCD(tmp,k);
            }
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
    using namespace std;
     
    int N, H[10];
     
    void solve()
    {
      int big=0, small=0;
      bool flag = true;
      for (int i = 0; i < 10; i++)
      {
        if (H[i] > big) big = H[i];
        else if (H[i] > small) small = H[i];
        else
        {
          flag = false;
          break;
        }
      }
      if (flag) cout << "YES" << endl;
      else cout << "NO" << endl;
    }
     
    int main()
    {
      cin >> N;
      for (int i = 0; i < N; i++)
      {
        for (int j = 0; j < 10; j++) cin >> H[j];
        solve();
      }
      return 0;
    }

Measured memory_bytes: 1152
class Node
  def initialize(val)
    @val = val
    @left = nil
    @right = nil
  end

  def insert(val)
    if val < @val
      if @left
        @left.insert(val)
      else
        @left = Node.new(val)
      end
    else
      if @right
        @right.insert(val)
      else
        @right = Node.new(val)
      end
    end
  end

  def print
    puts " #{inorder([]).join(" ")}"
    puts " #{preorder([]).join(" ")}"
  end

  def preorder(list)
    #root
    list << @val
    #left
    list = @left.preorder(list) if @left
    #right
    list = @right.preorder(list) if @right
    list
  end

  def inorder(list)
    #left
    list = @left.inorder(list) if @left
    #root
    list << @val
    #right
    list = @right.inorder(list) if @right
    list
  end

  def find(num)
    if @val == num
      "yes"
    elsif @val > num
      if @left
        @left.find(num)
      else
        "no"
      end
    else
      if @right
        @right.find(num)
      else
        "no"
      end
    end
  end

  def del(num)
    if @val == num
      # delete
      if @left && @right
        @val = @right.next_val
        @right = @right.del(@val)
        self
      elsif @left && @right.nil?
        @left
      elsif @left.nil? && @right
        @right
      end
    elsif @val > num
      @left = @left.del(num) if @left
      self
    else
      @right = @right.del(num) if @right
      self
    end
  end

  def next_val
    @left ? @left.next_val : @val
  end
end

n = gets.to_i
tree = nil

n.times do
  command, num = gets.split
  case command
  when "insert"
    if tree
      tree.insert(num.to_i)
    else
      tree = Node.new(num.to_i)
    end
  when "find"
    puts tree.find(num.to_i)
  when "delete"
    tree = tree.del(num.to_i)
  when "print"
    tree.print
  end
end



Measured memory_bytes: 49404
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long N,m;
  cin>>N>>m;
  long long count=0;
  long long sum=0;
  vector<pair<long,long>>E(N);
  
  for(long long i=0;i<N;i++){
    cin>>E.at(i).first>>E.at(i).second;
  }
  sort(E.begin(),E.end());

    for(long long i=0;i<N;i++){
      if(E.at(i).second+count<=m){
        sum += E.at(i).first*E.at(i).second;
        count=E.at(i).second+count;
      }
      else{
        sum += E.at(i).first*(m-count);
        break;
      }
    }
  
  
  cout<<sum<<endl;
  
  
  
  
}

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

int main()
{
  string N;
  cin >> N;
  if (((int)N.find(string(3, N[0]))) > -1 || ((int)N.find(string(3, N[1]))) > -1)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
//#include "{algoritm.hpp}"

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    for (int i = 0; i < h; ++i)
    {
        if (i < b)
        {
            for (int j = 0; j < w; ++j)
            {
                if (j < a)
                {
                    cout << 1;
                }
                else
                {
                    cout << 0;
                }
            }
            cout<<endl;
        }
        else
        {
            for (int j = 0; j < w; ++j)
            {
                if (j < a)
                {
                    cout << 0;
                }
                else
                {
                    cout << 1;
                }
            }
            cout<<endl;
        }
    }
}


Measured memory_bytes: 1280
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAXN 20
int A[MAXN];
int len(long long int a)
{

    int i=0;
    while(a)
    {
     a/=10;
     i++;

    }

    return i;
}
void solve(long long int n)
{
    long long count;
    count=n;
    for(int i=(len(n)-1);i>=0;i--)
    {
      A[i]=count%10;
      count=(count-A[i])/10;

    }

}

int main()
{
    long long int N;
    int lenth,result=0,kase,flag;
    kase=0,flag=1;
    scanf("%lld",&N);
    lenth=len(N);
    solve(N);
    if (lenth==1)
    printf("%lld",N);
    else
    {

    for(int i=0;i<lenth;i++)
    {
        if(A[i]!=9&&flag)
        {
        if(i==lenth-1)
        {
        kase=lenth-2;
        flag=0;
        continue;
        }
        kase=i;
        for(int j=i+1;j<lenth;j++)
        if(A[j]!=9){flag=0;}
        }
    }
    if(flag)
    {
        for(int i=0;i<lenth;i++)
        result+=A[i];
    }
    else if(A[kase]==0){result=(9*lenth-1);}
    else result=A[kase]+9*(lenth-1)-1;
    printf("%d",result);
    }
    return 0;
}


Measured memory_bytes: 128
N, M = map(int, input().split())
edgelist = []
for i in range(M):
    edgelist.append(set(map(int, input().split())))

s = [1]
count = 0
L = [[i for i in edgelist if (len(i&set([1]))!=0)]]
while s != []:
    if len(s) == N:
        count = count + 1
        L.pop()
        s.pop()
    elif L[-1] == []:
        L.pop()
        s.pop()
    else:
        p = L[-1].pop()
        r = list(p - set([s[-1]]))
        L.append([i for i in edgelist if (len(i&set(r))!=0)*(len(i&set(s))==0)])
        s.append(r[0])
print(count)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e9)
using namespace std;
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S[55];
    cin >> N;
    rep(i,0,N){
        cin >> S[i];
    }
    int cnt[55][26] = {};
    rep(i,0,N){
        rep(j,0,S[i].size()){
            cnt[i][S[i][j] - 'a']++;
        }
    }
    rep(i,0,26){
        int min_cnt = 1e9;
        rep(j,0,N){
            min_cnt = min(min_cnt, cnt[j][i]);
        }
        if(min_cnt != 0){
            rep(j,0,min_cnt){
                cout << (char)('a'+i);
            }
        }
    }
    cout << endl;

}


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

int main() {
  cout << setprecision(15);
  ll a, b, x; 
  cin >> a >> b >> x;
  ll mod = a%x == 0 ? 1 : 0;
  cout << b/x - a/x + mod << endl;
  return 0;
}


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


int main(){
    int n;
    cin >> n;
    int p[n],q[n];

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

    sort(q,q+n);
    
    int v[n];
    int count = 0;
    for(int i = 0;i < n;i++){
       v[i] = p[i]-q[i]; 
       if(v[i] != 0){
           count++;
       }
    }

    if(count<=2)cout << "YES" << endl;
    else cout << "NO" << endl;

}


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

int main(){
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	ll hasil=a*c;
	hasil=max(hasil,a*d);
	hasil=max(hasil,b*c);
	hasil=max(hasil,b*d);
	cout<<hasil<<'\n';
	
	return 0;
}

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

using namespace std;

bitset<1000010>verified;

int main(){

	int n,m,a,b,cont=1,aux;
	queue<int>q;
	cin >> n >> m;

	vector<vector<int>>v(n+10);
	vector<int>resp(n+10);
	
	q.push(1);
	verified[1]=true;

	while(m--){
		cin >> a >> b;
		v[a].push_back(b);
		v[b].push_back(a);
	}

	while(!q.empty()){
		aux = q.front();

		for(int i=0;i<v[aux].size();i++){
			if(verified[v[aux][i]]==true) continue;
			verified[v[aux][i]]=true;
			resp[v[aux][i]] = aux;
			cont++;
			q.push(v[aux][i]);
		}
		q.pop();
	}
	if(cont==n){
	cout << "Yes\n";

	for(int i=2;i<=n;i++) cout << resp[i] << endl;
	}

	else{
		cout << "No" << endl;
	}
	return 0;

}

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

int checksum(int j){
  int sum = 0;
  while(j > 0){
    sum += j % 10;
    j /= 10;
  }
  return sum;
}

int main(void){
  int N, A, B;
  cin >> N >> A >> B;
  int total = 0;
  for (int i = 1; i <= N; i++){
    int sum = checksum(i);
    if (sum >= A && sum <= B) {
      total += i;
    }
  }
  cout << total << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll n;
    cin >> n;
    vector<ll> x(n), X(n);
    for (ll i = 0; i < n; i++)
    {
        cin >> x[i];
        X[i] = x[i];
    }
    sort(X.begin(), X.end());
    for (ll i = 0; i < n; i++)
    {
       cout << (x[i] < X[n / 2] ? X[n / 2] : X[n / 2 - 1]) << "\n";
    }
}

Measured memory_bytes: 5376
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int n,a,b;
pair<ll,ll> sol;

ll dp[300][300];

ll C(int n, int k) {
	if (n < k) return 0;
	if (n == k || k == 0) return 1;
	ll &ret = dp[n][k];
	if (ret) {
		return ret;
	}
	return ret = C(n-1,k-1) + C(n-1,k);
}

ll num[55];

ll eq(pair<ll,ll> a, pair<ll,ll> b) {
	return a.S * b.F == a.F * b.S;
}

ll gaus(ll x) {
	return x*(x+1)/2;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cout << fixed << setprecision(8);
	
	cin >> n >> a >> b;
	
	map<ll,int> cnt;
	
	FOR(i,0,n){
		cin >> num[i];
		cnt[num[i]]++;
	}
	
	sort(num,num+n,greater<ll>());
	
	for (int i = 0; i < a; i++){
		sol.F+=num[i];
	}
	sol.S = a;
	
	ll ans = 0;
	for (int i = a; i <= b; i++){
		ll s = 0;
		for (int j = 0; j < i; j++) {
			s+=num[j];
		}		
		pair<ll,ll> frac = {s,i};
		if (! eq(sol,frac)) {
			break;
		}
		ll last = num[i-1];
		ll p = 0;
		for (int j = 0; j < i; j++) {
			p+=(num[j]==last);
		}
		ans+=C(cnt[last],p);
	}
	
	cout << (((double)sol.F)/sol.S) << "\n" << ans << "\n";
	
}


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

int main() {
    long x, ans;
    cin >> x;
    ans = 2 * (x / 11);
    x %= 11;
    if(x > 6) ans += 2;
    else if(x > 0) ans += 1;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;
long long combi(long long n, long long k) {
	if (n == k || k == 0)
		return 1;
	else {
		return combi(n - 1, k - 1) + combi(n - 1, k);
	}
}
int main() {
	int n;
	cin >> n;
	vector<pair<int, int>> vp(n);
	REP(i, n) {
		cin >> vp[i].first;
		vp[i].second = i+1;
	}
	sort(all(vp));
	REP(i, n) {
		cout << vp[i].second << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 1536
package main

import (
	"bufio"
	"fmt"
	"os"
)

var (
	read  = bufio.NewReader(os.Stdin)
	write = bufio.NewWriter(os.Stdout)
)

func main() {
	defer write.Flush()

	var s, t string
	fmt.Fscan(read, &s, &t)

	var a, b int
	fmt.Fscan(read, &a, &b)

	var u string
	fmt.Fscan(read, &u)

	if s == u {
		a = a - 1
	} else {
		b = b - 1
	}
	fmt.Fprintln(write, a, b)
}


Measured memory_bytes: 640
fun main(args: Array<String>) {
    val (a, b) = readLine()!!.split(" ").map { it.toLong() }
    println(xorFromZero(a - 1) xor xorFromZero(b) )
}

fun xorFromZero(n: Long): Long {
    val ans = when (n % 4.toLong()) {
        0.toLong() ->  n
        1.toLong() ->  1
        2.toLong() ->  1.toLong() xor n
        3.toLong() ->  0
        else -> 0
    }
    return ans.toString().toLong()
}


Measured memory_bytes: 37968
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

int n, m;
int a[1010], b[1010], c[1010][15];
int dp[1010][1 << 13];
bool vis[1010][1 << 13];

int solve(int p, int bit)
{
    if (vis[p][bit])
        return dp[p][bit];
    vis[p][bit] = true;
    if (p == m)
    {
        if (bit == (1 << n) - 1)
            return dp[p][bit] = 0;
        else
            return dp[p][bit] = INF;
    }
    int res = solve(p + 1, bit);
    int nxt = bit;
    rep(i, b[p]) nxt |= (1 << c[p][i]);
    if (solve(p + 1, nxt) != INF)
        res = min(res, solve(p + 1, nxt) + a[p]);
    return dp[p][bit] = res;
}

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

    cin >> n >> m;
    rep(i, m)
    {
        cin >> a[i] >> b[i];
        rep(j, b[i]) cin >> c[i][j];
        rep(j, b[i]) c[i][j]--;
    }
    int ans = solve(0, 0);
    cout << (ans == INF ? -1 : ans) << endl;
}

Measured memory_bytes: 72192
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;

const int N=1000006;

int n;
ll ans;
int a[N];

int main(){
	int i;
	scanf("%d",&n);
	for (i=1;i<=n;i++) scanf("%d",&a[i]);
	for (i=1;i<=n;i++){
		ans+=1ll*a[i]/2ll;
		a[i]=a[i]-a[i]/2*2;
		if (a[i]&&a[i+1]){
			a[i+1]--; ans++;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1148
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    int a,b,c;
    cin>>a>>b>>c;
    int ans = abs(a - b) + abs(b - c);
    ans = min(ans, abs(a - c) + abs(b - c));
    ans = min(ans, abs(a - c) + abs(b - a));
    cout<<ans<<endl;
    return 0;
}

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

int N;
#define MAX_N 100000
int A[MAX_N];
bool F;

int gcd(int a, int b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cin >> N;
  for(int i = 0; i < N; ++i) cin >> A[i];
  F = true;
  while(true) {
    int c = 0, o = -1;
    for(int i = 0; i < N; ++i) {
      if(A[i] % 2 == 0) ++c;
      else o = i;
    }
    if(c % 2 == 1) break;
    F = !F;
    if(c != N - 1 || A[o] == 1) break;
    --A[o];
    int g = 0; for(int i = 0; i < N; ++i) g = gcd(g, A[i]);
    for(int i = 0; i < N; ++i) A[i] /= g;
  }
  cout << (F ? "First" : "Second") << endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <fstream>
#include <vector>
#include <bitset>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <math.h>
#include <iomanip>

using namespace std;

/********** TEMPLATE STARTS HERE ***********/

#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define PI 3.1415926535897932384626433832795
#define gcd __gcd 

typedef unsigned long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <long long> vl;
typedef vector <pll> vll;
typedef vector <pii> vii;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;

template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

/*********** TEMPLATE ENDS HERE *************/

main()
{
	IOS
	
	string s;
	cin >> s;
	
	s[3] = '8';
	
	cout << s;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define pb push_back
#define ff first 
#define ss second
#define mod 1000000007
#define lim 100005
#define nfs_mw ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

int main()
{
	nfs_mw;
	int i,j,n;
	cin>>i>>j;
	cout<<6-(i+j);
}

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

int main() {
  int N,M,A;
  cin >> N >> M;
  vector<int> vec(N);
  for(int i;i < M * 2;i++){
    cin >> A;
    vec.at(A - 1)++;
  }
  for(int i;i < N;i++){
    cout << vec.at(i) << endl;
  }
}

Measured memory_bytes: 256
/***
 *      __  __            _    _       _
 *     |  \/  |          | |  | |     | |
 *     | \  / |_ __      | |  | |_ __ | | ___ __   _____      ___ __
 *     | |\/| | '__|     | |  | | '_ \| |/ / '_ \ / _ \ \ /\ / / '_ \
 *     | |  | | |     _  | |__| | | | |   <| | | | (_) \ V  V /| | | |
 *     |_|  |_|_|    (_)  \____/|_| |_|_|\_\_| |_|\___/ \_/\_/ |_| |_|
 *
 *
***/
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
/*---------------for_stuff-------------------*/
#define f(i,a,b) for (int i=a;i<=b;i++)
#define f_(i,a,b) for (int i=a;i>=b;i--)
/*---------------pair_stuff------------------*/
#define MP make_pair
#define ii pair<int,int>
#define Iii pair<int,ii>
#define ill pair<int,ll>
#define lli pair<ll,int>
#define iiI pair<ii,int>
#define llll pair<ll,ll>
#define fi first
#define se second
/*--------------vector_stuff-----------------*/
#define pb push_back
#define ppb pop_back
/*--------------const_stuff-----------------*/
const ll mod=1000000007;
/*--------------map_stuff--------------------*/
// why do you think I should write something in this part? :v

int n,a[100005];
int main() {
//	freopen("","r",stdin);
//	freopen("","w",stdout);
	scanf("%d", &n);
	f(i,1,n) scanf("%d", &a[i]);
	a[0]=INT_MIN;
	f(i,1,n) {
		if (a[i]-1>=a[i-1]) a[i]--;
		else {
			if (a[i]<a[i-1]) {
				printf("No");
				return 0;
			}
		}
	}
	printf("Yes");
	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	Main m = new Main();
	m.answer();
    }

    private Scanner scan = new Scanner(System.in);
    private final int X;
    private final int t;

    public Main() {
	X = Integer.parseInt(scan.next());
	t = Integer.parseInt(scan.next());

	scan.close();
    }

    public final void answer() {
	int ans = Integer.max(0, X-t);
	System.out.println(ans);
    }
}


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

#define PI 3.141592653589
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll,ll>
#define vv vector
int MOD=1e9+7;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%MOD;
    while(b>0){
        if(b&1){res=(res*a)%MOD;b--;}
        a=(a*a)%MOD;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,MOD-2);}
ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}
ll min(ll a,ll b){return (a>b)?b:a;}
ll max(ll a,ll b){return (a>b)?a:b;}
bool prime[1000001];
vi primes;
void SieveOfEratosthenes(int n) 
{ 
    memset(prime, true, sizeof(prime)); 
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    for(int p=2;p<1000001;p++)
        if(prime[p])
            primes.pb(p);
}
ll fact[200005];
ll finv[200005];
void factorial(int n){
    fact[0]=1;
    finv[0]=1;
    for(int i=1;i<=n;i++)
        fact[i]=fact[i-1]*i,fact[i]%=MOD,finv[i]=fermat_inv(fact[i]);
}
ll ncr(ll n,ll r)
{
    if(n<r||n<0||r<0)
        return 0;
    else{
        ll x=finv[r]*finv[n-r]%MOD;
        return fact[n]*x%MOD;
    }
}

bool comp(pll a,pll b){return a.ff+a.ss<b.ff+b.ss;}
ll f(ll a,ll b){return ncr(a+b,a);}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    int t=1;
    //cin>>t;
    //SieveOfEratosthenes(1000000);
    factorial(200005);
    while(t--){
        ll h,w,n;
        cin>>h>>w>>n;
        pll pts[n];
        for(int i=0;i<n;i++)
            cin>>pts[i].ff>>pts[i].ss;
        sort(pts,pts+n,&comp);
        ll dp[n]={0};
        ll ans=f(w-1,h-1);
        for(int i=0;i<n;i++){
            dp[i]=f(pts[i].ff-1,pts[i].ss-1);
            //cout<<dp[i]<<' ';
            for(int j=0;j<i;j++){
                dp[i]-=(dp[j]*f(pts[i].ff-pts[j].ff,pts[i].ss-pts[j].ss))%MOD;
                dp[i]=(dp[i]+MOD)%MOD;
                //cout<<dp[i]<<' ';
            }
            ans-=(dp[i]*f(h-pts[i].ff,w-pts[i].ss))%MOD;
            ans=(ans+MOD)%MOD;
        }

        cout<<ans;
    }
}

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

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        x: u32,
        aa: [u32; n],
    };
    let mut a = aa.clone();
    let mut ans = 0;
    let mut left = x;
    a.sort();

    for b in a {
        if left < b{
            println!("{}", ans);
            return;
        }
        left = left - b;
        ans += 1;
    }
    if left > 0 {
        ans -= 1;
    }
    println!("{}", ans);
}


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

int main(){
    vector<int> A = {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;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define COUT(x) cout<<(x)<<"\n"
#define REP(i,n) for(int i=0;i<n;i++)

int a,b;
const int h=100,w=100;
char g[h][w];

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

  REP(i,h) REP(j,w) g[i][j] = i<h/2 ? '#' : '.';

  int swaped = 0;
  for (int i = 0; i < h; i+=2) {
    if (h/2 < i && !swaped) {
      swap(a,b);
      swaped = 1;
    }
    for (int j = 0; j < w; j+=2) {
      if (a==0) break;
      g[i][j] = g[i][j] == '.' ? '#' : '.';
      a--;
    }
  }

  cout << h << " " << w << endl;
  REP(i,h) REP(j,w) {
    cout << g[i][j];
    j == w-1 && cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;

int main(){
    long A, B, C, ans;
    cin >> A >> B >> C;
    if(!(A&1) || !(B&1) || !(C&1)){
        cout << 0;
        return 0;
    }
    ans = min(A*B,A*C);
    ans = min(ans, B*C);
    cout << ans;
}

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

int main(){
    ll N, m = 0, a = 0, r = 0, c = 0, h = 0;
    cin >> N;
    rep(i, N){
        string S;
        cin >> S;
        if(S[0] == 'M') m++;
        if(S[0] == 'A') a++;
        if(S[0] == 'R') r++;
        if(S[0] == 'C') c++;
        if(S[0] == 'H') h++;
    }
    ll ans = m*a*r + m*a*c + m*a*h + m*r*c + m*r*h
           + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h;
    cout << ans << endl;
  	return 0;
}

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

using namespace std;

void factorize(int n)
{
    cout<<n<<":";
    vector<int> res;
    for(int i=2;i*i<=n;i++)
    {
        while(n%i==0)
        {
            res.push_back(i);
            n/=i;
        }
    }
    if(n!=1) res.push_back(n);
    for(int i=0;i<res.size();i++)
    {
        cout<<" "<<res[i];
    }
    cout<<endl;
}

int main()
{
    int n;

    while(cin>>n)
    {
        factorize(n);
    }

    return 0;
}



Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
int main()
{   int a,b,c,s1,s2 ;
    cin>>a>>b>>c;
    s1=abs(c-a);
   s2=abs(b-a);
    if(s2>s1)
        cout<<"B";
    else
        cout<<"A";
	return 0;
}



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

int main(){
  string text;
  cin >> text;
  
  if(text=="Sunny"){
    cout << "Cloudy" << endl;
  }
  
  if(text=="Cloudy"){
    cout << "Rainy" << endl;
  }
  
  if(text=="Rainy"){
    cout << "Sunny" << endl;
  }
}

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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

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

    priority_queue<pair<ll, ll>> q;
    ll a;
    for (int i = 0; i < n; i++) {
        cin >> a;
        q.emplace(a, 1);
    }

    ll b, c;
    for (int i = 0; i < m; i++) {
        cin >> b >> c;
        q.emplace(c, b);
    }

    ll t = 0;
    for (int i = 0; i < n; i++) {
        auto p = q.top();
        q.pop();
        t += p.first;
        if (p.second > 1) {
            q.emplace(p.first, p.second - 1);
        }
    }

    cout << t << endl;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  i64 a, b, c;
  cin >> a >> b >> c;
  if (a == b && b == c) {
    if (a % 2 == 1) {
      cout << 0 << endl;
    } else {
      cout << -1 << endl;
    }
    return 0;
  }
  i64 ans = 0;
  while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
    i64 ha = a / 2, hb = b / 2, hc = c / 2;
    a = hb + hc, b = hc + ha, c = ha + hb;
    ans++;
    cerr << a << " " << b << " " << c << endl;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main()
{
	int n,s=0,s1=0,s2=0,t1=0,t2=0,i=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
	{
		cin>>a[i];
		s=s+a[i];
	}
	s2=s;
	s1=s1+a[0];
	s2=s2-a[0];
	t2=s2-s1;
	for(i=1;i<n;i++)
	{
		s1=s1+a[i];
		s2=s2-a[i];
		t1=s2-s1;
		if(t1<=0)
		{
			t1=abs(t1);
			t2=abs(t2);
			if(t1>t2)
			{
				printf("%d",t2);
			}
			else
			{
				printf("%d",t1);
			}
			break;
		}
		else
		{
			t2=t1;
		}
	}
	return 0;
} 

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

int main(){

    int N;
    cin >> N;
    int count = 0, prev = 0, current;
    for(int i = 0; i < N; i++){
        cin >> current;
        if(prev < current) count += current - prev;
        prev = current;
    }

    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
def fac(n, MOD):
    cur = 1
    for i in range(1, n+1):
        cur = (cur*i)%MOD
    return cur

MOD = 10**9+7
n, m = map(int,input().split())
if abs(n-m) >= 2: print(0)
elif n == m: print((2*fac(n,MOD)**2)%MOD)
else: print(fac(n,MOD)*fac(m,MOD)%MOD)

Measured memory_bytes: 39152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e18;

ll pow(ll x, ll n) {
  ll ans=1;
  while(n>0) {
    if(n&1) {
      ans=ans*x;
    }
    x=x*x;
    n>>=1;
  }
  return ans;
}

int main() {
  ll n,p;
  cin >> n >> p;
  vec a(n);
  ll en=0,on=0;
  for(ll i=0;i<n;i++) {
    ll a;
    cin >> a;
    if(a%2) on++;
    else en++;
  }
  ll eans=pow(2,en);
  ll oans=0;
  if(on>0) oans=pow(2,on-1);
  else if(p==0) {
    oans=1;
  }
  ll ans=eans*oans;
  cout << ans << endl;
}

Measured memory_bytes: 384
N=int(input())
A=list(map(int,input().split()))
a=1
k=0
if 0 in A:
  print(0)
else:
  for i in range(N):
    a*=A[i]
    if a>10**(18):
      k=1
      break
  if k==1:
    print(-1)
  else:
    print(a)

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

int main(){
  while(true){
    int n,m,p;
    scanf("%d%d%d",&n,&m,&p);
    if(n+m+p==0)return 0;
    int sum = 0;
    int win = 0;
    for(int i=0;i<n;i++){
      int x;
      scanf("%d",&x);
      sum += x;
      if(i==m-1)win = x;
    }
    sum *= 100;
    p = 100 - p;
    // ans = sum * p / 100 / win
    if(win == 0){
      puts("0");
    }else{
      int ans = sum * p / (100 * win);
      printf("%d\n",ans);
    }
  }
}


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

int main() {
  int N;
  cin>>N;
  vector<int>p(N);
  for(int i=0;i<N;i++) cin>>p[i];
  sort(p.begin(),p.end());
  int ans=p[N-1]/2;
  for(int i=0;i<N-1;i++) ans+=p[i];
  cout<<ans<<endl;
}


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

int main(){
  int a,b;
  cin >> a >> b;
  int ans;
  ans=max(a,b);
  ans+=max(max(a,b)-1,min(a,b));
  cout << ans << endl;
}

Measured memory_bytes: 256
a = []
n = int(input())
for i in range(n):
    a += [input()]

b = []
m = int(input())
for j in range(m):
    b += [input()]

ans = 0
for k in set(a):
    if k in b:
        ans = max(ans, a.count(k) - b.count(k))
    else:
        ans = max(ans, a.count(k))
print(ans)

Measured memory_bytes: 3064
#include <iostream>
 
using namespace std;
void coffee(char arr1[]);
 
int main()
{
   char arr1[6] = {};
   for(int i = 0; i < 6 ; i++){
       
       cin >> arr1[i];
   }
   
   coffee(arr1);
   return 0;
}
 
void coffee(char arr1[]){
    
    if(arr1[2] == arr1[3] && arr1[4] == arr1[5]){
        
        cout << "Yes";
    }
    else{
        cout << "No";
    }
    
}

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

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

  int n, a[100100];
  long long sum = 0, sumEven = 0;
  cin >> n;
  for (int i = 0; i < n; i++)
  {
    cin >> a[i];
    sum += a[i];
    if (i % 2 == 0 && i < n - 1)
      sumEven += a[i];
  }

  long long ans[100100];
  ans[n - 1] = sum - sumEven * 2;
  for (int i = n - 2; i >= 0; i--)
    ans[i] = a[i] * 2 - ans[i + 1];

  for (int i = 0; i < n; i++)
    cout << ans[i] << " \n"[i == n - 1];
}


Measured memory_bytes: 2560
n = int(input())
E = 10**-10
for _ in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = [float(i) for i in input().split()]
    if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < E:
        print("YES")
    else:
        print("NO")



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

int main() {
  int A, B, x, y;
  int a, b, c, d, e;
  
  cin >> A >> B;
  x = A;
  y = 0;
  
  for (int i = 0; i < B - A + 1; i++) {
    
    a = x / 10000;
    b = x % 10000 / 1000;
    c = x % 1000 / 100;
    d = x % 100 / 10;
    e = x % 10;
    x++;
    
    if (a == e && b == d) {
      y++;
    }
  }
  
  cout << y << endl;
  
}


Measured memory_bytes: 256
n=int(input())
def soinsuu(a):
    yakusuu=[]
    j=2
    while(a>1):
        for i in range(j,int(a**0.5)+1):
            if a%i==0:
                yakusuu.append(i)
                a=a//i
                j=i
                break
        else:
            yakusuu.append(a)
            break
    yakusuu.sort()
    return yakusuu
ans=[]
from collections import Counter
for i in range(2,n+1):
    ans+=soinsuu(i)
ans2=1
mod=10**9+7
for i in Counter(ans).values():
    ans2=(ans2*(i+1))%mod
print(ans2)

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

int main()
{
    int A, B, C;
    scanf("%d %d %d", &A, &B, &C);
    if (C>=A and C<=B)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define P pair<int,int>
#define Sort(a) sort((a).begin(),(a).end())
#define Reverse(a) reverse((a).begin(),(a).end())
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;

signed main(){
    int a,b,c;
    cin >> a >> b >> c;
    int d = a+b+1;
    int ans = min(d,c);
    ans += b;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int N;
int V[110],C[110];
int main(){
  cin>>N;
  for(int i=0;i<N;i++)cin>>V[i];
  for(int i=0;i<N;i++)cin>>C[i];
  int ans=0;
  for(int i=0;i<N;i++)ans+=max(0,V[i]-C[i]);
  cout<<ans<<endl;
}

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

int main(void)
{
	int r,g,b, num;
	scanf("%d %d %d", &r, &g, &b);
	num = 100*r + 10*g + b;
	if(num%4 == 0)
		printf("YES");
	else
		printf("NO");
	return 0;
}

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

using namespace std;

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

#define X first
#define Y second

const int MAXN = 1<<18;

int n;
int a[MAXN];

int rev[MAXN<<1];
pii v[MAXN<<1], w[MAXN<<1];

void build(int k, int L, int R)
{
	if (L == R)
	{
		if (L%2 == 1)
		{
			v[k] = pii(a[L], L);
			w[k] = pii(MAXN, L);
		}
		else
		{
			v[k] = pii(MAXN, L);
			w[k] = pii(a[L], L);
		}
		return;
	}
	int m = (L+R)>>1;
	build(k<<1, L, m);
	build(k<<1|1, m+1, R);
	v[k] = min(v[k<<1], v[k<<1|1]);
	w[k] = min(w[k<<1], w[k<<1|1]);
}

void clear(int k)
{
	if (rev[k])
	{
		rev[k<<1] ^= 1;
		swap(v[k<<1], w[k<<1]);
		rev[k<<1|1] ^= 1;
		swap(v[k<<1|1], w[k<<1|1]);
		rev[k] = 0;
	}
}

pii get(int k, int L, int R, int x, int y)
{
	if (L == x && R == y)
		return w[k];
	clear(k);
	int m = (L+R)>>1;
	if (y <= m)
		return get(k<<1, L, m, x, y);
	if (x > m)
		return get(k<<1|1, m+1, R, x, y);
	return min(get(k<<1, L, m, x, m), get(k<<1|1, m+1, R, m+1, y));
}

void del(int k, int L, int R, int x)
{
	if (L == R)
	{
		v[k] = pii(MAXN, L);
		w[k] = pii(MAXN, L);
		return;
	}
	clear(k);
	int m = (L+R)>>1;
	if (x <= m) 
		del(k<<1, L, m, x);
	else
		del(k<<1|1, m+1, R, x);
	v[k] = min(v[k<<1], v[k<<1|1]);
	w[k] = min(w[k<<1], w[k<<1|1]);
}

void pat(int k, int L, int R, int x, int y)
{
	if (L == x && R == y)
	{
		rev[k] ^= 1;
		swap(v[k], w[k]);
		return;
	}
	clear(k);
	int m = (L+R)>>1;
	if (y <= m)
		pat(k<<1, L, m, x, y);
	else if (x > m)
		pat(k<<1|1, m+1, R, x, y);
	else
	{
		pat(k<<1, L, m, x, m);
		pat(k<<1|1, m+1, R, m+1, y);
	}
	v[k] = min(v[k<<1], v[k<<1|1]);
	w[k] = min(w[k<<1], w[k<<1|1]);
}

int main()
{
	
	scanf("%d", &n);
	for (int i = 1; i <= n; ++ i)
	{
		scanf("%d", &a[i]);
	}
	build(1, 1, n);
	set<int> H;
	H.insert(n+1);
	for (int i = 1; i <= n/2; ++ i)
	{
		pii px = v[1];
		auto it = H.upper_bound(px.Y);
		pii py = get(1, 1, n, px.Y+1, *it-1);
		printf("%d %d ", px.X, py.X);
		del(1, 1, n, px.Y);
		H.insert(px.Y);
		del(1, 1, n, py.Y);
		H.insert(py.Y);
		pat(1, 1, n, px.Y, py.Y);
	}
	
    return 0;
}


Measured memory_bytes: 22016
#include <stdio.h>
int n,a[105],ans;
bool flag=false;
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++) scanf("%d",&a[i]);
	for (int i=1;i<n;i++)
	{
		if (!flag && a[i]==a[i-1])
		{
			ans++;
			flag=true;
		}
		else flag=false;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(c) (c).begin(), (c).end()

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

    int X, Y, A, B, C; cin >> X >> Y >> A >> B >> C;
    vector<int64_t> valueA(A), valueB(B), valueC(C);
    REP(i, A) cin >> valueA[i];
    REP(i, B) cin >> valueB[i];
    REP(i, C) cin >> valueC[i];
    sort(ALL(valueA), greater());
    sort(ALL(valueB), greater());
    sort(ALL(valueC), greater());

    vector<int64_t> v;
    v.insert(v.end(), valueA.begin(), valueA.begin() + X);
    v.insert(v.end(), valueB.begin(), valueB.begin() + Y);
    v.insert(v.end(), valueC.begin(), valueC.end());
    sort(ALL(v), greater());

    int64_t ans = 0;
    REP(i, X+Y) ans += v[i];
    cout << ans << '\n';
}


Measured memory_bytes: 9232
#include <cstdio>
#include <iostream>

using namespace std;

int calc(int a, char op, int b)
{
	int result = 0;
	switch (op)
	{
		case '+':
			result = a + b;
			break;
		case '-':
			result = a - b;
			break;
		case '*':
			result = a * b;
			break;
		case '/':
			result = a / b;
			break;
		default:
			break;
	}
	return result;
}


int main(int argc, char const *argv[])
{
	int a, b;
	char op;

	while(1)
	{
		cin >> a >> op >> b;
		if (op == '?')
		{
			break;
		}
		else
		{
			printf("%d\n", calc(a, op, b));
		}
	}
	return 0;
}

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

int a[10005];

int main () {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i)
    cin >> a[i];
  int sum = 0;
  for (int i = 1; i <= m; ++i)
    sum += a[i];
  printf ("%d\n", n < sum ? -1 : n-sum);
  return 0;
}

Measured memory_bytes: 3756
#include<bits/stdc++.h>
#include<bitset>
#include<string>
using namespace std;
#include <numeric> 
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using pi=pair<long long,long long>;
#define pii 3.1415926536
#define binary
#define mod 1000000007
typedef long long ll;
typedef long double ld;
bool sortbysec(const pair<long long,long long> &a, 
              const pair<long long,long long> &b) 
{ 
    return (a.first < b.first); 
}
bool compare(const pair<pair<ll,ll>,ll> &a,const pair<pair<ll,ll>,ll>&b)
{
    if(a.first.first==b.first.first)return (a.first.second<b.first.second);
    return (a.first.first < b.first.first); 
}
 int lcm(int a, int b)  
 {  
    return (a*b)/__gcd(a, b);  
 }  
 int Kad(ll dp[],ll n)
{
  ll curr_max=0,maxx=INT_MIN;
  for(int i=0;i<n;i++)
  {
    curr_max=curr_max+dp[i];
    if(curr_max>maxx)
      maxx=curr_max;

    if(curr_max<0)
      curr_max=0;
   
  }

  return maxx;
}

/*void dfs(int u)
{
    vis[u]=true;
    //cout<<u<<" ";
    std::vector<ll> ::iterator i;
     for (i = g[u].begin(); i != g[u].end(); ++i) 
        if (!vis[*i]) 
            dfs(*i); 
    for(int i=1;i<g[u].size();i++)
    {
        if(!vis[g[u][i]])
        {
            dfs(i);
        }
    }
}*/
/*void build_tree(ll tree[],ll a[],ll start,ll end,ll node)
{
    if(start==end)
    {
        tree[node]=a[start];
        return;
    }
    int mid=(start+end)/2;
    build_tree(tree,a,start,mid,2*node);
    build_tree(tree,a,mid+1,end,2*node+1);
    tree[node]=min(tree[2*node],tree[2*node+1]);
}
ll query_tree(ll tree[],ll a[],ll qs,ll qe,ll start,ll end,ll node)
{
    if(start>=qs && end<=qe)
    {
        return tree[node];
    }
    if(start>qe || end<qs)
        return INT_MAX;
    int mid=(start+end)/2;
    int left_tree=query_tree(tree,a,qs,qe,start,mid,2*node);
    int right_tree=query_tree(tree,a,qs,qe,mid+1,end,2*node+1);

    return min(left_tree,right_tree);
}*/


int main()
{

 #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("error.txt", "w", stderr);
  #endif  
  IOS;
  string s,t;
  cin>>s>>t;
  ll ans=INT_MAX;
  if(s==t)
  {
    cout<<0<<endl;
    return 0;
  }
  for(int i=0;i<=(s.size()-t.size());i++)
  {
    ll temp=0;
    ll flag=0;
    //int x=0;
    for(int j=0;j<t.size();j++)
    {
        //cout<<s[j+i]<<" ";
        if(s[j+i]!=t[j])
        {
            temp++;
           // flag=1;
        }
        flag=1;
    }
   // cout<<temp<<endl;
    if(flag==1)
    ans=min(ans,temp);
  }
  cout<<ans<<endl;


}
                                  
   

  

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

using namespace std;

#define vi vector<int>
#define all(v) v.begin(),v.end()
#define ll long long int
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define D1(x) {cerr<<" [" <<#x<<": "<<x<<"]";cout << endl;}
#define D2(x) {cerr<<" [" <<#x<<": ";for(auto it:x)cerr<<it<< " ";cerr<<"] ";cout << endl;}

const ll MOD = 1e9 + 7;
const ll maxn = 2e5 + 5;

void solve(){
	int n;
	cin >> n;
	vi v(n);
	ll l = 0;
	for(int i=0;i<n;i++){
	   cin >> v[i];
	   l^=v[i]; 
	}
	vi ans(n);
	for(int i=0;i<n;i++){
		ans[i] = l^v[i];
	}
	for(int x:ans)cout << x << ' ';
}

int main() {
    IOS
    
        solve();
    cerr << endl << "[ Time : " << (float) clock() / CLOCKS_PER_SEC << " secs ]" << endl;

}
// integer overflow
// remember to clear visited array
// take input as vector<string> while using grid
// don't assign after modifying


Measured memory_bytes: 4784