akhauriyash/Code-Regression huggingface dataset:
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

/********************************************************************/
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define yep cout<<"YES"<<'\n'
#define nope cout<<"NO"<<'\n'
#define CASE(te) ll te; cin>>te; while(te--)
#define sor(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())

/********************************************************************/
const double pi = 3.1415926535;
//const int mx = 69;
//char grid[mx][mx];
// ll blocked[mx][mx];
// ll vis[mx][mx];
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

/********************************************************************/

ll power(ll x,ll y,ll p) 
{ 
    ll res = 1; 
    x = x % p; 
    while (y > 0) 
    {  
        if (y & 1) 
         res = (res * x) % p; 
        y = y >> 1; 
        x = (x * x) % p; 
    } 
    return res%p; 
} 

bool isprime(ll n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
    return true; 
} 
  

vector<ll> digit(ll n)
{
    ll arr[10000];
    ll i=0;
    ll j,r;
    vi v;
    while(n!=0)
    {
        r = n % 10;
        arr[i] = r;
        i++;
        n = n / 10;
    }
    for(j=i-1;j>-1;j--)
    {
        v.pb(arr[j]);
    }
    return v;
}

ll sum(ll x) {
	ll ans = 0;
	while (x > 0) {
		ans += (x % 10);
		x /= 10;
	}
	return ans;
}

bool opp(int x, int y)
{
    return ((x ^ y) < 0);
}

bool bysec(const pair<int,int> &a, const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}


// long long nCrM(ll n,ll r,ll p) 
// { 
 
//     if (r == 0) 
//     return 1; 
//     ll fac[n + 1]; 
//     fac[0] = 1; 
//     for (int i = 1; i <= n; i++) 
//     fac[i] = (fac[i - 1] * i) % p; 
//     return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
// }

int main()
{
  FAST();
  ll n;
  cin>>n;
  ll ans=0;
  ans+=(power(10,n,M1));
  ans+=(power(8,n,M1));
  ans-=(2*(power(9,n,M1)))%M1;
  cs((ans+M1)%M1);
}


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

using namespace std;

int mm[1005][1005][3];
string flag[1005],emb[2];
int main(){
    int m,n;
    cin>>m>>n;
    int ans=0;
    for(int i=0;i<m;++i) cin>>flag[i];
    for(int i=0;i<2;++i) cin>>emb[i];
    for(int i=0;i<m;++i){
        for(int j=0;j<n;++j){
            int cnt=0,mx,my;
            for(int k=0;k<2;++k){
                for(int l=0;l<2;++l){
                    if(flag[i+k][j+l]==emb[k][l]) ++cnt;
                    else{mx=l;my=k;}
                }
            }
            if(cnt==4) ++ans;
            else if(cnt==3){
                if(emb[my][mx]=='J') ++mm[i+my][j+mx][0];
                else if(emb[my][mx]=='O') ++mm[i+my][j+mx][1];
                else ++mm[i+my][j+mx][2];
            }
        }
    }
    int w=0;
    for(int i=0;i<m;++i){
        for(int j=0;j<n;++j){
            for(int k=0;k<3;++k) w=max(w,mm[i][j][k]);
        }
    }
    cout<<ans+w<<endl;
    return 0;
}

Measured memory_bytes: 15844
#include <iostream>
#include <algorithm>
#include <cstring>
#define INF 500050
using namespace std;
int a[INF];
int main()
{
//	freopen("test.in","r",stdin);
	string s;
//	cin >> n;
	cin >> s;
//	for(int i=1; i<n; i++) {
//		cin >> a[i];
//	}
	if(s=="Sunny") {
		cout<<"Cloudy";
	}else if(s=="Rainy") {
		cout<<"Sunny";
	}else{
		cout<<"Rainy";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
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; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

using Graph = vector<vector<int>>;

typedef pair<int, int> P;
typedef priority_queue<int, vector<int>, greater<int>> PQ;
const int MOD = 1000000007;


int main(){
    int N; cin >> N;
    vector<ll> A(N+1), B(N);
    rep(i,N+1) cin >> A[i];
    rep(i,N) cin >> B[i];

    ll ans = 0;
    rep(i,N){
        ans += min(A[i], B[i]);
        ll diff = A[i] - B[i];
        if (diff < 0){
            ans += min(abs(diff), A[i+1]);
            A[i+1] = max(0LL, A[i+1]-abs(diff));
        }
    }
    cout << ans << endl;

}



Measured memory_bytes: 4768
// Package main provides
//
// File:  b.go
// Author: ymiyamoto
//
// Created on Tue Jan  1 01:14:02 2019
//
package main

import "fmt"

func main() {
	var A, B, C, X int
	fmt.Scan(&A, &B, &C, &X)

	ans := 0
	for a := 0; a <= A; a++ {
		for b := 0; b <= B; b++ {
			for c := 0; c <= C; c++ {
				if 500*a+100*b+50*c == X {
					ans++
				}
			}
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 512
using System.Collections.Generic;
using System;

public class Hello
{
	public static void Main()
	{
		var n = int.Parse(Console.ReadLine().Trim());
		var d = new Dictionary<string, long>();
		for (int i = 0; i < n; i++)
		{
			var s = Console.ReadLine().Trim();
			var sa = s.ToCharArray();
			Array.Sort(sa);
			var sb = new string(sa);
			if (d.ContainsKey(sb)) d[sb]++;
			else d[sb] = 1;
		}
		getAns(d);
	}
	static void getAns(Dictionary<string, long> d)
	{
		var ans = 0L;
		foreach (var x in d)
			ans += (x.Value) * (x.Value - 1) / 2L;
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 31320
#s[i] =~ /^[A-Z]/
#この A-Zの表現について考える。

s = gets.chomp.split("")
fff = 1
if s[0] != "A" && fff == 1
    puts "WA"
    fff -= 1
end
mojisize = s.size
count = 0
(2..(mojisize-2)).each do |i|
    if s[i] == "C"
        count += 1
    end
end
if count != 1 && fff == 1 
    puts "WA"
    fff -= 1
end
s.delete("A")
s.delete("C")
#p s
saigo = s.size
# p saigo
# p saigo
all = 0
# p s
# p saigo
(0..(saigo-1)).each do |i|
    if s[i] =~ /^[A-Z]/
        break
    else
        all += 1
    end
end
#p all

#p all
 if all == saigo && fff == 1
     puts "AC"
     fff -= 1
 elsif fff == 1
    puts "WA"
end

Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<bitset>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res*x%p;
		x = x*x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
short ctos(char a) {
	return (int)(a - '0');
}
#define int long long
const long long Inf = 4523372036854775807;
const int inf = 15000000000;
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
int n, x;
bool a[1000];
signed main() {
	cin >> n >> x;
	int k = inf;
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		k = min(k, t);
		x -= t;
	}
	cout << n + floor(x*1.0 / k) << endl;
}

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

const int END = -1;
struct StNod
{
  int m_nDept;
  int m_nParnt;
  int m_nLChd;
  int m_nRSib;

  StNod() :
    m_nDept(END), m_nParnt(END), m_nLChd(END), m_nRSib(END)
  { }
};

void fnInput(vector<StNod> &rvoNod)
{
  StNod oNod;
  int nMaxSiz;

  cin >> nMaxSiz;
  rvoNod.resize(nMaxSiz, oNod);

  for (int i = 0; i < nMaxSiz; i++)
  {
    int nParnt, nCCnt, nChd, nBChd = END;
    cin >> nParnt >> nCCnt;
    for (int j = 0; j < nCCnt; j++)
    {
      cin >> nChd;
      rvoNod[nChd].m_nParnt = nParnt;
      if (nBChd != END) rvoNod[nBChd].m_nRSib = nChd;
      if (!j)          rvoNod[nParnt].m_nLChd = nChd;
      nBChd = nChd;
    }
  }
}

void fnSetDepth(vector<StNod> &rvoNod, int nx, int nDept)
{
  rvoNod[nx].m_nDept = nDept;
  
  if (rvoNod[nx].m_nRSib != END)
    fnSetDepth(rvoNod, rvoNod[nx].m_nRSib, nDept);

  if (rvoNod[nx].m_nLChd != END)
    fnSetDepth(rvoNod, rvoNod[nx].m_nLChd, nDept + 1);
}

void fnRtdTree(vector<StNod> &rvoNod)
{
  int nx = 0, nDept = 0;
  while (rvoNod[nx].m_nParnt != END)
    nx = rvoNod[nx].m_nParnt;

  fnSetDepth(rvoNod, nx, nDept);
}

void fnResult(const vector<StNod> &cnrvoNod)
{
  for (int i = 0; i < cnrvoNod.size(); i++)
  {
    if (cnrvoNod[i].m_nDept == END)  break;
    cout << "node " << i << ": parent = " << cnrvoNod[i].m_nParnt << ", depth = " << cnrvoNod[i].m_nDept;

    if (!cnrvoNod[i].m_nDept)            cout << ", root, ";
    else if (cnrvoNod[i].m_nLChd == END) cout << ", leaf, ";
    else                                 cout << ", internal node, ";

    cout << "[";
    if (cnrvoNod[i].m_nLChd != END)
    {
      int nx = cnrvoNod[i].m_nLChd;
      cout << nx;
      while (cnrvoNod[nx].m_nRSib != END)
      {
        cout << ", " << cnrvoNod[nx].m_nRSib;
        nx = cnrvoNod[nx].m_nRSib;
      }
    }
    cout << "]" << endl;
  }
}

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

  vector<StNod> voNod;

  fnInput(voNod);
  fnRtdTree(voNod);
  fnResult(voNod);
  return 0;
}

Measured memory_bytes: 5748
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h, w;
  cin >> h >> w;
  vector<string> m(h);
  for(int i = 0; i < h; ++i) cin >> m[i];
  vector<vector<int>> up(h, vector<int>(w));
  vector<vector<int>> down(h, vector<int>(w));
  vector<vector<int>> left(h, vector<int>(w));
  vector<vector<int>> right(h, vector<int>(w));
  int crr = 0;
  for(int i = 0; i < h; ++i){
    crr = 0;
    for(int j = 0; j < w; ++j){
      if(m[i][j] == '#') crr = 0;
      else crr++;
      left[i][j] = crr;
    }
  }
  for(int i = 0; i < h; ++i){
    crr = 0;
    for(int j = w - 1; j >= 0; --j){
      if(m[i][j] == '#') crr = 0;
      else crr++;
      right[i][j] = crr;
    }
  }
  for(int i = 0; i < w; ++i){
    crr = 0;
    for(int j = 0; j < h; ++j){
      if(m[j][i] == '#') crr = 0;
      else crr++;
      up[j][i] = crr;
    }
  }
  for(int i = 0; i < w; ++i){
    crr = 0;
    for(int j = h - 1; j >= 0; --j){
      if(m[j][i] == '#') crr = 0;
      else crr++;
      down[j][i] = crr;
    }
  }
  int ans = 0;
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      ans = max(ans, left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 67200
#![allow(non_snake_case)]
#![allow(unused_imports)]
use proconio::input;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::VecDeque;

fn main() {
    input! {
        N: usize,
        Ls: [i64; N],
    }

    let sum: i64 = Ls.iter().sum();
    let mut ans = true;

    for &l in Ls.iter() {
        if l >= (sum - l) {
            ans = false;
        }
    }

    if ans {
        println!("Yes");
    } else {
        println!("No");
    }
}


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

const int N = 55;
typedef pair<int,int> pii;

int n, a[N];

int main()
{
	scanf("%d",&n);
	int I = 1;
	for(int i=1;i<=n;i++) {
		scanf("%d",&a[i]);
		if(abs(a[I]) < abs(a[i])) I = i;
	}
	printf("%d\n",2*n-1);
	for(int i=1;i<=n;i++) {
		printf("%d %d\n", I, i);
	}
	if(a[I] > 0) {
		for(int i=1;i<n;i++) {
			printf("%d %d\n",i, i+1);
		}
	}
	else {
		for(int i=n;i>1;i--) {
			printf("%d %d\n", i, i-1);
		}
	}
}


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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T &t, const U &u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u) {
    if (t < u) t = u;
}

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

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

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

bool dp[11000];

int main() {
    int N;
    cin >> N;
    dp[0] = 1;
    rep(i, N) {
        int x;
        cin >> x;
        for (int j = 10000; j >= 0; --j)
            if (dp[j]) {
                dp[j + x] = 1;
            }
    }
    int ans = 0;
    rep(i, 11000) {
        if (i % 10 && dp[i]) {
            chmax(ans, i);
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
S = input()
K = int(input())

S = list(S)
i = 0
while(K>0):
  if i == len(S)-1:
    S[i] = chr(((ord(S[i])-97)+K)%26+97)
    K = 0
  else:
    a = 26-(ord(S[i])-97)
    if a != 26 and K >= a:
      S[i] = 'a'
      K -= a
  i += 1
print(''.join(S))


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

const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

int64_t power_mod(int64_t num, int64_t power){
    int64_t prod = 1;
    num %= MOD;
    while(power > 0){
        if(power&1) prod = prod * num % MOD;
        num = num * num % MOD;
        power >>= 1;
    }
    return prod;
}

int64_t extgcd(int64_t a, int64_t b, int64_t& x, int64_t& y){
    int64_t d = a;
    if(b != 0){
        d = extgcd(b, a%b, y, x);
        y -= (a/b) * x;
    }else{
        x = 1; y = 0;
    }
    return d;
}

int64_t inv_mod(int64_t a){
    int64_t x, y;
    extgcd(a, MOD, x, y);
    return (MOD + x%MOD) % MOD;
}

vector<int64_t> fact, fact_inv;

void create_mod_tables(int num){
    fact.resize(num+1, 1);
    fact_inv.resize(num+1, 1);
    for(int i=1; i<=num; i++) fact[i] = fact[i-1] * i % MOD;
    fact_inv[num] = inv_mod(fact[num]);
    for(int i=num; i>0; i--) fact_inv[i-1] = fact_inv[i] * i % MOD;
}

int64_t comb_mod(int n, int k){
    return fact[n] * fact_inv[n-k] % MOD * fact_inv[k] % MOD;
}

int64_t perm_mod(int n, int k){
    return fact[n] * fact_inv[n-k] % MOD;
}

int main(){
    int N, K;
    cin >> N >> K;
    int64_t ans = 0;
    for(int64_t k=K; k<=N+1; k++){
        int64_t mn = k*(k-1)/2;
        int64_t mx = k*(2*N-k+1)/2;
        add(ans, mx-mn+1);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
using namespace std;
void solve()
{
	//Enter your code here Tanmay:)
	int n,m;
	cin>>n>>m;
	if(n<=m)
		for(int i=0;i<m;i++)
			cout<<n;
	else
		for(int i=0;i<n;i++)
			cout<<m;
	}
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
S=list(str(input()))

l=len(S)
if l%2 != 0:
    print("No")
    exit()


for i in range(l):
    if i%2 == 0 and S[i]!="h":
        print("No")
        exit()
    if i%2 != 0 and S[i]!="i":
        print("No")
        exit()
print("Yes")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int n,k;
    cin>>n>>k;
    int a;
    rep(i,n) cin>>a;
    if((n-1)%(k-1)==0) cout<<(n-1)/(k-1);
    else cout<<(n-1)/(k-1)+1;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    int N; string S; cin >> N >> S;
    int cnt = 0;
    for (char c : S) if (c == 'R') cnt++;
    if (cnt > N - cnt) printf("%s\n", "Yes");
    else printf("%s\n", "No");
}


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

#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;

const int INF = 1e9 + 7;

using namespace std;

ll gcd(ll n, ll r) {
	ll mod = n % r;
	if (mod == 0)
		return r;
	else
		return gcd(r, mod);
}

ll lcm(ll n, ll r) {
	ll gcd_v = gcd(n, r);

	return n / gcd_v * r;
}

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

	int n;
	cin >> n;

	vector<ll> a(n);
	rep (i, 0, n)
		cin >> a[i];

	ll res = 0;
	/*
	ll lcm_v = a[0];
	rep (i, 1, n) {
		lcm_v = lcm(lcm_v, a[i]);
	}

	rep (i, 0, n) {
		res += (lcm_v - 1) % a[i];
	}
	*/

	rep (i, 0, n) {
		res += (a[i] - 1);
	}
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define debug(x) cout << #x << " = " << x << endl
#define print(x) cout << x << endl;

int main()
{
    int N, K;
    cin >> N >> K;
    vector<double> p(N);

    rep(i, N)
    {
        int p_i;
        cin >> p_i;

        // store the sum
        for (int j = 1; j <= p_i; j++)
        {
            p[i] += j;
        }

        p[i] /= p_i;
    }

    double current_sum = 0;
    for (int i = 0; i < K; i++)
    {
        current_sum += p[i];
    }

    double ans = current_sum;
    for (int i = 0; i < N - K; i++)
    {
        current_sum = current_sum - p[i] + p[K + i];
        if (current_sum > ans)
        {
            ans = current_sum;
        }
    }

    cout << fixed << setprecision(10);
    cout << ans << endl;
}

Measured memory_bytes: 1792
n=int(input())
lists=[]
for i  in range(n):
    x,y=map(int,input().split())
    lists.append((x-y,x+y))
lists=sorted(lists,key=lambda x:(x[1]))
A=1
P=lists[0]
for i in range(1,len(lists)):
    if lists[i][0]>=P[1]:
        A+=1
        P=lists[i]
print(A)


Measured memory_bytes: 19028
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define REPA(x, v) for(auto&& x:v)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(v.rbegin(),v.rend())
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> void pr_vec(vector<T> &v, char ep=' '){int n=v.size();REP(ni,n){cout<<v[ni];if(ni!=n-1)cout<<ep;}cout<<endl;};
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int a;
    cin >> a;
    pr(!a);
}

Measured memory_bytes: 3616
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
inline void Rd(int &res){
	char c;res=0;
	while(c=getchar(),c<'0');
	do{
		res=(res<<1)+(res<<3)+(c^48);
	}while(c=getchar(),c>='0');
}
const int M=200005;
int n,m,ans;
int A[M],Cnt[M],mark[M];
int judge(int x){
	return 1<=x&&x<=n;
}
int main(){
	Rd(n),Rd(m);
	for(int i=1;i<=n;i++){
		Rd(A[i]);
		Cnt[A[i]]++;
	}
	for(int i=1;i<=n;i++)
		for(int j=0;j<Cnt[i];j++)
			if(judge(i-j))mark[i-j]++;
	for(int i=1;i<=n;i++)
		if(!mark[i])ans++;
	while(m--){
		int x,y;
		Rd(x),Rd(y);
		if(judge(A[x]-(Cnt[A[x]]-1))){
			mark[A[x]-(Cnt[A[x]]-1)]--;
			if(!mark[A[x]-(Cnt[A[x]]-1)])ans++;
		}
		Cnt[A[x]]--;
		A[x]=y;
		Cnt[A[x]]++;
		if(judge(A[x]-(Cnt[A[x]]-1))){
			if(!mark[A[x]-(Cnt[A[x]]-1)])ans--;
			mark[A[x]-(Cnt[A[x]]-1)]++;
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int N;
  cin >>N;
  vector<int> vec(N);
  vector<int> vecto(N);
  rep(i,N) {
cin >>vec.at(i)>>vecto.at(i);
  }
  vector<int>tot(N);
  rep(i,N) {
    tot.at(i)=vecto.at(i)-vec.at(i)+1;
  }
  int sum=0;
  rep(i,N) {
sum +=tot.at(i);
  }
  cout<<sum<< endl;
}
  


Measured memory_bytes: 256
#include <iostream>

int sumofdigits(int i)
{
  int quat, wa = 0, res;
  quat = i;
  while (quat > 0)
  {
    res = quat % 10;
    wa += res;
    quat = quat / 10;
  }
  return wa;
}

int main()
{
  int n, a, b, sum = 0;
  int i, wa;

  std::cin >> n >> a >> b;
  for (i = 1; i <= n; i++)
  {
    wa = sumofdigits(i);
    if (wa >= a && wa <= b)
    {
      sum += i;
    }
  }
  std::cout << sum << std::endl;
  return 0;
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = 1<<29;

int main() {
  ll N, A, B; cin >> N >> A >> B;
  if (N == 1) {
    cout << (A == B ? 1 : 0) << endl;
  }
  else if (A <= B) {
    cout << (N - 2) * (B - A) + 1 << endl;
  } else {
    cout << 0 << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    using namespace std;
    int main()
    {
      int n;cin>>n;
      vector<int> arr(n);for(int i=0;i<n;i++)cin>>arr[i];
      vector<int> left(n+1);
      vector<int> right(n+1);
      left[0]=0;
      right[n]=0;
      int ans=0;
      for(int i=1;i<=n;i++)left[i]=__gcd(left[i-1],arr[i-1]);
      for(int i=n-1;i>=0;i--)right[i]=__gcd(right[i+1],arr[i]);
      for(int i=0;i<n;i++)ans = max(ans,__gcd(left[i],right[i+1]));
      cout<<ans<<endl;
    }

Measured memory_bytes: 1408
local n, m = io.read("*n", "*n")
local d = {}
local d_short_idx = {}
local edge = {}
local color = {}
local inf = 1000000007 - 7
for i = 1, n do
  d[i] = io.read("*n")
  edge[i] = {}
  color[i] = 0
  d_short_idx[i] = i
end
table.sort(d_short_idx, function(a, b) return d[a] < d[b] end)
local edgeinfo = {}
for i = 1, m do
  local a, b = io.read("*n", "*n")
  edgeinfo[i] = {a, b, 0}
  table.insert(edge[a], i)
  table.insert(edge[b], i)
end

for id = 1, n do
  local src = d_short_idx[id]
  local asked_edge_color = false
  local samelevel_edge_found = false
  for i = 1, #edge[src] do
    local edge_idx = edge[src][i]
    local e1, e2 = edgeinfo[edge_idx][1], edgeinfo[edge_idx][2]
    local dst = src == e1 and e2 or e1
    if 0 < color[dst] then
      if not asked_edge_color or asked_edge_color < 100 then
        asked_edge_color = color[dst]
      end
    end
    if d[dst] == d[src] then
      samelevel_edge_found = true
    end
  end
  if asked_edge_color then
    if asked_edge_color == 100 then
      color[src] = 2
    else
      color[src] = 3 - asked_edge_color
    end
    for i = 1, #edge[src] do
      local edge_idx = edge[src][i]
      local e1, e2 = edgeinfo[edge_idx][1], edgeinfo[edge_idx][2]
      local dst = src == e1 and e2 or e1
      if color[dst] == color[src] then
        edgeinfo[edge_idx][3] = inf
      else
        edgeinfo[edge_idx][3] = d[src]
      end
    end
  elseif samelevel_edge_found then
    color[src] = 100
  else
    print(-1) os.exit()
  end
end
for i = 1, n do
  if color[i] == 100 then color[i] = 1 end
  assert(0 < color[i] and color[i] <= 2)
  io.write(color[i] == 1 and "W" or "B")
end
io.write("\n")
for i = 1, m do
  print(edgeinfo[i][3])
end


Measured memory_bytes: 32972
#include <iostream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int N ;
int F[100005],h[100005];
int main()
{   
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> N ;
    F[1] = F[0] = h[0] = 0 ;
    for(int i = 1 ; i<= N ; i++)
        cin >> h[i];
    F[2] = F[1] + abs(h[2]-h[1]);
    for(int i = 3 ; i<= N; i++)
        F[i] = min(F[i-1]+abs(h[i]-h[i-1]),F[i-2]+abs(h[i]-h[i-2]));
    cout << F[N] ;
    return 0;
}


Measured memory_bytes: 1024
use std::io::*;
use std::str::*;
use std::collections::HashMap;

fn f(){
}
fn main(){
    let n = read::<usize>();
    let mut m = HashMap::new();
    for i in 0..n{
        let a = read::<usize>();
        let counter = m.entry(a).or_insert(0);
        *counter +=1;
    }
    let mut cnt:usize = 0;
    for (a,b)in &m{
        if b %2 == 1{
            cnt += 1;
        }
    }
    println!("{}",cnt);
}

#[allow(dead_code)]
fn read_str() -> Vec<char>{
    let s :String = read();
    s.chars().collect::<Vec<char>>()
}
#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().unwrap_or_else(|_| panic!("Faild to parse {}", s))
}


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

const int64_t mod = 1000000007;

int64_t power(int64_t n, int64_t k) {
  if (k == 0) return 1;
  int64_t half = power(n, k / 2), ans = half * half % mod;
  if (k % 2) ans = ans * n % mod;
  return ans;
}

int main() {
  int n;
  cin >> n;
  vector<int64_t> c(n);
  for (int i = 0; i < n; i++) cin >> c.at(i);
  sort(c.begin(), c.end());
  int64_t ans = 0;
  for (int i = 0; i < n; i++) {
    ans += c.at(i) * ((power(2, n - 1) + (n - 1 - i) * power(2, n - 2) % mod) % mod) % mod;
    ans %= mod;
  }
  ans *= power(2, n);
  ans %= mod;
  cout << ans << endl;
}


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

int main(){
    while(1){
    int m,f,r;
    cin >> m >>f>>r;
    if (m==-1 && f==-1 && r ==-1) break;
    string ans;
    if(m==-1 ||f==-1 )ans="F";
    else if (m+f >= 80) ans ="A";
    else if (m+f >=65) ans ="B";
    else if (m+f >=50) ans ="C";
    else if (m+f >= 30){
          if(r>=50) ans ="C";
          else ans = "D";
    }
     else ans ="F";
    cout << ans << endl;
     }
     return 0;
}


Measured memory_bytes: 3132
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_C&lang=jp
# Priority Queue
# 2018.12.09 yonezawa

#from collections import deque
import sys
input = sys.stdin.readline
import heapq
#import cProfile

def main():
    tl = []
    while True:
        l  = list(map(str,input().split()))
        if l[0] == "end":
            break
        if l[0] == "insert":
            heapq.heappush(tl,int(l[1]) * -1)
        if l[0] == "extract":
            a = heapq.heappop(tl) * -1 
            print (a)

if __name__ == '__main__':
    main()
   #pr = cProfile.Profile()
   #pr.runcall(main)
   #pr.print_stats()


Measured memory_bytes: 45588
import itertools

n = int(input())
alpha = "abcdefghij"
ans_s = {}
if n == 1:
    print("a")
    exit()

def ans_string(max_num, num, ans):
    if num == 0:
        ans_s[ans] = 1
    else:
        for i in range(max_num + 2):
            ans_string(max(i, max_num), num - 1, ans + alpha[i])
        
ans_string(0, n - 1, "a")
for key, value in ans_s.items():
    print(key)

Measured memory_bytes: 21828
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#else
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 119 << 23 | 1;
class {
 public:
  vector<pi> V[maxn];
  int n, ans, pt[maxn];
  void solve() {
    cin >> n;
    for (int i = 1; i < n; ++i) {
      int u, v;
      cin >> u >> v;
      V[u].emplace_back(v, i);
      V[v].emplace_back(u, i);
    }
    dfs(1, 1, 0);
    cout << ans << '\n';
    for (int i = 1; i < n; ++i) {
      cout << pt[i] << "\n";
    }
  }
  void dfs(int u, int f, int fp) {
    int a = 1;
    for (auto v : V[u]) {
      if (v.first == f)
        continue;
      if (a == fp)
        a++;
      pt[v.second] = a;
      ans = max(ans, a);
      dfs(v.first, u, a++);
    }
  }
} NSPACE;
int main() {
  FPEN;
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  NSPACE.solve();
}

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

int main() {
   int n,m,xs,ys;
   std::cin >> n >> m >> xs >> ys;
   std::vector<int> x(n);
   int xmax;
   std::vector<int> y(m);
   int ymin;
   for (size_t i = 0; i < n; i++) {
      std::cin >> x.at(i);
      if (i == 0) {
         xmax = x.at(i);
      } else {
         if (xmax < x.at(i)) {
            xmax = x.at(i);
         }
      }
   }
   for (size_t i = 0; i < m; i++) {
      std::cin >> y.at(i);
      if (i == 0) {
         ymin = y.at(i);
      } else {
         if (ymin > y.at(i)) {
            ymin = y.at(i);
         }
      }
   }
   for (int i = xs+1; i <= ys; i++) {
      if (xmax < i && i <= ymin) {
         std::cout << "No War" << '\n';
         return 0;
      }
   }
   std::cout << "War" << '\n';

}


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

using namespace std;

int main(){
    string S, T;
    cin >> S >> T;

    int ans = 0;
    for(int i = 0; i < 3; ++i){
        if(S[i] == T[i]){
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() (int, []int) {
	n := readInt()
	return n, readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

func eprintf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(os.Stderr, f, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int

// -----------------------------------------------------------------------------

func main() {
	defer stdout.Flush()
	s := []byte(readString())
	ans := math.MaxInt32
	for c := byte('a'); c <= 'z'; c++ {
		ans = min(ans, solve(s[:], c))
	}
	println(ans)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func solve_(t []byte, c byte) int {
	res := 0
	tmp := 0
	for _, d := range t {
		if d == c {
			res = max(res, tmp)
			tmp = 0
		} else {
			tmp++
		}
	}
	res = max(res, tmp)
	return res
}

func solve(t []byte, c byte) int {
	n := len(t)
	s := make([]byte, n)
	copy(s, t)
	var count int
	j := n
	for j > 0 {
		//eprintln(string(c), count, string(s[:j]))
		finished := true
		for i := 0; i < j; i++ {
			if s[i] != c {
				finished = false
			}
		}
		if finished {
			break
		}

		count++
		j--
		for i := 0; i < j; i++ {
			if s[i+1] == c {
				s[i] = c
			}
		}
	}
	//eprintln(string(c), count)
	return count
}

// -----------------------------------------------------------------------------


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstring>
#include<utility>
#include<cmath>
#include<assert.h>
#include<set>

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

int N;
int A[100100];

signed main() {
    cin >> N;
    rep(i, N) {
        int a;
        cin >> a;
        if (a % 2 == 1) {
            cout << "first" << endl;
            return 0;
        }
    }
    cout << "second" << endl;
    return 0;
}


Measured memory_bytes: 256
/*  -*- coding: utf-8 -*-
 *
 * b.cc: B: Chocolate
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, d, x;
  scanf("%d%d%d", &n, &d, &x);

  int sum = x;
  for (int i = 0; i < n; i++) {
    int ai;
    scanf("%d", &ai);
    sum += (d + ai - 1) / ai;
  }
  printf("%d\n", sum);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll N,W;
  cin>>N>>W;
  ll v[N],w[N];
  for(ll i=0;i<N;i++)
    cin>>w[i]>>v[i];
  ll dp[N+1][W+1];
  for(ll i=0;i<=N;i++){
    for(ll j=0;j<=W;j++){
      if(i==0||j==0)
        dp[i][j]=0;
      else{
      dp[i][j]=dp[i-1][j];
      if(w[i-1]<=j)
        dp[i][j]=max(dp[i][j],v[i-1]+dp[i-1][j-w[i-1]]);
      }
    }
  }
  ll ans=dp[N][W];
  cout<<ans;
     
  return 0;
}


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

int main() {
	long n,m,i,j,k,ans,cur,res;
	string s;
	cin >> s;
	for(i=0; i<3; i++){
		if(s[i]=='7'){
			cout << "Yes" << endl; return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 3600
import numpy as np

W, H, N = map(int, input().split())
area = np.ones((H, W))


def calc_paint(x, y, a):
 #   x -= 1
 #   y -= 1
    if a == 1:
        area[:, :x] = 0
    elif a == 2:
        area[:, x:] = 0
    elif a == 3:
        area[:y, :] = 0
    elif a == 4:
        area[y:, :] = 0


for i in range(N):
    x, y, a = map(int, input().split())
    calc_paint(x, y, a)

print(int(np.sum(area)))

Measured memory_bytes: 12524
import java.io.*;
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.math.*;
public class Main 
{ 
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader()
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next()
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine();
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
    static long[] ans=new long[100001];
     public static void main (String[] args) throws java.lang.Exception {
        FastReader sc=new FastReader();
        PrintWriter pw=new PrintWriter(System.out);
    	int t=1;//sc.nextInt();
        while (t-- > 0){
            String s=sc.next(),st=sc.next();
            int ans=0;
            for(int i=0;i<s.length();i++)
            {
                if(s.charAt(i)!=st.charAt(i))
                ans++;
            }
             pw.println(ans);
        }
        pw.close();
}
}

  

Measured memory_bytes: 37636
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%I64d",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)
#define INF                         (int)1e9
#define EPS                         1e-9
#define bitcount                    __builtin_popcount
#define gcd                         __gcd
#define forall(i,a,b)               for(int i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((int)(a.size()))
#define mp                          make_pair
#define MOD                         1000000007
typedef long long ll;
/*For you see , each day i love you
 more.Today more than yesterday
  less than tomorrow.*/
using namespace std;

int main()
{
	int n;s(n);
	vector<int> vec;
	
	for(int i = 0;i<n;i++)
	{
		ll x;cin>>x;
		vec.push_back(x);
	}
	
	ll have = 1000;
	
	for(int i = 1;i<n;i++)
	{
		if(vec[i] > vec[i-1])
		{
			ll val = (have / vec[i-1]);
			have%=vec[i-1];
			have+=vec[i]*val;	
		}	
	}
	
	cout<<have<<endl;
	
	return 0;
}

Measured memory_bytes: 3688
#include<bits/stdc++.h>
using namespace std;
int a[3],ans;
int main()
{
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	ans=a[2]*10+a[1]+a[0];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define gcd __gcd
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
#define pr(n) printf("%d ",n)
#define out(n) printf("%d\n",n)
#define llin(a) cin >> a
#define llpr(a) cout << a << " "
#define llout(a) cout << a << endl
#define yes printf("YES\n")
#define no printf("NO\n")
#define lin printf("\n")
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define ck printf("continue\n")
#define all(vec) vec.begin(),vec.end()
#define asc(vec) sort(vec.begin(),vec.end())
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
#define lp(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define M 1000000007
#define N 200005  //check the limits, man
// read the constraint properly (ll vs int)
typedef long long int ll;
ll fact[N],inv[N],finv[N];
ll pro(ll a,ll b)
{
    return (a*b)%M;
}
void buildfact()
{
    int i,q,r;
    fill(fact,fact+N,1);
    fill(inv,inv+N,1);
    fill(finv,finv+N,1);
    for(i=2;i<N;i++)
    {
        fact[i]=pro(fact[i-1],i);
        q=M/i,r=M%i;
        inv[i]=M-pro(q,inv[r]);
        finv[i]=pro(finv[i-1],inv[i]);
    }
    return ;
}
ll choose(int n,int r)
{
    return pro(fact[n],pro(finv[r],finv[n-r]));
}
ll path(int x,int y,int a,int b)
{
    return choose(a-x+b-y,a-x);
}
ll dp[N];
int main()
{
    buildfact();
    int n,m,k,i,j,x,y,a,b;
    in3(n,m,k);
    vii vp(k);
    rep(i,k)
        in2(vp[i].F,vp[i].S);
    sort(all(vp));
    rep(i,k)
    {
        a=vp[i].F,b=vp[i].S;
        dp[i]=path(1,1,a,b);
        rep(j,i)
        {
            x=vp[j].F,y=vp[j].S;
            if(x<=a && y<=b)
                dp[i]-=pro(dp[j],path(x,y,a,b));
        }
        dp[i]%=M;
        if(dp[i]<0)
            dp[i]+=M;
    }
    ll ans=0;
    rep(i,k)
    {
        a=vp[i].F,b=vp[i].S;
        ans+=pro(dp[i],path(a,b,n,m));
    }
    ans%=M;
    ans=path(1,1,n,m)-ans+M;
    llout(ans%M);
}


Measured memory_bytes: 4992
n=int(input())
a=list(map(int,input().split()))
ans_o=0
cnt_o=0
ans_e=0
cnt_e=0
for i in range(n):
  cnt_o+=a[i]
  if i%2==0:
    if cnt_o>0:
      continue
    else:
      ans_o+=abs(cnt_o)+1
      cnt_o=1
  else:
    if cnt_o<0:
      continue
    else:
      ans_o+=cnt_o+1
      cnt_o=-1
for i in range(n):
  cnt_e+=a[i]
  if i%2==0:
    if cnt_e<0:
      continue
    else:
      ans_e+=cnt_e+1
      cnt_e=-1
  else:
    if cnt_e>0:
      continue
    else:
      ans_e+=abs(cnt_e)+1
      cnt_e=1
print(min(ans_o,ans_e))

Measured memory_bytes: 20036
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
const int MAX = 2000000;
const ll MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//a^n%mod
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}
int main(){
  COMinit();
  ll ans=1;
  int k;
  cin >> k;
  string s;
  cin >> s;
  int n=s.size();
  ll a[1000001];
  ll b[1000001];
  a[0]=1;
  b[0]=1;
  rep(i,1000000){
    a[i+1]=a[i]*25%MOD;
    b[i+1]=b[i]*26%MOD;
  }
  ll o=0;
  rep(i,k+1){
    o=(o+(b[i]*a[k-i])%MOD*COM(k-i+n-1,n-1))%MOD;
    //cout << o << endl;
  }
  cout << o << endl;
}


Measured memory_bytes: 66952
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;


void solve()
{
    int n;
    scanf("%d", &n);
    vector<vector<int> > g(n);
    int i;
    for (i = 1; i < n; i++) {
        int tmp;
        scanf("%d", &tmp); tmp--;
        g[tmp].push_back(i);
    }
    for (i = 0; i < n; i++) {
        printf("%d\n", (int)g[i].size());
    }

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}



Measured memory_bytes: 13536