akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

char s[20];
int n;
int main() {
    scanf("%s", s + 1);
    int flag = 1;
    
    int n = strlen(s + 1), cnt = 0;
    flag = s[1] == 'A';
    // [3, n - 2]
    cnt = 0;
    for(int i = 3 ; i <= n - 1 ; ++ i) if(s[i] == 'C') ++ cnt;
    if(cnt != 1) flag = 0;
    
    cnt = 0;
    for(int i = 1 ; i <= n ; ++ i)
        if(!('a' <= s[i] && s[i] <= 'z')) {
            if(s[i] != 'A' && s[i] != 'C')
                        flag = 0;
        }
    
    
    if(flag) puts("AC");
    else puts("WA");
}

Measured memory_bytes: 256
/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

void solve()
{
    ll n;
    cin >> n;

    string s;
    set<string> st;

    while(n--)
    {
        cin >> s;
        st.insert(s);
    }

    cout << sz(st) << endl;
}

int32_t main()
{
    FIO
    solve();
    return 0;
}

Measured memory_bytes: 19256
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<P,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
using namespace std;
int x[1000],y[1000],z[1000],vx[1000000],vy[3000000];
int mypow(int a,int b,int c){
	if(b==0)return 1;
	if(b%2)return mypow(a,b-1,c)*a%c;
	int z=mypow(a,b/2,c);
	return z*z%c;
}
signed main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	f(i,a)cin>>x[i];
	int vz=0;
	f(i,b){
		cin>>y[i];
		f(j,a){
			vx[vz]=x[j]+y[i];
			vz++;
		}
	}
	sort(vx,vx+vz,greater<int>());
	vz=0;
	f(i,c){
		cin>>z[i];
		f(j,d){
			vy[vz]=vx[j]+z[i];
			vz++;
		}
	}
	sort(vy,vy+vz,greater<int>());
	f(i,d)cout<<vy[i]<<endl;
	return 0;
}


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


int main(){
  string a,b,c;

  cin>>a;
  cin>>b;
  cin>>c;

  char turn='a';
  int a_idx=0;
  int b_idx=0;
  int c_idx=0;

  int a_length=a.length();
  int b_length=b.length();
  int c_length=c.length();

  string winner;

  while(true){
      if(turn=='a'){
          if(a[a_idx]=='a'){
              turn='a';
          }else if(a[a_idx]=='b'){
              turn='b';
          }else if(a[a_idx]=='c'){
              turn='c';
          }
          if(a_idx>=a_length){
                winner='A';
                break;
            }
          a_idx++;
      }else if(turn=='b'){
          if(b[b_idx]=='a'){
              turn='a';
          }else if(b[b_idx]=='b'){
              turn='b';
          }else if(b[b_idx]=='c'){
              turn='c';
          }
          if(b_idx>=b_length){
                winner="B";
                break;
            }
          b_idx++;
      }else if(turn=='c'){
          if(c[c_idx]=='a'){
              turn='a';
          }else if(c[c_idx]=='b'){
              turn='b';
          }else if(c[c_idx]=='c'){
              turn='c';
          }
          if(c_idx>=c_length){
                winner='C';
                break;
            }
          c_idx++;
      }
  }
  cout<<winner<<endl;

  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

    private static Scanner sc;

    public static void main(String[] args) {
        Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private void solve() {
        try {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();

            String answer = "NO";

            if (a + b + c == 17) {
              if (a == 5) {
                if (b == 7 || c == 7) {
                  answer = "YES";
                }
              } else if (a == 7) {
                if (b == 5 || c == 5) {
                  answer = "YES";
                }
              } 
            }

            System.out.println(answer);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null) br.close();
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String st = br.readLine();
            while (st == "") st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }
}


Measured memory_bytes: 8148
#include<stdio.h>
int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int K=0;
	int a;
	
	for (a=1;a<N;a++)
	{
		K += a;
	}
	
	int L=0;
	int b;
	
	for(b=1;b<M;b++)
	{
		L += b;
	}
	
	if (N+M>=2)
	{
		printf("%d\n", K+L);
	}
	else
	{
		printf("0\n");
	}
	
	return 0;
}

Measured memory_bytes: 1692
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {

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

  public void run() {
    
    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(in.readLine());
      String line = in.readLine();
      int nHalf = n >> 1;

      int[] seqA = new int[nHalf];
      int[] seqB = new int[nHalf];

      Integer num;
      List<Integer> listA = new ArrayList<>();
      List<Integer> listB = new ArrayList<>();
      Map<Integer,Integer> mapA = new HashMap<>();
      Map<Integer,Integer> mapB = new HashMap<>();
      int offset=0,next=0;
      char regx = ' ';
      for(int i=0, j=0; i<n; i++, j= i >> 1) {
        if((next = line.indexOf(regx,offset)) == -1)
          next = line.length();
        num = new Integer(line.substring(offset, next));
        offset = ++next;

        if((i & 1) == 0) {
          seqA[j] = num;
          if(mapA.containsKey(num)) {
            mapA.replace(num, mapA.get(num) + 1);
          } else {
            mapA.put(num, 1);
            listA.add(num);
          }
        }
        else {
          seqB[j] = num;
          if(mapB.containsKey(num)) {
            mapB.replace(num, mapB.get(num) + 1);
          } else {
            mapB.put(num, 1);
            listB.add(num);
          }
        }
      }

      int vma,vmb,xa,xb;
      vma = vmb = xa = xb =0;
      for (Integer var : listA) {
        int ma = mapA.get(var);
        if(vma < ma) {
          vma = ma;
          xa = var;
        }
      }
      for (Integer var : listB) {
        int mb = mapB.get(var);
        if(vmb < mb) {
          vmb = mb;
          xb = var;
        }
      }

      int cca = nHalf - vma;
      int ccb = nHalf - vmb;

      int vma2,vmb2;
      vma2 = vmb2 = 0;
      int ans = 0;
      if(xa == xb) {
        for (Integer var : listA) {
          int ma = mapA.get(var);
          if(vma2 < ma && var != xa) {
            vma2 = ma;
          }
        }
        for (Integer var : listB) {
          int mb = mapB.get(var);
          if(vmb2 < mb && var != xb) {
            vmb2 = mb;
          }
        }
      
        int cca2 = nHalf -vma2;
        int ccb2 = nHalf -vmb2;

        ans = cca2 > ccb2 ? cca + ccb2 : cca2 + ccb;
      }
      else {
        ans = cca + ccb;
      }

      System.out.println(ans);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
}

Measured memory_bytes: 45020
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  string s;
  cin >> s;
  bool ret = false;
  for(int i = 1; i < s.size(); i++) ret |= s[i-1] == 'A' && s[i] == 'C';
  if(ret) cout << "Yes\n";
  else cout << "No\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


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

int main() {
  int N;
  cin >> N;
  map<char, ll> mp;
  rep(i, N) {
    string s;
    cin >> s;
    mp[s[0]]++;
  }

  vector<ll> cnt(5);
  cnt[0] = mp['M'];
  cnt[1] = mp['A'];
  cnt[2] = mp['R'];
  cnt[3] = mp['C'];
  cnt[4] = mp['H'];

  ll ans = 0;
  for (int i = 0; i < 5; i++) {
    for (int j = i+1; j < 5; j++) {
      for (int k = j+1; k < 5; k++) {
        ans += (cnt[i] * cnt[j] * cnt[k]);
      }
    }
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3656
#include<stdio.h>
int main()
{
    int h,w;
    int i,j;
    while(1){
        scanf("%d %d", &h, &w);
        if(h==0&&w==0)break;
        for(i=0; i<h; i++){
            for(j=0; j<w; j++){
            if(i==0||i==h-1||j==0||j==w-1){
                printf("#");
            }
            else{
                printf(".");
            }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2604
#include<bits/stdc++.h>
using namespace std;
typedef long long i64;
const int N=2e5+5;
const i64 INF=1e18;

int a[N];
int n;
i64 m;

int bs1(int l,int r,i64 x,i64 y){
	int mid;
	while(l<=r){
		mid=(l+r)>>1;
		if(a[mid]*x>y)l=mid+1;
		else r=mid-1;
	}
	return r;
}

int bs2(int l,int r,i64 x,i64 y){
	int mid;
	while(l<=r){
		mid=(l+r)>>1;
		if(a[mid]*x<=y)l=mid+1;
		else r=mid-1;
	}
	return r;
}

int clc(i64 x,int v){
	if(a[v]==0){
		if(x>=0)return v-1;
		else return 0;
	}
	else if(a[v]<0){
		return v-1-bs1(1,v-1,a[v],x);
	}
	else{
		return bs2(1,v-1,a[v],x);
	}
}

bool chk(i64 x){
	int i;
	i64 s=0;
	for(i=1;i<=n;i++)
		s+=clc(x,i);
	return s>=m;
}

i64 bnsr(i64 l,i64 r){
	i64 mid;
	l+=INF,r+=INF;
	while(l<=r){
		mid=(l+r)>>1;
		if(chk(mid-INF))r=mid-1;
		else l=mid+1;
	}
	return l-INF;
}

int main()
{
	int i;
	scanf("%d%lld",&n,&m);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	printf("%lld",bnsr(-INF,INF));
	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i = 0;i < n;i++)
#define PRN(n) printf("%d\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(s) printf("%c",s)
int main(void){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if((b*10+c)%4){
    PRS("NO");
  }else{
    PRS("YES");
  }
  return 0;
}
/*
scanf("%d",&n);
scanf("%d %d",&a,&b);
*/

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 4001001001001001001;
long double EPS = 1e-9;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<tuple<ll,ll,ll>>>;

// MOD確認

int main(){
    string S,T;
    cin >> S >> T;
    if(T.substr(0,S.size()) == S) cout << "Yes" << endl;
    else cout << "No" << endl;
} 


Measured memory_bytes: 3640
//>>>>>>>>>>>>>>>>>>>>>>>>>>JAI BAJRANG BALI<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<//
//😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😝😝😝😝😝😝😝😝😝😝😝😝😝😂😂😂😂😂😂😂😜😜😜😜😜😜😜😜😜😜😜
#define HARSH_JUDGE
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define db(x)                   cout<<#x<<"="<<x<<'\n'
#define db2(x,y)                 cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define setbits(x)      __builtin_popcountll(x)
#define str string
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,n) for(ll i=a;i<n;i++)
#define forr(i,n,a) for(ll i=n;i>=a;i--)
#define cases   long long t;cin>>t;while(t--)
#define eb emplace_back
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define ff first
#define ss second
#define pb push_back
#define mem(a,x) memset(a,x,sizeof(a))
#define sp(x,y)         fixed<<setprecision(y)<<x
#define nl '\n'
#define sz(x) ((int)(x).size())
const int mod = (int) 1e9 + 7 ;
const int MOD = (int) 998244353 ;
const int INF = (int) 1e18 ;
const ll N = 1e5 + 5;
#define printall(a) fo(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;



typedef vector<int> vi;
typedef map<ll, ll> mll;
typedef set<int> si;
typedef unordered_set<int> usi;
typedef map<ll, int> mli;
typedef map<char, int> mci;
typedef vector<long long> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpl;
typedef vector<vector<int> > vv;

bool cmp(const pair<ll, ll>& a, const pair<ll, ll>& b)
{

	return a.ss < b.ss;
}

// >>>>>>>>>>>>>>>>>>>>>>>>>>TOR DE DUSHMAN KI NALI<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<//

void solve()
{

	ll n, w;
	cin >> n >> w;
	vll dp(w + 1);
	fo(i, 0, n)
	{
		ll val, wt;
		cin >> wt >> val;
		for (ll j = w - wt; j >= 0; j--)
		{
			dp[j + wt] = max(dp[j + wt], val + dp[j]);
		}
	}
	ll mx = 0;
	fo(i, 0, w + 1)
	{
		mx = max(mx, dp[i]);
	}
	cout << mx;

	return;
}


int main()
{	fio
#ifndef HARSH_JUDGE
	freopen("inputf.in", "r", stdin);
	freopen("outputf.in", "w", stdout);
#endif
	ll t = 1;
	// cin >> t;
	// clock_t timest = clock();
	// cerr << "[Executes in " << (double)(clock() - timest) / CLOCKS_PER_SEC << "s]" << endl;
	while (t--)
	{
		solve();

	}
}

Measured memory_bytes: 3928
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<deque>
#include<queue>
using namespace std;

using ll = long long;
const int INF = 1001001001;
const ll LLINF = 1001001001001001001;
const int MOD = 1000000007;

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

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

  int position = s.size() - 1;
  const string dreamer = "dreamer";
  const string dream = "dream";
  const string eraser = "eraser";
  const string erase = "erase";

  bool res = true;
  while (position >= 0) {
    bool isOk = true;

    for (int i = 0; i < dreamer.size(); i++) {
      if (s[position - i] != dreamer[dreamer.size() - i - 1]) isOk = false;
    }
    if (isOk) {
      position -= dreamer.size();
      continue;
    }

    isOk = true;
    for (int i = 0; i < eraser.size(); i++) {
      if (s[position - i] != eraser[eraser.size() - i - 1]) isOk = false;
    }
    if (isOk) {
      position -= eraser.size();
      continue;
    }

    isOk = true;
    for (int i = 0; i < dream.size(); i++) {
      if (s[position - i] != dream[dream.size() - i - 1]) isOk = false;
    }
    if (isOk) {
      position -= dream.size();
      continue;
    }

    isOk = true;
    for (int i = 0; i < erase.size(); i++) {
      if (s[position - i] != erase[erase.size() - i - 1]) isOk = false;
    }
    if (isOk) {
      position -= erase.size();
      continue;
    }

    res = false;
    break;
  }
  cout << (res ? "YES" : "NO") << endl;
}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int A[101010],B[101010];
vector<int> V;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) {
		cin>>A[i];
		B[i]=A[i];
	}
	sort(B,B+N);
	int NG=0;
	FOR(i,N) {
		A[i]=lower_bound(B,B+N,A[i])-B;
		NG+=(A[i]-i+1000000)%2;
	}
	cout<<NG/2<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 2e5+23;

int a[N];
int n, k;

bool check(int x) {
  int cnt = k;
  for (int i = 0; i < n; ++i) {
    if (a[i] <= x) continue;
    cnt -= a[i]/x;
    if (cnt < 0) return false;
  }
  return true;
}

void solve() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a+i);
  }
  int lo = 0, hi = 1e9+1;
  while (lo+1 < hi) {
    int mid = (lo+hi)/2;
    if (check(mid)) hi = mid;
    else lo = mid;
  }
  printf("%d", hi);
}

int main() {
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 4544
#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>	// greater<int> はfunctionalヘッダ
using namespace std;

long long INF = 10000000000000;

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

	sort(a.begin(),a.end(),greater<>());
	
	long long tate = 0;
	long long yoko = 0;
	for(int i = 0; i < n - 1; ++i) {
		if(a[i] == a[i+1]) {
			if(tate==0) {
				tate = a[i];
			} else {
				yoko = a[i];
				break;
			}
			++i;
		}
	}
	cout << tate * yoko << endl;

	return 0;
}


Measured memory_bytes: 768
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    class QuestionB
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 整数の入力
            int n = int.Parse(Console.ReadLine());

            // 文字列の入力
            string s = Console.ReadLine();

            string targets = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            string result = "";

            foreach (char c in s)
            {
                int index = (targets.IndexOf(c) + n) % 26;
                result += targets[index];
            }


            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 34772
while True:
    a, op, b = input().split()   # 3変数ともに文字列として読み込む
    a =int(a)                   # a を整数に変換
    b = int(b)                   # b を整数に変換


    if op=="?": # opが"?"の時は終了
        break
    else:    #opが"?"以外の時
        if op=="+" :
          print (a+b)
        elif op=="-" :
          print (a-b)
        elif op=="*" :
          print (a*b) 
        else :
          print (a//b)



Measured memory_bytes: 5592
#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);cout.precision(20);}} fast;

/* define */
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) (upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X))
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto xXx:v)cerr<<xXx<<' ';cerr<<endl;
#define Yes(X) if(X){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define YES(X) if(X){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define ctoi(C) (C-'0')
#define pow2(x) ((long long)((long long)1<<x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int,int>;
using pl = pair<long long,long long>;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1,0,-1,0};
const long long dy[] = {0,1,0,-1};
const long long dx8[] = {1,1,0,-1,-1,-1,0,1};
const long long dy8[] = {0,1,1,1,0,-1,-1,-1};
const long long dx9[] = {1,1,0,-1,-1,-1,0,1,0};
const long long dy9[] = {0,1,1,1,0,-1,-1,-1,0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
long long max(long long x,int y){return max(x,(long long)y);}
long long max(int x,long long y){return max((long long)x,y);}
long long min(long long x,int y){return min(x,(long long)y);}
long long min(int x,long long y){return min((long long)x,y);}

/* liblary */



/* main */

signed main(){
    ll N;
    cin >> N;
    vl A(N);
    FOR(i,0,N)cin >> A[i];
    ll ans = INF;
    FOR(i,0,N){
        ll tmp = 0;
        while(A[i]%2 == 0){
            tmp++;
            A[i] /= 2;
        }
        chmin(ans,tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
ll MOD = 1000000007;
ll INF = 214748364700000000;
double EPS = 1e-12;
double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

int main(){
   ll N;cin >> N;
   vector<pair<string,ll>> A(N);
   ll sum = 0,ans = 0;
   rep(i,N){
       cin >> A[i].first >> A[i].second;
       ans += A[i].second;
   }
   string X;
   cin >> X;
   rep(i,N){
       sum += A[i].second;
       if(A[i].first == X){
           break;
       }
   }
   cout << ans - sum << endl;
}


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

#define _p(...) (void)printf(__VA_ARGS__)
#define forr(x,arr) for(auto&& x:arr)
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) _rep3(i,0,n)
#define _rep3(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2,)(__VA_ARGS__)
#define _rrep2(i,n) _rrep3(i,0,n)
#define _rrep3(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
#define bit(n) (1LL<<(n))
#define sz(x) ((int)(x).size())
#define fst first
#define snd second
using ll=long long;using pii=pair<int,int>;
using vb=vector<bool>;using vs=vector<string>;
using vi=vector<int>;using vvi=vector<vi>;using vvvi=vector<vvi>;
using vl=vector<ll>;using vvl=vector<vl>;using vvvl=vector<vvl>;
using vd=vector<double>;using vvd=vector<vd>;using vvvd=vector<vvd>;
using vpii=vector<pii>;using vvpii=vector<vpii>;using vvvpii=vector<vvpii>;
template<typename T>T read(){T t;cin>>t;return t;}
template<class T,class U>ostream&operator<<(ostream&o,const pair<T,U>&p){o<<'('<<p.fst<<", "<<p.snd<<')';return o;}

const long long mod = 1000000007;

ll solve() {
  int n = read<int>();
  vector<int> A(n);
  rep(i, n) A[i] = read<int>();

  map<int, int> co;
  forr(a, A) {
    if (a % 2 == n % 2) return 0;
    co[a]++;
  }

  ll ans = 1;

  if (co[0] >= 2) return 0;
  forr(an, co) {
    int a = an.fst;
    int n = an.snd;
    if (a == 0) continue;
    if (n != 2) return 0;
    ans *= 2;
    ans %= mod;
  }
  return ans;

  /*
  rep(i, n) {
    int a = A[i];
    int s2 = n - a - 1;
    if (s2 % 2) {
      return 0;
    }
    int s = s2 / 2;
    int m = s + a;
    _p("%d,%d,%d\n", a,s,m);
  }
  */
}

void Main() {
  cout << solve() << endl;
}
int main() { cin.tie(nullptr); ios::sync_with_stdio(false); Main(); return 0; }


Measured memory_bytes: 2944
// Problem : D - Leaping Tak
// Contest : AtCoder - AtCoder Beginner Contest 179
// URL : https://atcoder.jp/contests/abc179/tasks/abc179_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

// Macros

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int, int>
#define mii map<pii, int>
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define sz(x) (int) x.size()
#define mod 998244353
#define EPS 1e-9
#define inf 1e10
#define PI acos(-1.0)
#define int long long
#define N 100005

// Solution

int n, k;
vii p;

class SegTree {
  int tl, tr, sum;
  SegTree *left, *right;

 public:
  SegTree(int l, int r) {
    sum = 0;
    tl = l;
    tr = r;
    left = nullptr;
    right = nullptr;
  }

  void makeChildren() {
    int tm = (tl + tr) / 2;
    left = new SegTree(tl, tm);
    right = new SegTree(tm + 1, tr);
  }

  void update(int pos, int val) {
    sum += val;
    if (tl == tr) return;
    if (left == nullptr) makeChildren();
    if (pos <= left->tr)
      left->update(pos, val);
    else
      right->update(pos, val);
  }

  int get(int l, int r) {
    if (l > tr || r < tl) return 0;
    if (tl >= l && tr <= r) return sum;
    if (left == nullptr) return 0;
    return left->get(l, r) + right->get(l, r);
  }
};

void solve() {
  cin >> n >> k;
  p.resize(k);
  for (auto & [ a, b ] : p) {
    cin >> a >> b;
  }
  SegTree *st = new SegTree(1, n);
  vector<int> dp(n + 1);
  dp[1] = 1;
  st->update(1, 1);
  for (int i = 2; i <= n; i++) {
    for (auto[a, b] : p) {
      int l = max(1ll, i - b);
      int r = max(0ll, i - a);
      dp[i] += st->get(l, r);
      dp[i] %= mod;
    }
    st->update(i, dp[i]);
  }
  cout << dp[n];
}

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

  int tests;
  tests = 1;
  // cin>>tests;

  for (int test = 1; test <= tests; test++) {
    // cout<<"Case #"<<test<<": ";
    solve();
  }

  return 0;
}

Measured memory_bytes: 23528
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int n,i;
	string s,t="hi";
	cin >> s;
	n = s.l_ength();
	if(n%2){
		cout << "No" << endl;
		return 0;
	}
	for(i=0; i<n; ++i){
		if(s[i]!=t[i%2]){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll a,b;
	scanf("%lld%lld",&a,&b);
	ll ans=0;
	rep(i,a,b+1)if(i/10000==i%10&&i/1000%10==i/10%10)ans++;
	printf("%lld",ans);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

signed main(){

  int n; cin >> n;
  vector<int> a(n);
  map<int,int> mp;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    mp[a[i]]++;
  }

  if(mp[0] == n){
    cout << "Yes" << endl;
    return 0;
  }
  if(n%3 != 0){
    cout << "No" << endl;
    return 0;
  }
  vector<int> v;
  for(auto p : mp){
    for(int j = 0; j < p.second / (n/3); j++){
      v.push_back(p.first);
    }
  }
  if(v.size() == 3 && ((v[0]^v[1]^v[2]) == 0)){
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;

  return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<long long> a(n);
  long long ans = 0;
  long long sum = 0;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    sum += a[i];
    sum %= 1000000007;
  }
  for(int i = 0; i < n; i++){
    sum -= a[i];
    if(sum < 0) sum += 1000000007;
    ans += a[i] * sum;
    ans %= 1000000007;
  }
  cout << ans << endl;
}


Measured memory_bytes: 4764
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <map>
#include <vector>
#include <string>
#include <vector>
#include <cassert>
#include <cmath>
#include <cctype>
#include <queue>
#include <algorithm>
#include <memory>
#include <memory.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1 << 30;

int h, w, n;
int dy[] = {
	1, 0, -1, 0
};
int dx[] = {
	0, 1, 0, -1
};
char area[1002][1002];
int dis[1002][1002];
P fac[10];

int bfs(P s, P g){
	queue<P> que;
	fill(&dis[0][0], &dis[1001][1001]+1, INF);
	que.push(s);
	dis[s.first][s.second] = 0;
	while(!que.empty()){
		P p = que.front();
		que.pop();
		if(p == g) break;
		int y = p.first;
		int x = p.second;
		for(int i = 0; i < 4; i++){
			int y2 = y + dy[i];
			int x2 = x + dx[i];
			if(area[y2][x2] == 'X') continue;
			if(dis[y2][x2] > dis[y][x] + 1){
				dis[y2][x2] = dis[y][x] + 1;
				que.push(P(y2, x2));
			}
		}
	}
	return dis[g.first][g.second];
}

int main(){
	while(cin >> h >> w >> n){
		fill(&area[0][0], &area[1001][1001], 'X');
		for(int i = 1; i <= h; i++){
			for(int j = 1; j <= w; j++){
				cin >> area[i][j];
				if(area[i][j] == 'S'){
					area[i][j] = '.';
					fac[0] = P(i,j);
				}else if(isdigit(area[i][j])){
					fac[area[i][j] - '0'] = P(i,j);
					area[i][j] = '.';
				}
			}
		}
		int res = 0;
		for(int i = 0; i < n; i++){
			res += bfs(fac[i], fac[i+1]);
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 5776
var stdin = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = stdin.split('\n');
var header = lines.shift().trim().split(' ');
var n = parseInt(header[0], 10);
var q = parseInt(header[1], 10);
var tasks = [];
lines.forEach(function(line) {
  if (line !== '') {
    var task = line.trim().split(' ');
    tasks.push({
      name: task[0],
      time: parseInt(task[1], 10)
    });
  }
});
var time = 0;
while (tasks.length > 0) {
  var task = tasks.shift();
  if (task.time - q <= 0) {
    time += task.time;
    console.log([task.name, time].join(' '));
  } else {
    task.time -= q;
    tasks.push(task);
    time += q;
  }
}

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

using namespace std;
int main(void){
    string N;
    cin>>N;
    int sum = 0;
    for(int i=0;i<N.length();i++){
        sum += N[i]-'0';
    }
    stoi(N)%sum == 0? cout<<"Yes"<<endl:cout<<"No"<<endl;

    return 0;

}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int a,b,sum=1;
	cin>>a>>b;
	if(b==1){
	cout<<"0";
	return 0;
    }
    b-=a;
    if(b<=0){
	cout<<"1";
	return 0;
    }
    for(int i=1;i<=50;i++){
    	sum++;
		b=b-a+1;
		if(b<=0)
		break;	
	}
	cout<<sum;
	return 0;
}


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

int cur, heap[2000000];

void maxHeapify (int in) {
  int left, right, max, temp;
  left = 2 * in;
  right = (2 * in) + 1;

  if (left <= cur && heap[left] > heap[in])
    max = left;
  else
    max = in;

  if (right <= cur && heap[right] > heap[max])
    max = right;

  if (max != in) {
    temp = heap[in];
    heap[in] = heap[max];
    heap[max] = temp;
    maxHeapify(max);
  }
}

int extract() {
  int maxVal;

  if(cur < 1)
    return -1;

  maxVal = heap[1];
  heap[1] = heap[cur--];
  maxHeapify(1);

  return maxVal;
}

void increaseVal(int i, int val) {
  int temp;

  if(val < heap[i])
    return;

  heap[i] = val;

while (i > 1 && heap[i/2] < heap[i]) {
    temp = heap[i];
    heap[i] = heap[i/2];
    heap[i/2] = temp;
    i = i/2;
  }
}

void insert(int val) {
  heap[++cur] = -1;
  increaseVal(cur, val);
}

int main() {
  int val;
  char command[20];

  scanf("%s", command);

  while (strcmp(command, "end")) {
    if (!strcmp(command, "insert")) {
      scanf("%d", &val);
      insert(val);
    } else
      printf("%d\n", extract());

    scanf("%s", command);
  }
}



Measured memory_bytes: 5608
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	r := io.NextInt()
	io.Println(2 * math.Pi * float64(r))
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1780
#include<bits/stdc++.h>
#define Int long long
using namespace std;

int main(){
  int n;
  string w[111];
  cin>>n;
  for(int i=0;i<n;i++){
	cin>>w[i];
  }
  int f=1;
  
  for(int i=0;i<n;i++)
	for(int j=i+1;j<n;j++)
	  if(w[i]==w[j])f=0;

  for(int i=1;i<n;i++)
	if(w[i-1][w[i-1].size()-1]!=w[i][0])f=0;
  
  cout<<(f?"Yes":"No")<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;

int main() {
    cin.tie(0);
    cin.sync_with_stdio(0);
    
    int n, m, d, t;
    map<int, int> mp;
    cin >> n;
    for (int i = 0; i < n; i++) {
        scanf("%d", &d);
        mp[d]++;
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
        scanf("%d", &t);
        mp[t]--;
    }
    
    bool ok = true;
    for (auto u:mp) if (u.second < 0) ok = false;
    cout << (ok ? "YES" : "NO") << endl;
    
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
ll mod = 1000000007;

struct edge {
  public:
    ll from, to, cost;
    edge() {}
    edge(ll f, ll t, ll c) {
        from = f;
        to = t;
        cost = c;
    }
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, m, p;
    cin >> n >> m >> p;
    vector<edge> g(m);
    vector<vector<ll>> back_graph(n);
    rep(i, m) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[i] = edge(a, b, -(c - p));
        back_graph[b].push_back(a);
    }

    ll inf = 2LL << 60;
    vector<ll> d(n);
    fill(d.begin(), d.end(), inf);
    d[0] = 0;

    vector<ll> use(n);
    use[n - 1] = true;
    auto dfs = [&](auto self, ll now) -> void {
        for (auto next : back_graph[now]) {
            if (use[next]) {
                continue;
            }
            use[next] = true;
            self(self, next);
        }
    };
    dfs(dfs, n - 1);

    ll counter = 0;
    while (true) {
        counter++;
        bool update = false;
        for (edge e : g) {
            if (!use[e.from] || !use[e.to]) {
                continue;
            }
            if (d[e.from] != inf && d[e.to] > d[e.from] + e.cost) {
                d[e.to] = d[e.from] + e.cost;
                update = true;
            }
        }
        if (!update)
            break;

        if (counter == n) {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << max(0LL, -d[n - 1]) << endl;
    return 0;
}



Measured memory_bytes: 3968
#include<bits/stdc++.h>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 2000000000
#define ninf -2000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
// Use cout.flush() for interactive problems.
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int n;
int a[100005][4];
int dp[100005][4];
int compute(int i, int t)
{
    if(i==n) return 0;
    if(dp[i][t]!=-1) return dp[i][t];
    int j;
    int ans = ninf;
    FOR0(j, 3)
    {
        if(j!=t)
        {
            ans = MAX2(ans, a[i][j] + compute(i+1, j));
        }
    }
    return dp[i][t] = ans;
}
int main()
{
    she_told_me_dont_worry
    int i, j;
    cin>>n;
    FOR0(i, n) FOR0(j, 3)
    {
        cin>>a[i][j];
        dp[i][j] = -1;
    }
    int ans = ninf;
    FOR0(i, 3)
    {
        ans = MAX2(ans, compute(0, i));
    }
    cout<<ans;
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 11264
#include <iostream>
#include <vector>
using namespace std;
void out_vec(vector<int> vec, int len_vec)
{
    for (int i = 0; i < len_vec; i++)
    {
        cout << vec[i];
        if (i == len_vec - 1)
            cout << "\n";
        else
            cout << " ";
    }
}

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

    for (int i = 0; i < N; i++)
    {
        int tmp_v = A[i];
        int j = i - 1;
        while (j >= 0 && A[j] > tmp_v)
        {
            A[j + 1] = A[j];
            j--;
        }
        A[j + 1] = tmp_v;
        out_vec(A, N);
    }
    return 0;
}


Measured memory_bytes: 3128
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let s = read::<String>().chars().collect::<Vec<_>>();
    let mut ans = 0;
    for i in 0..s.len() / 2 {
        if s[i] != s[s.len() - 1 - i] {
            ans += 1;
        }
    }
    println!("{}", ans);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
#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 twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define Reverse(a) reverse(All(a))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
class Modulo{
public:
    int val;
    static const int mod = 1e9+7;
    vector<int> factable = {1};
    vector<int> invtable = {1};
    int pro(int x,int y){return ((x%mod)*(y%mod))%mod;}
    int sum(int x,int y){return ((x%mod)+(y%mod))%mod;}
    int dif(int x,int y){int d =((x%mod)-(y%mod))%mod;if(d>=0){return d;}else{return d+mod;}}
    int quo(int x, int y){return pro(x,pow(y,mod-2));}
    int pow(int x,int y){
        if(y<=0){return 1;}
        if(y%2==0){int d = pow(x,y/2);return ((d%mod)*(d%mod))%mod;}
        else{return (x*pow(x,y-1))%mod;}
    }
    void operator=(int n){this->val = n%mod;}
    int operator+(int n){return sum(this->val,n);}
    int operator-(int n){return dif(this->val,n);}
    int operator*(int n){return pro(this->val,n);}
    int operator/(int n){return quo(this->val,n);}
    void operator+=(int n){this->val = sum(this->val,n);}
    void operator-=(int n){this->val = dif(this->val,n);}
    void operator*=(int n){this->val = pro(this->val,n);}
    void operator/=(int n){this->val = quo(this->val,n);}
    int fac(int x){
        //x! mod mod
        if(factable.size()<=x){
            int s = factable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return factable[x];
    }
    int facinv(int x){
        if(invtable.size()<=x){
            int s = invtable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return invtable[x];
    }
    int com(int x,int y){
        //xCy mod mod = x!/((x-y)!*y!) mod mod
        if(x-y<y)return com(x,x-y);
        return pro(fac(x),pro(facinv(x-y),facinv(y)));
    }
};

int n,a,b,c;
string s;

signed main(){
    cin >> a >> b >> c;
    if(a<c && c<b || b<c && c<a){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }



    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}
int nibul(auto a,auto b){
    int x = lower_bound(All(a),b) - a.begin();
    //key以上の初めてのitr
    return x;
}
int nibuu(auto a,auto b){
    int x = upper_bound(All(a),b) - a.begin();
    //key以下の最後のitr
    return x-1;
}


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


int main()
{
    ll N;
    cin >> N;

    int n = N % 10;
    switch(n){
        case 2:
        case 4:
        case 5:
        case 7:
        case 9:
        cout << "hon" << endl;
        break;
        case 0:
        case 1:
        case 6:
        case 8:
        cout << "pon" << endl;
        break;
        case 3:
        cout << "bon" <<endl;
        break;
    }
}

Measured memory_bytes: 3636
a,b,c,d=map(int,input().split())

if a<0 and b>0:
    ans=max(a*c,a*d,b*c,b*d,0)
elif c<0 and d>0:
    ans=max(a*c,a*d,b*c,b*d,0)
else:
    ans=max(a*c,a*d,b*c,b*d)

print(ans)


Measured memory_bytes: 61620
#include <bits/stdc++.h>
#include<iostream>
#include<cmath>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll=long long;
using P=pair<int,int>;
const int INF=1001001001;

int main(){
   int n; cin>>n;
   map<string,int> mp;
   rep(i,n){
      string s; cin>>s;
      mp[s]++;
   }
   int mx=0;
   //for文の範囲
   for(auto p:mp) mx=max(mx,p.second);
   for(auto p:mp){
      if(p.second!=mx) continue;
      cout<<p.first<<endl;
   }
   return 0;
}


Measured memory_bytes: 25216
#include<stdio.h>
int main(){
 int n, a = 0, p[20];
 scanf("%d", &n);
 for(int i = 0; i < n; i++) {
  scanf("%d", &p[i]);
 }

 for(int i = 1; i < n-1; i++) {
  if((p[i-1] < p[i] && p[i] < p[i+1])||(p[i-1] > p[i] && p[i] > p[i+1])) a++;
 }
 printf("%d", a);
}

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

#define EB emplace_back
#define int long long
#define F first
#define S second
#define N 500005
#define all(x) x.begin(),x.end()
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

void test_case(){
  int n; cin >> n;
  int res = 1;
  int Mod = 1e9 + 7;
  int ten = 1, eight = 1, nine = 1;
  for(int i = 0; i < n; i++){
    ten *= 10;
    ten %= Mod;
    eight *= 8;
    eight %= Mod;
    nine *= 9;
    nine %= Mod;
  }
  res = (ten + eight) % Mod;
  res = (res % Mod - (2 * nine) % Mod + Mod) % Mod;
  cout << res << endl;
}

int32_t main(){
	ios::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
	int tt = 1; 
	//cin >> tt;
	while(tt--){
    test_case();
    cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll ans;
    ll n;
    cin >> n;
    ans = modpow(10LL, n);
    ans -= modpow(9LL, n) * 2;
    ans %= mod;
    ans += modpow(8LL, n);
    ans %= mod;
    ans += mod;
    ans %= mod;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3640