akhauriyash/Code-Regression huggingface dataset:
package main

import "fmt"

func main() {
	var n, m, x int
	fmt.Scanf("%d %d %d", &n, &m, &x)

	c := []int{}
	a := [][]int{}

	for i := 0; i < n; i++ {
		var ci int
		fmt.Scanf("%d", &ci)
		c = append(c, ci)
		ai := []int{}
		for j := 0; j < m; j++ {
			var aij int
			fmt.Scanf("%d", &aij)
			ai = append(ai, aij)
		}
		a = append(a, ai)
	}

	_, ans := search(0, -1, n, m, x, c, a, make([]int, m))
	fmt.Println(ans)
}

func search(ci, l, n, m, x int, c []int, a [][]int, a0 []int) ([]int, int) {
	a1 := make([]int, m)
	copy(a1, a0)

	if l >= 0 {
		ci += c[l]
		flag := true
		for i, v := range a[l] {
			a1[i] += v
			flag = (flag && a1[i] >= x)
		}

		if flag {
			return a1, ci
		}
	}

	var ansarr []int
	anscost := -1
	for i := l + 1; i < n; i++ {
		v1, v2 := search(ci, i, n, m, x, c, a, a1)
		if v1 != nil && (anscost < 0 || anscost > v2) {
			ansarr = v1
			anscost = v2
		}
	}

	return ansarr, anscost
}


Measured memory_bytes: 2252
import java.util.Scanner;


public class Main {

	static Scanner sc = new Scanner(System.in);
	static int a, b, c, d, n, ans;
	
	public static void main(String[] args) {
		
		while(read()){
			solve();
		}

	}
	
	public static boolean read(){
		if(!sc.hasNext()) return false;
		
		n = sc.nextInt();
		
		return true;
	}
	
	public static void solve(){
		
		if(n > 36){
			System.out.println(0);
			return;
		}
		
		ans = 0;
		
		for(a = 0; a < 10; a++){
			for(b = a; b < 10; b++){
				for(c = b; c < 10; c++){
					for(d = c; d < 10; d++){
						if((a+b+c+d)==n){
							if(a == b && b == c && c == d){
								ans++;
								break;
							}
							if(a == b && b == c && c != d){
								ans += 4;
								break;
							}
							if(a == b && b != c && c == d){
								ans += 6;
								break;
							}
							if(a != b && b == c && c == d){
								ans += 4;
								break;
							}
							if(a != b && b != c && c == d){
								ans += 12;
								break;
							}
							if(a != b && b == c && c != d){
								ans += 12;
								break;
							}
							if(a == b && b != c && c != d){
								ans += 12;
								break;
							}
							if(a != b && b != c && c != d){
								ans += 24;
								break;
							}
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
using namespace std;
const int N =2e5,OO=0x3f3f3f3f;
int n,k,x;
map<int,int>mp;
int main()
{
    cin>>n>>k;
    for(int i=0;i<k;i++){
        cin>>x;
        mp[x]=1;
    }
    for(int i=1;true;i++){
        if(i>=n){
            string ans=to_string(i);
            bool f=0;
            for(int j=0;j<ans.length();j++){
                if(mp[ans[j]-'0']==1){
                    f=1;
                    break;
                }
            }
            if(!f){
                cout<<ans<<endl;
                return 0;
            }
        }
    }
}


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;


int main() {
  string s;
  cin >> s;
  rep(i,3){
    if (s[i] == '1') s[i] ='9';
    else s[i] = '1';
  }
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 256
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //When end-of-a-lin bit is 1, times simple N.
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    long long N,M;cin >> N >> M;
    string S,T;cin >> S >> T;
    if(S.size() == 1 && T.size() == 1){
        if(S != T){
            cout << -1 << endl;
        }
        else{
            cout << 1 << endl;
        }
        return 0;
    }
    long long L = lcm(N,M);
    map<long long,char> charIndex;
    for(long long i = 0;i<N-1;i++){
        long long index = 1+(L/N)*i;
        charIndex[index] = S.at(i);
    }
    for(long long i = 0;i<M-1;i++){
        long long index = 1+(L/M)*i;
        if(!charIndex.count(index)) continue;
        if(charIndex[index] != T.at(i)){
            cout << -1 << endl;
            return 0;
        }
    }
    cout << L << endl;
}

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

int main(){
  int n, p[101], m[101][101], i, j, k, l;
  cin >> n;
  for(i = 1;i <= n;i++){
    cin >> p[i-1] >> p[i];
  }

  for(i = 1;i <= n;i++) m[i][i] = 0;
  for(l = 2;l <= n;l++){
    for(i = 1;i <= n - l + 1;i++){
      j = i + l - 1;
      m[i][j] = (1 << 21);
      for(k = i;k <= j - 1;k++){
        m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]);
      }
    }
  }

  cout << m[1][n] << endl;

  return 0;
}

Measured memory_bytes: 3140
import Text.Printf

parseInts :: String -> [Int]
parseInts = map (\x -> read x :: Int).words

main :: IO ()
main = do
    line <- getLine
    line <- getLine
    let
        nums = parseInts line
        minN = minimum nums
        maxN = maximum nums
        sumN = sum nums
    printf "%d %d %d\n" minN maxN sumN

Measured memory_bytes: 11316
#include<iostream>
#include<cmath>

int main() {
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		double xa, ya, ra, xb, yb, rb, dist;
		std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
		dist = std::sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
		if (dist + rb < ra) std::cout << 2 << std::endl;
		else if (dist + ra < rb) std::cout << -2 << std::endl;
		else if (dist <= ra + rb) std::cout << 1 << std::endl;
		else std::cout << 0 << std::endl;
	}
	return 0;
}


Measured memory_bytes: 3052
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};


int main(){
	cin.tie(0);
    int k;
    string s;
    cin >> k >> s;
    if(s.size()<=k){
        cout << s << endl;
        return 0;
    }
    else{
        string t;
        t = s.substr(0,k);
        t += "...";
        cout << t << endl;
    }

	return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for (int i=s;i<=t;i++)
#define pi acos(-1)
#define FOR(i,s,t) for (int i = s; i < t; i++)
typedef long long LL;
typedef long double LD;
typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef pair<PII, PII> PPP;
typedef pair<PII, int> PPI;
typedef pair<LL, PII> PLP;
typedef pair<double, PII> PDP;
#define repp(i,s,t) for (int i=s;i>=t;i--)
template<class T> T sqr(T x) {return x*x;}
#define debug(x) cerr<<#x"="<<(x)<<endl;
#define pb(x) push_back(x);
#define ori(x) x-'a'
#define y0 AERGAEWFAWERAw
#define y1 ASDFAEWRWERWERW
#define x0 gggsdfsfsfdf
#define x1 SAFREWRREWR
int a[400000], n;
LL solve() {
	if (a[1] > 0) return -1;
	rep(i,2,n) if (a[i] - a[i-1] > 1) return -1;
	LL ans = 0;
	repp(i,n,1) if (a[i]) {
		ans++;
		if (a[i] != a[i-1] + 1)
			ans += a[i] - 1;
	}
	return ans;
}
int main() {
	scanf("%d",&n);
	int ans = 0;
	rep(i,1,n) scanf("%d",&a[i]);
	cout << solve() << endl;
}




Measured memory_bytes: 1024
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){


}

Node treeMaximum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL)
    {
      y = x;
      if(z->key < x->key)x = x->left;
      else x = x->right;
    }
  z->parent = y;
  if(y == NIL)root = z;
  else if(z->key < y->key)y->left = z;
  else y->right = z;
}

void inorder(Node u){
  int i=0;
  if(u != NIL)
    {
      inorder(u->left);
      printf(" %d", u->key);
      inorder(u->right);
    }

}
void preorder(Node u){
  int i=0;
  if(u != NIL)
    {
      printf(" %d", u->key);
      preorder(u->left);
      preorder(u->right);
    }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 25296
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;



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

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

int main() {
    int n, m, l;
    cin >> n >> m >> l;
    using P = pair<int, int>;
    vector<vector<P>> G(n);
    for (int i = 0; i < m; ++i) {
        int a, b, c;
        scanf("%d %d %d", &a, &b, &c);
        a--; b--;
        if(c <= l){
            G[a].emplace_back(b, c);
            G[b].emplace_back(a, c);
        }
    }
    vector<vector<P>> ans(n, vector<P>(n, {INF<int>, INF<int>}));

    for (int i = 0; i < n; ++i) {
        ans[i][i] = {0, 0};
        vector<int> used(n);
        while(true){
            int v = -1;
            for (int u = 0; u < n; ++u) {
                if(!used[u] & (v == -1 || ans[i][u] < ans[i][v])) v = u;
            }
            if(v == -1) break;
            used[v] = 1;
            for (auto &&e : G[v]) {
                auto cost2 = ans[i][v];
                cost2.second += e.second;
                if(cost2.second > l){
                    cost2.second = e.second;
                    cost2.first++;
                }
                ans[i][e.first] = min(ans[i][e.first], cost2);
            }
        }
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int s, t;
        cin >> s >> t;
        s--; t--;
        cout << (ans[s][t].first == INF<int> ? -1 : ans[s][t].first) << "\n";
    }
    return 0;
}

Measured memory_bytes: 2432
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
vector<int>v[100001];
int main(){
    LL Q,H,S,D,N;
    cin >>Q>>H>>S>>D>>N;
    S=min(min(Q*4,H*2),S);
    if(S*2<=D)cout<<N*S<<endl;
    else cout<<N/2*D+(N%2)*S<<endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
const int N = 305;
char s[N];
int n, K;
int f[N][N][N];
int Dp(int l, int r, int x) {
	if (l > r) return 0;
	if (l == r) return 1;
	int &ans = f[l][r][x];
	if (~ ans) return ans;
	if (s[l] == s[r]) return ans = 2 + Dp(l+1, r-1, x);
	ans = Dp(l+1, r, x);
	ans = max(ans, Dp(l, r-1, x));
	if (x) ans = max(ans, 2 + Dp(l+1, r-1, x-1));
	return ans;
}
int main() {
	scanf("%s", s+1);
	n = strlen(s+1);
	cin >> K;
	memset(f, -1, sizeof f);
	cout << Dp(1, n, K) << endl;
	return 0;
}

Measured memory_bytes: 111232
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(11);
  int T;
  T = 1;
  while (T--) solve();
}

using pci = pair<char, int>;
vector<pci> runlength(string s) {
  vector<pci> ret;
  int cnt = 1;
  int n = sz(s);
  rep3(i, 1, n) {
    if (s[i] == s[i - 1]) ++cnt;
    else { ret.eb(s[i - 1], cnt); cnt = 1; }
  }
  ret.eb(s[n - 1], cnt);
  return ret;
}

void solve() {
  int n;
  cin >> n;
  int t;
  cin >> t;
  vector<int> a(n);
  cin >> a;

  // 差が最大のを買い続ける
  // 何ペアあるか
  int ma_ = 0;
  {
    int now = a[n - 1];
    for (int i = n - 2; i >= 0; --i) {
      chmax(ma_, now - a[i]);
      chmax(now, a[i]);
    }
  }
  cerr << ma_ << endl;

  int ans = 0;
  pii ma = pii(a[n - 1], 1);
  for (int i = n - 2; i >= 0; --i) {
    if (ma.F - a[i] == ma_) ans += ma.S;
    if (chmax(ma.F, a[i])) {
      ma.S = 1;
    } else if (ma.F == a[i]) ++ma.S;
  }
  cout << ans << endl;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/02/27  Problem: ABC 115 C / Link: http://abc115.contest.atcoder.jp/tasks/abc115_c  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL ans = 0LL;

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

	LL N, K; cin >> N >> K;
	VL a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}

	SORT(a);
	ans = LINF;
	FOR(i, 0, N) {
		int j = i + K-1;
		if (j < N) {
			LL ret = a[j] - a[i];
			ans = min(ans, ret);
		}
	}
	
	
	cout << ans << "\n";

	return 0;
}


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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int main(){
	int N; cin >> N;
	vector<int> a[3];
	a[0].resize(N);
	a[1].resize(N);
	a[2].resize(N);
	repp(i,0,N) cin >> a[0][i] >> a[1][i] >> a[2][i];
	vector<int> dp[3];
	dp[0].resize(N);
	dp[1].resize(N);
	dp[2].resize(N);
	dp[0][0] = a[0][0];
	dp[1][0] = a[1][0];
	dp[2][0] = a[2][0];
	repp(i,1,N) repp(j,0,3){
		dp[j][i] = 0;
		repp(k,0,3) if(j != k) dp[j][i] = max(dp[j][i],dp[k][i-1]+a[j][i]);
	}
	cout << max(dp[0][N-1],max(dp[1][N-1],dp[2][N-1])) << endl;
	return 0;
}


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//end



int main(){
   int n,p; scanf("%d%d",&n,&p);
   vector<int> a(n);
   rep(i,0,n)scanf("%d",&a[i]);
   rep(i,0,n)if(a[i]&1){
      printf("%lld\n",1LL<<(n-1));
      return 0;
   }
   printf(p?"0":"%lld\n",1LL<<n);
   return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to 
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second

using namespace std;

typedef long long LL;

const int N = 100010;

pair<LL, int> d[N];
pair<int, int> e[N];
map<LL, int> mmp;

int sz[N];

struct Edge{ int to, next; } edge[N * 2];
int head[N], num;
void add_edge(int a, int b) { edge[++ num] = (Edge){b, head[a]}, head[a] = num;}

LL sum = 0;

void dfs(int x, int f, int dis)
{
	sum += dis;
	RepG(i, x) if (v != f) dfs(v, x, dis + 1);
}

int main()
{
	int n;
	scanf("%d", &n);
	Rep(i, n){
		scanf("%lld", &d[i].fi);
		sz[i] = 1, d[i].se = i, mmp[d[i].fi] = i;
	}
	sort(d + 1, d + 1 + n);
	for (int i = n; i > 1; i --) {
		LL tmp = d[i].fi + 2 * sz[d[i].se] - n;
	//	printf("%d %lld\n", d[i].fi, tmp);
		if (tmp < d[i].fi && mmp[tmp]) e[i - 1] = mp(d[i].se, mmp[tmp]), sz[mmp[tmp]] += sz[d[i].se];
		else {printf("-1\n"); return 0;}
	}
	Rep(i, n - 1) add_edge(e[i].se, e[i].fi);
	dfs(d[1].se, 0, 0);
//	printf("%lld\n", sum);
	if (sum != d[1].fi) printf("-1\n"); 
	else Rep(i, n - 1) printf("%d %d\n", e[i].fi, e[i].se);
	
	return 0;
}

/*
d[a] - d[b] = n - sz[a] - sz[a]
d[b] = d[a] + 2 * sz[a] - n;
*/

Measured memory_bytes: 13824
n = int(input())
a = list(map(int, input().split()))

idx_of_min = idx_of_max = 0
for i in range(n):
    if a[i] < a[idx_of_min]:
        idx_of_min = i
    if a[i] > a[idx_of_max]:
        idx_of_max = i

print(a[idx_of_max] - a[idx_of_min])


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

int main(){
    int a,b,c;
    int sam=0;
    cin >> a;
    b=a/500;
    c=(a-b*500)/5;
    if(a>499){
        sam += 1000*b;
    }
    if(a%500!=0){
        sam += 5*c;
    }
    cout << sam << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#define int long long
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
#define endl '\n'
#define for(i,s,n) for(int i=s;i<n;i++)
#define vii vector<int>
int n, k;
int v[110];
int dp[100005][3];
int solve(int rem=k, bool player=0) {///0 for First ,1 for Second
	//if (rem < 0) return player;
	int& ret = dp[rem][player];
	if (~ret) return ret;
	ret = !player;
	for (i, 0, n) {
		if (v[i] <= rem) {
			if (solve(rem - v[i], !player) == player) {
				ret = player;
			}
		}
	}
	return ret;
}
signed main()
{
	   fast;
  
	cin >> n >> k;
	for (i, 0, n) cin >> v[i];
	memset(dp, -1, sizeof dp);
	int sol = solve();
	if (!sol) cout << "First\n";
	else cout << "Second\n";
}


Measured memory_bytes: 12592
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

int main() {
    string s, t;
    cin >> s >> t;
    ll n = s.size();
    ll m = t.size();

    vvl v(26);
    rep(i, n) {
        v[s[i] - 'a'].pb(i);
    } 
    rep(i, n) {
        v[s[i] - 'a'].pb(i+n);
    }

    ll ans = 0;
    ll p = 0;
    rep(i, m) {
        ll c = t[i] - 'a';
        if(v[c].size() == 0) {
            out(-1);
            re0;
        }
        p = *lower_bound(all(v[c]), p) + 1;
        if(p >= n) {
            p -= n;
            ans += n;
        }
    }
    
    ans += p;

    out(ans);
    re0;
}

Measured memory_bytes: 2800
import math
K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if (i == j) and (j == k):
                ans += math.gcd(i, math.gcd(j, k))
            elif (i == j) or (j == k):
                ans += 3 * math.gcd(i, math.gcd(j, k))
            else:
                ans += 6 * math.gcd(i, math.gcd(j, k))
print(ans)


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

int main()
{
  int a,b,c;
  int sum = 0;
  cin >> a >> b >> c;
 
  for (int i = a; i <= b; i++){
  if ( c % i == 0 )
   sum += 1;
  }
  cout << sum << endl;
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 100005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
    	if(c == '-') f = -1;
    	c = getchar();
    }
    while(c >= '0' && c <= '9') {
    	res = res * 10 +c - '0';
    	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
int N,A[MAXN];
int gcd(int a,int b) {
    return b == 0 ? a : gcd(b,a % b);
}
int check() {
    int c = 0,t;
    for(int i = 1 ; i <= N ; ++i) {
        if(A[i] & 1) {++c;t = A[i];}
    }
    if((N - c) & 1) return 1;
    if(c >= 2 || t == 1) return 0;
    return -1;
}
void Solve() {
    read(N);
    for(int i = 1 ; i <= N ; ++i) {
        read(A[i]);
    }
    int cnt = 0;
    while(1) {
        int x = check();
        if(x != -1) {
            if((x ^ cnt) == 1) puts("First");
            else puts("Second");
            return;
        }
        cnt ^= 1;
        int g = 0;
        for(int i = 1 ; i <= N ; ++i) {
            if(A[i] & 1) --A[i];
            g = gcd(g,A[i]);
        }
        for(int i = 1 ; i <= N ; ++i) {
            A[i] /= g;
        }
    }
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
    return 0;
}


Measured memory_bytes: 768
/*
░░░░██████████████████
░░▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ManavJ07▒▀██████▄
░███▀▒▒▒▒BITS▒▒▒▒▒▒▀█████
░▐██▒▒▒.........▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define dd double
#define MOD 998244353
#define nl cout<<endl
#define rt ll Q[100005]={0}
#define mp make_pair
#define test() ull t;cin>>t;while(t--)
#define pb push_back
#define ff first	
#define ss second
#define all(v) v.begin(),v.end()
#define s(ar,n) sort(ar,ar+n)
#define rs(ar,n) sort(ar, ar+n, greater<ll>()) 
#define oa(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n) for(ll i=0;i<n;i++)cin>>a[i];
#define ov(a,n) for(ll i=n-1;i>=0;i--)cout<<a[i]<<" ";nl
#define maxa(ar,N) *max_element(ar,ar+N)
#define mina(ar,N) *min_element(ar,ar+N)
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
ll powe(ll n,ll m){if(m==0)return 1;ll t=powe(n,m/2);if(m%2==0)return (t*t);return (((t*t))*n);}
ll mpowe(ll n,ll m){if(m==0)return 1;ll t=powe(n,m/2);t%=MOD;if(m%2==0)return (t*t)%MOD;return (((t*t)%MOD)*n)%MOD;}
ll logtwo(ll n){if(n==1)return 0;return logtwo(n/2)+1;}
int main()
{
    fastio();
    ll N,M,K,L;
    cin>>N>>L>>M>>K;
    if(N!=M)
        cout<<1<<endl;
    else
        cout<<0<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
		    arr[i]  = sc.nextInt();
		}
		Arrays.sort(arr);
		int min = Integer.MAX_VALUE;
		for (int i = 0; i < n - k + 1; i++) {
		    min = Math.min(min, arr[i + k - 1] - arr[i]);
		}
		System.out.println(min);
	}
}


Measured memory_bytes: 50396
import itertools, bisect

import math
def naive_cmb(n, r):
    if r < 0 or r > n:
        return 0
    return (math.factorial(n) // math.factorial(r)) // math.factorial(n-r)

N = int(input())
L = list(map(int, input().split()))

two_edge_sum = [sum(x) for x in list(itertools.combinations(L,2))]
two_edge_sum.sort()
ans = naive_cmb(N,3)

for l in L:
    ans -= bisect.bisect_right(two_edge_sum, l)

print(max(ans,0))

Measured memory_bytes: 224904
#include<stdio.h>

int main(){
	int res[30];
	int w,n;
	int aa,bb;
	int A;
	for(A=0;A<30;A++)
		res[A]=A+1;
	scanf("%d\n%d",&w,&n);
	for(A=0;A<n;A++){
		scanf("%d,%d",&aa,&bb);
		res[aa-1]+=res[bb-1];
		res[bb-1]=res[aa-1]-res[bb-1];
		res[aa-1]-=res[bb-1];
	}
	for(A=0;A<w;A++)
		printf("%d\n",res[A]);
	return 0;
}

Measured memory_bytes: 596
from collections import defaultdict as DD
N, K = map(int,input().split())
D = DD(int)
for i in range(N):
  a, b = map(int,input().split())
  D[a] += b

L = sorted(D.items(), key = lambda x: x[0])
i = 0
while True:
  if L[i][1] >= K:
    print (L[i][0])
    break
  else:
    K -= L[i][1]
    i += 1


Measured memory_bytes: 15324
N, M = [int(_) for _ in input().split()]
X = [int(_) for _ in input().split()]

X.sort()
Y = [X[i + 1] - X[i] for i in range(M - 1)]
Y.sort(reverse=True)

result = 0
for i, yi in enumerate(Y):
    if i >= N - 1:
        result += yi

print(result)

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

 int main(void)
 {
     string s,t;
     int i,flag=0;
     cin>>s;
     cin>>t;

     for(i=0;i<s.size();i++)
     {
         if(s[i] == t[i])
            flag = 1;
         else
            {
                flag = 0;
                break;
            }
     }
     if(flag == 1 && t.size() > s.size())
        cout<<"Yes"<<endl;
     else
        cout<<"No"<<endl;
     return 0;
 }


Measured memory_bytes: 3596
import std.stdio;
import std.conv;
import std.string;
import std.algorithm;

void main() {
  int k, n;
  readf("%d %d\n", &k, &n);
  auto a = readln.chomp.split.map!(to!int);
  int distmax = 0;
  for(int i=0; i<n-1; i++) {
    auto dist = a[i+1] - a[i];
    if(dist > distmax) distmax = dist;
  }
  auto dist = a[0] + (k - a[$-1]);
  if(dist > distmax) distmax = dist;
  writeln(k - distmax);
}


Measured memory_bytes: 10452
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long r = 1L;
        boolean existZero = false;
        boolean overThres = false;
        final long thres = 1000000000000000000L;
        for(int i=1; i<=N; i++) {
            long tmp = sc.nextLong();
            if(existZero) continue;
            if(tmp==0L) {
                existZero = true;
                continue;
            }
            long new_r = r * tmp;
            if(new_r> thres || new_r < 0 || new_r < r || new_r < tmp) {
                overThres = true;
            }
            r = new_r;
        }
        if(existZero) {
            System.out.println(0);
            return;
        }
        if(overThres) {
            System.out.println(-1);
            return;
        }
        System.out.println(r);
    }
}


Measured memory_bytes: 59748
#include<iostream>
#include<vector>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define int long long
using namespace std;
int n,k;

signed main(){
	cin>>n>>k;
	int x=n/k;
	if(k%2){
		cout<<x*x*x<<endl;
	}else{
		int y=(n+k/2)/k;
		cout<<x*x*x+y*y*y<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
list = list(map(int, input().split()))
sum = [0]
for i in range(n):
    sum.append( (list[i] + sum[i]) % m)
sum.sort()
sum.append(-1)
count = 0
result = 0
for i in range(1, n + 2):
    if sum[i] == sum[i - 1]:
        count += 1
    else:
        result += count * (count + 1) // 2
        count = 0
print(result)

Measured memory_bytes: 14696
N,K,Q=map(int,input().split())
A=[int(input())-1 for i in range(Q)]
X=[0 for i in range(N)]
for i in range(Q):
    X[A[i]]+=1
for i in range(N):
    X[i]+=K-Q
for i in range(N):
    if X[i]<=0:
        print("No")
    else:
        print("Yes")


Measured memory_bytes: 11792
n = gets.to_i

def lcs_x(xs, ys, bef)
    ys_all = Array.new(ys)
    if xs == []
        return bef.last
    else
        x    = xs.shift
        memo = lcs_y(x, ys, bef, [0])
        lcs_x(xs, ys_all, memo)
    end
end

def lcs_y(x, ys, bef, memo)
    if ys == []
        return memo
    elsif x == ys[0]
        memo << bef[0] + 1
    else
        memo << [bef[1], memo.last].max
    end
    ys.shift; bef.shift
    lcs_y(x, ys, bef, memo)
end

n.times do
    xs = gets.chomp.split("")
    ys = gets.chomp.split("")
    bef = Array.new(ys.size + 1) {0}
    p lcs_x(xs, ys, bef)
end


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

typedef long long LL;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

template<typename T>
T gcd(T a, T b) {
    T r, temp;
    while(1) {
        if(a < b) {
            temp = a;
            a = b;
            b = temp;
        }
        if(b < 1) continue;

        while((r = a % b) != 0) {
            a = b;
            b = r;
        }
        return b;
    }
}

int main() {
    LL N;
    cin >> N;
    vector<LL> a(N);
    vector<LL> g(N);
    vector<LL> gr(N);
    REP(i, N) {
        cin >> a[i];
    }
    g[1] = a[0];
    gr[N - 2] = a[N - 1];
    FOR(i, 2, N) {
        g[i] = gcd(g[i - 1], a[i - 1]);
    }
    for(int i = N - 3;0 <= i;i--) {
        gr[i] = gcd(gr[i + 1], a[i + 1]);
    }
    LL res = max(g[N - 1], gr[0]);
    FOR(i, 1, N - 1) {
        res = max(res, gcd(g[i], gr[i]));
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 2560
package main

import "fmt"

func main() {
	var N int
	var S string
	fmt.Scan(&N, &S)
	T := make([]int, N)
	if S[0] == 'E' {
		T[0] = 1
	}
	for i := 1; i < N; i++ {
		one_if_east := 0
		if S[i] == 'E' {
			one_if_east = 1
		}
		T[i] = T[i-1] + one_if_east
	}
	min := int(1E6)
	for i := 0; i < N; i++ {
		l := 0
		if i != 0 {
			l = T[i-1]
		}
		r := T[N-1] - T[i]
		lcnt := i - l
		rcnt := r
		need_turn := lcnt + rcnt
		if need_turn < min {
			min = need_turn
		}
	}
	fmt.Println(min)
}

func sum(slice []int) int {
	s := 0
	for _, d := range slice {
		s += d
	}
	return s
}


Measured memory_bytes: 4864
#include<cstdio>
#include<cstring>
#define inlien inline
#define retrun return
#define cpnst const
typedef long long ll;
struct edg
{int p,t,l;ll w;}e[2222222];
int h[2222222],tot=1;
inline void build(int x,int y,int l,ll w)
{e[++tot]=(edg){h[x],y,l,w},h[x]=tot;}
inline void ins(int x,int y,int l,ll w)
{build(x,y,l,w),build(y,x,0,-w);}
int frm[2222222],fri[2222222];
ll dis[2222222];
int tn=2,S=1,T=2;
#include<queue>
std::queue<int>q;
bool isin[2222222];
ll spfa()
{
	register int i;
	for(i=1;i<=tn;i++)dis[i]=-1e18;
	dis[S]=0,isin[S]=1,q.push(S);
	for(;!q.empty();)
	{
		int p=q.front();q.pop();
		for(i=h[p];i;i=e[i].p)
		{
			int to=e[i].t;
			if(!e[i].l)continue;
			if(dis[to]<dis[p]+e[i].w)
			{
				dis[to]=dis[p]+e[i].w,frm[to]=p,fri[to]=i;
				if(!isin[to])isin[to]=1,q.push(to);
			}
		}isin[p]=0;
	}return dis[T];
}
void cost(register int P=T)
{for(;P^S;P=frm[P])e[fri[P]].l--,e[fri[P]^1].l++;}
ll mcmf(ll x)
{
	ll ret=0,d;
	for(d=spfa();;x--,ret+=d,cost(),d=spfa())
		if(d<-9e17)return x?0:ret;
}
#include<algorithm>
using std::max;
using std::min;
void init()
{for(register int i=1;i<=tn;i++)h[i]=0;tot=1;}
int F[1111111],G[1111111],H[1111111],K[1111111];
int L[1111111],R[1111111],D[1111111],U[1111111];
int x[1111111],y[1111111];
ll a[1111111];
char str[1111111][3];
int p[1111111],k[1111111];
int main()
{
	int n,m;
	scanf("%d",&n);
	register int i,ii,iii;
	for(i=1;i<=n;i++)scanf("%d%d%lld",x+i,y+i,a+i);
	scanf("%d",&m);
	for(i=1;i<=100;i++)
		F[i]=++tn,G[i]=++tn,H[i]=++tn,K[i]=++tn;
	ll ans=0;
	for(i=1;i<=m;i++)scanf("%s %d %d",str+i,p+i,k+i);
	for(ii=1;ii<=n;ii++)
	{
		init();
		for(i=1;i<=ii;i++)L[i]=D[i]=1,R[i]=U[i]=100;
		for(i=1;i<=m;i++)
		{
			if(k[i]>=ii)continue;
			switch(*str[i])
			{
				case'L':L[k[i]+1]=max(L[k[i]+1],p[i]+1);break;
				case'R':R[ii-k[i]]=min(R[ii-k[i]],p[i]-1);break;
				case'D':D[k[i]+1]=max(D[k[i]+1],p[i]+1);break;
				case'U':U[ii-k[i]]=min(U[ii-k[i]],p[i]-1);break;
			}
		}for(i=2;i<=ii;i++)
			L[i]=max(L[i-1],L[i]),D[i]=max(D[i-1],D[i]);
		for(i=ii-1;i;i--)
			R[i]=min(R[i+1],R[i]),U[i]=min(U[i+1],U[i]);
		for(i=1;i<=ii;i++)
			ins(S,H[i],1,0),ins(K[i],T,1,0);
		for(i=1;i<=ii;i++)
		 	for(iii=1;iii<=100;iii++)
		 	{
	 			if(iii>=L[i]&&iii<=R[i])
	 				ins(H[i],F[iii],1e9,0);
	 			if(iii>=D[i]&&iii<=U[i])
	 				ins(G[iii],K[i],1e9,0);
	 		}
		for(i=1;i<=n;i++)ins(F[x[i]],G[y[i]],1,a[i]);
		ans=max(ans,mcmf(ii));
	}printf("%lld\n",ans);
}
/*
Giving the world a better yourself is giving yourself a better world. 
*/

Measured memory_bytes: 39168
n = int(input())
s = []
p = []
for i in range(n):
    si, pi = input().split()
    s.append(si)
    p.append(int(pi))

for i in sorted(list(set(s))):
    c = [[j+1, p[j]] for j in range(n) if s[j] == i]
    c = sorted(c, key = lambda x: x[1], reverse = True)
    for ci in c:
        print(ci[0])

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define vi               vector<int>
#define pb(x)            push_back(x)
#define all(x)           x.begin(), x.end()
#define sortall(x)       sort(all(x))
#define sortrev(x)       sort(all(x), greater<int>())
#define debug(x)         cout << '>' << #x << ':' << x << endl;
#define int              long long
#define ld               long double
#define endl 			 "\n";
#define mp 				 make_pair
#define pii 			 <int, int>
#define lb 				 lower_bound
#define ub				 upper_bound
const int mod = 1000000007;
using namespace std;
// const int N = 1e5 + 5; 
// int n;
// int a[N];







int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t;
t = 1;
// cin >>t;
while(t--){

string n,m;
cin >> n >>m;
int counts = 0;
for(int i=0; i<n.size(); i++){
	if(n[i] != m[i] ){
		counts++;
	}
}

cout << counts <<endl;


}
return 0;
}

Measured memory_bytes: 3748
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;

#define ll long long

int main()
{
    ll N, x;
    scanf("%lld %lld", &N, &x);

    vector<ll> c(N);
    vector<ll> d(N, 0); //last x
    for (ll i = 0; i < N; i++)
    {
        scanf("%lld", &c[i]);
        d[i] += c[i];
        d[i + 1] += c[i];
    }

    ll dis = 0;
    for (ll i = 0; i < N; i++)
    {
        if (d[i] > x)
        {
            ll diff = d[i] - x;
            d[i] -= diff;
            d[i + 1] -= diff;
            c[i] -= diff;
            dis += diff;
        }
    }
    printf("%lld", dis);
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int n,q,xl,xr,res;
int a[1000010],cnt[1000010],ans[1000010];
struct Node{
	int l,r,num;
}f[1000010];
inline int read(){
	int ans=0;
	char c=getchar();
	while(c<'0'||c>'9')
		c=getchar();
	while(c>='0'&&c<='9'){
		ans=ans*10+c-'0';
		c=getchar();
	}
	return ans;
}
int num[10];
inline void write(int x){
	int k=0;
	if(x==0)
		putchar('0');
	while(x){
		num[k++]=x%10;
		x/=10;
	}
	for(int i=k-1;i>=0;i--)
		putchar('0'+num[i]);
	putchar('\n');
}
inline bool cmp(Node a,Node b){
	if(a.l/1500!=b.l/1500)
		return a.l<b.l;
	if(a.l/1500%2)
		return a.r<b.r;
	else
		return a.r>b.r;
}
inline void Add(int x){
	if(cnt[x]==0)
		res++;
	cnt[x]++;
}
inline void Delete(int x){
	if(cnt[x]==1)
		res--;
	cnt[x]--;
}
int main(){
	n=read();
 	q=read();
	for(int i=1;i<=n;i++)
		a[i]=read();
	for(int i=1;i<=q;i++){
		f[i].l=read();
		f[i].r=read();
		f[i].num=i;
	}
	sort(f+1,f+q+1,cmp);
	xl=1,xr=1,res=1;
	cnt[a[1]]=1;
	for(int i=1;i<=q;i++){
		while(xl<f[i].l){
			Delete(a[xl]);
			xl++;
		}
		while(xl>f[i].l){
			xl--;
			Add(a[xl]);
		}
		while(xr<f[i].r){
			xr++;
			Add(a[xr]);
		}
		while(xr>f[i].r){
			Delete(a[xr]);
			xr--;
		}
		ans[f[i].num]=res;
	}
	for(int i=1;i<=q;i++)
		write(ans[i]);
	return 0;
}

Measured memory_bytes: 15472
N,M,X=map(int,input().split())

import itertools
#sankouは1ずれ
sankou=[]
patterns=[]
sankoutotal=[0 for i in range(M)]
mintotal=99999999999999
for n in range(N):
    sankou.append(list(map(int,input().split())))
    for i in range(1,M+1):
        sankoutotal[i-1]+=sankou[-1][i]
#print(sankou)

nums = [0,1]
for balls in itertools.product(nums, repeat=N):
    patterns.append(balls)
    #print(balls)
for i in range(len(patterns)):
    total=0
    syutoku=[0 for i in range(M)]
    for n in range(N):
        for m in range(M):
            syutoku[m]=syutoku[m]+patterns[i][n]*sankou[n][m+1]
        total=total+patterns[i][n]*sankou[n][0]
    #print(total,syutoku)
    can=True
    for m in range(M):
        if syutoku[m] < X:
            can=False
            break
    #print(can,total,mintotal)
    if total < mintotal and can:
        mintotal=total
if mintotal==99999999999999:
    print(-1)
else:
    print(mintotal)

Measured memory_bytes: 9580
use std::vec::Vec;

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()
}

fn main() {
    let (k, x) = {
      let v: Vec<i64> = read_vec();
      (v[0], v[1])
    };

    let m = x - k + 1;
    let M = x + k - 1;

    for i in m..M + 1 {
      print!("{} ", i);
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(n,v) cout<<#v<<":";for(int i=0;i<n;i++)cout<<v[i]<<" ";cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

//しゃくとり？
int main(){
    int n;cin>>n;
    ll a[n];
    rep(i,n){
        cin>>a[i];
    }
    int r=0;ll ans=0;ll sum=a[0],xsum=a[0];
    for(int l=0;l<n;l++){
        while(r<n-1){
            if((sum+a[r+1])==(xsum^a[r+1])){
                sum+=a[r+1];
                xsum^=a[r+1];
                r++;
            }
            else break;
        }
        ans+=r-l+1;
        sum-=a[l];
        xsum^=a[l];
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1792
#if __has_include("noamoa_atcoder_lib.h")
#include "noamoa_atcoder_lib.h"
#else
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define endl '\n'
#define all(x) (x).begin(),(x).end()
namespace atcoder {
	using namespace std;
	using ll = long long;
	using llv = vector<ll>;
	using intv = vector<int>;
	using charv = vector<char>;
	using boolv = vector<bool>;
	using floatv = vector<float>;
	using doublev = vector<double>;
	using stringv = vector<string>;

	constexpr ll MOD7 = 1000000007;
	constexpr ll MOD9 = 1000000009;

	void reverse(string& s){
		reverse(all(s));
	}

	template<typename T>
	void init(vector<T>& v, T initVal = T()){
		for(auto& e : v){
			e = initVal;
		}
	}

	template<typename T>
	void sort(vector<T>& v){
		sort(all(v));
	}
	template<typename T>
	void sortInv(vector<T>& v){
		sort(all(v), greater<T>());
	}

	template<typename T>
	void reverse(vector<T>& v){
		reverse(all(v));
	}

	template<typename T>
	T sum(const vector<T>& v){
		T ret = 0;
		for(const auto& e : v) ret += e;
		return ret;
	}

	template<typename T>
	inline vector<T>& operator+=(vector<T>& v, const T& e){
		v.push_back(e);
		return v;
	}

	template<typename T1, typename T2>
	inline vector<T1>& operator+=(vector<T1>& v1, const vector<T2>& v2){
		for(const auto& e : v2) v1.push_back(e);
		return v1;
	}

	template<typename T>
	void in(vector<T>& v){
		for(auto& e : v) cin >> e;
	}

	template<typename T1, typename T2>
	void in(vector<T1>& v1, vector<T2>& v2){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i];
	}
	template<typename T1, typename T2, typename T3>
	void in(vector<T1>& v1, vector<T2>& v2, vector<T3>& v3){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i] >> v3[i];
	}
	template<typename T1, typename T2, typename T3, typename T4>
	void in(vector<T1>& v1, vector<T2>& v2, vector<T3>& v3, vector<T4>& v4){
		for(int i=0;i<v1.size();i++)
			cin >> v1[i] >> v2[i] >> v3[i] >> v4[i];
	}

	template<typename T>
	istream& operator>>(istream &stream, vector<T>& v){
		for(auto& e : v) stream >> e;
		return stream;
	}

	template<typename T>
	void out(const vector<T>& v){
		for(const auto& e : v) cout << e << ' ';
		cout << endl;
	}

	template<typename T>
	void outln(const vector<T>& v){
		for(const auto& e : v) cout << e << endl;
	}

	template<typename T>
	inline set<T>& operator+=(set<T>& v, const T& e){
		v.insert(e);
		return v;
	}

	template<typename T1, typename T2>
	inline set<T1>& operator+=(set<T1>& v1, const set<T2>& v2){
		for(const auto& e : v2) v1.insert(e);
		return v1;
	}

	constexpr ll modPow(ll x, ll n, ll m){ // O(logn)
		if(n == 0) return 1;
		else if(n % 2 == 0) return modPow((x * x) % m, n / 2, m);
		else return x * modPow(x, n - 1, m) % m;
	}
}
using namespace atcoder;
#endif

bool f(const string& s){
	string tmp = s;
	reverse(tmp);
	return s == tmp;
}

int main(){
	cout << fixed << setprecision(15);
	
	string s;
	cin>>s;
	cout << (
		f(s) && f(s.substr(0, (s.size() - 1) / 2)) && f(s.substr((s.size() + 1) / 2))
		?"Yes":"No");
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    char S[6];
    char Sunny[6]="Cloudy";
    char Rainy[6]="Sunny";
    char Cloudy[6]="Rainy";
    gets(S);
    if (S[0]=='S')
    {
    	puts(Sunny);
	}
    else if (S[0]=='C')
    {
    	puts(Cloudy);
	}
	else if (S[0]=='R')
    {
    	puts(Rainy);
	}
    return 0;
}

Measured memory_bytes: 128
a=int(input())
b=[]
for i in range(a):
 b.append(input())
print('AC x ' + str(b.count('AC')))
print('WA x ' + str(b.count('WA')))
print('TLE x ' + str(b.count('TLE')))
print('RE x ' + str(b.count('RE')))

Measured memory_bytes: 16264
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,x,count=0;
     cin>>a;
     cin>>b;
     cin>>c;
     cin>>x;
     for(int i=0;i<=a;i++)
     {
         for(int j=0;j<=b;j++)
         {
             for(int k=0;k<=c;k++)
             {
                 if((500*i)+(100*j)+(50*k)==x)
                 {
                     count++;
                 }
             }
         }
     }

cout<<count<<"\n";
return 0;
}

Measured memory_bytes: 3628
//	ZapZu's code hohoho
//	#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define dfs_black 1
#define dfs_white -1
#define pr pair
#define vt vector
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef double db;
typedef long long li;
typedef long double ld;

typedef pr<int, int> ii;
typedef pr<ld,ld> dd;

typedef vt<int> vi;
typedef vt<li> vli;
typedef vt<ld> vld;
typedef vt<ii> vii;

typedef map<int, int> mii;
typedef map<int, bool> mib;
typedef map<int, char> mic;

typedef set<int> s_i;
typedef set<char> s_c;

const int MOD = 1e9+7;
const li INF = 1e18;
const ld PI = 4*atan((ld)1);

signed main()
{
	int n;
	cin>>n;
	ii mn={INT_MAX, 0};
	ii mx={INT_MIN, 0};
	for(int i=1; i<=n; i++)
	{
		int t;
		cin>>t;
		mn=min(mn, {t, i});
		mx=max(mx, {t, i});
	}
	cout<<2*(n-1)<<endl;
	if(abs(mn.fi)<abs(mx.fi))
	{
		for(int i=1; i<=n; i++)
		{
			if(i-mx.se) cout<<mx.se<<" "<<i<<endl;
		}
		for(int i=1; i<=n-1; i++)
		{
			cout<<i<<" "<<i+1<<endl;
		}
	}
	else 
	{
		for(int i=1; i<=n; i++)
		{
			if(i-mn.se) cout<<mn.se<<" "<<i<<endl;
		}
		for(int i=n; i>=2; i--)
		{
			cout<<i<<" "<<i-1<<endl;
		}
	}
	
}




Measured memory_bytes: 256