akhauriyash/Code-Regression huggingface dataset:
/*
  Warn - Don't change next line else you will get WA verdict. Online Judge is configured to give WA if next line is not present.
  Author - Aryan Choudhary (@aryanc403)
 
  const short DEBUG { 0 };
  #define debug(x) if (DEBUG) cout << #x << " = " << x << '\n'
*/

#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")

#include<iostream>
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define fo(i,n)   for(i=0;i<(n);++i)
#define repA(i,j,n)   for(i=(j);i<=(n);++i)
#define repD(i,j,n)   for(i=(j);i>=(n);--i)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define endl "\n"
#define PI 3.1415926535897932384626433832795
typedef long long int lli;
typedef long double mytype;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef vector<lli> vi;

//const lli [3] ={ 999119999L,1000000007L,1000992299L};
//const lli [3] ={ 97L,101L,103L};
//const lli  = chrono::high_resolution_clock::now().time_since_epoch().count();
clock_t time_p=clock();
void aryanc403()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

class CMP
{
public:
    bool operator()(lli a , lli b) //For min priority_queue .
    {
        return ! ( a <= b );
    }
};

void add( map<lli,lli> &m, lli x,lli cnt=1)
{
    map<lli,lli> ::iterator jt;
    jt=m.find(x);
    if(jt==m.end())         m.insert(mp(x,cnt));
    else                    jt->Y+=cnt;
}

void del( map<lli,lli> &m, lli x,lli cnt=1)
{
    map<lli,lli> ::iterator jt;
    jt=m.find(x);
    if(jt->Y<=cnt)            m.erase(jt);
    else                      jt->Y-=cnt;
}

bool cmp(const ii &a,const ii &b)
{
    return a.X<b.X||(a.X==b.X&&a.Y<b.Y);
}
const lli INF = 0xFFFFFFFFFFFFFFFL;
const lli mod = 1000000007L;

    lli T,n,i,j,k,in,cnt,l,r;
    lli m;
    string s;
    vi a;
    vi :: iterator it;
    lli dp[100005];
    //priority_queue < lli , vector < lli > , CMP > pq;// min priority_queue .

int main(void) {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    // freopen("txt.in", "r", stdin);
    // freopen("txt.out", "w", stdout);
// cout<<std::fixed<<std::setprecision(35);
// cin>>T;while(T--)
{

    cin>>n>>k;
    a.clear();a.reserve(n);
    fo(i,n)
    {
        cin>>in;
        a.pb(in);
    }
    dp[0]=0;
    repA(i,1,n-1)
    {
        j=max(0LL,i-k);
        dp[i]=INF;
        while(j<i)
        {
            dp[i]=min(dp[i],dp[j]+abs(a[i]-a[j]));
            j++;
        }
    }
    cout<<dp[n-1]<<endl;
}   aryanc403();
    return 0;
}

Measured memory_bytes: 1792
A, B = gets.split.map(&:to_i)
cnt = 0
A.upto(B) do |n|
    i, j, k, l = n % 10, n.div(10) % 10, n.div(1000) % 10, n.div(10000) % 10
    cnt += 1 if i == l && j == k
end
puts cnt

Measured memory_bytes: 1788
#include <cstdio>

int ai[10000];

int threeortwo(int n)
{
	int count = 0;
	for (int i = 0; i < n; i++)
	{
		while (1)
		{
			if ((ai[i] / 2) != 0 && (ai[i] % 2) == 0)
			{
				ai[i] = ai[i] / 2;
				count++;
			}
			else
			{
				break;
			}
		}
	}
	return count;
}

int main()
{
	int n = 1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &ai[i]);
	}

	printf("%d\n", threeortwo(n));

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
typedef unsigned long long int ull;
typedef long long lint;

int main(void){
  int N;
  cin >> N;
  if(N >= 8){
    int base = 0;
    for(int i = 0; i < N / 8; i++){
      base = i * 12;
      cout << base + 2 << " " << base + 3 << " " << base + 4 << " " << base + 6 << " " << base + 8 << " " << base + 9 << " " << base + 10 << " " << base + 12 << " ";
    }
    base += 12;
    if(N % 8 == 1)cout << base + 6 << " ";
    else if(N % 8 == 2)cout << base + 2 << " " << base + 4 << " ";
    else if(N % 8 == 3)cout << base + 2 << " " << base + 4 << " " << base + 6 << " ";
    else if(N % 8 == 4)cout << base + 2 << " " << base + 4 << " " << base + 6 << " " << base + 12 << " ";
    else if(N % 8 == 5)cout << base + 3 << " " << base + 4 << " " << base + 8 << " " << base + 9 << " " << base + 12 << " ";
    else if(N % 8 == 6)cout << base + 2 << " " << base + 4 << " " << base + 6 << " " << base + 8 << " " << base + 10 << " " << base + 12 << " ";
    else if(N % 8 == 7)cout << base + 2 << " " << base + 3 << " " << base + 4 << " " << base + 8 << " " << base + 9 << " " << base + 10 << " " << base + 12 << endl;
    cout << endl;
  }else {
    if(N == 3)cout << 2 << " " << 5 << " " << 63 << endl;
    else if(N == 4)cout << "2 5 20 63" << endl;
    else if(N == 5)cout << "14 15 16 18 21" << endl;
    else if(N == 6)cout << "14 15 16 18 21 24" << endl;
    else if(N == 7)cout << "14 15 16 18 21 24 30" << endl;
  }
  return 0;
}

Measured memory_bytes: 384
from math import gcd
from functools import reduce

def gcd_mul(numbers):
    return reduce(gcd, numbers)

def lcm(x, y):
    return x * y // gcd(x, y)

def lcm_mul(numbers):
    return reduce(lcm, numbers)

def solve():
    from sys import stdin
    file_input = stdin
    
    from operator import mul
    
    while True:
        n = int(file_input.readline())
        if n == 0:
            break
        d_list = []
        v_list = []
        for i in range(n):
            d, v = map(int, file_input.readline().split())
            d_list.append(d)
            v_list.append(v)
        
        mv = reduce(mul, v_list)
        x = [mv * d // v for d, v in zip(d_list, v_list)]
        l = lcm_mul(x)
        
        for s in x:
            print(l // s)

solve()


Measured memory_bytes: 6472
def main():
    import os

    INF = 10 ** 9 + 10

    D = int(input())
    *C, = map(int, input().split())
    # C[type]
    # sum(ci*(d-last(d,i) for ci in C)だけ下がる
    S = [[int(x) for x in input().split()] for _ in range(D)]
    # S[day][type]:=happiness

    last = [-1] * 26

    def diff(d, t):
        ret = S[d][t]
        ret -= sum(ci * (d - last[i]) for i, ci in enumerate(C) if i != t)
        ret -= sum(ci * (d + 1 - last[i]) for i, ci in enumerate(C) if i != t)
        ret -= C[t]
        return ret

    T = []
    score = 0
    for d in range(D):
        delta = -INF
        take_t = -1
        for t_ in range(26):
            buf = diff(d, t_)
            if delta < buf:
                delta = buf
                take_t = t_
            elif delta == buf and C[t_] > C[take_t]:
                delta = buf
                take_t = t_

        last[take_t] = d
        score += buf
        T.append(take_t + 1)
    print(*T, sep='\n')
    # print(os.path.join(os.path.dirname(__file__), 'output_file.txt'))
    # with open(file=os.path.join(os.path.dirname(__file__), 'output_file.txt'), mode='w', encoding='utf-8') as f:
    #     for t in map(str, T):
    #         f.write(t)
    #         f.write('\n')

    # print(score)


if __name__ == '__main__':
    main()


Measured memory_bytes: 70464
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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 qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){
    int n, m, q;
    int line[555][555]={};
    cin >> n >> m >> q;
    FOR(i,m){
        int l, r;
        cin >> l >> r;
        line[l][r]++;
    }
    iFOR(i,1,n+1){
        iFOR(j,1,n+1){
            line[i][j]+=line[i][j-1];
        }
    }
    iFOR(i,1,n+1){
        iFOR(j,1,n+1){
            line[i][j]+=line[i-1][j];
        }
    }
    int l, r;
    FOR(i,q){
        cin >> l >> r;
        cout <<line[r][r] + line[l-1][l-1] - line[l-1][r] - line[r][l-1] fin;
    }

  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;




Measured memory_bytes: 3328
using System;
using System.Collections.Generic;
using System.Security.Cryptography;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] S = Console.ReadLine().Split(' ');
            int A = int.Parse(S[0]);
            int B = int.Parse(S[1]);
            int H = int.Parse(S[2]);
            int M = int.Parse(S[3]);

            double Hangle = 360 * ((H / 12d) + (1 / 12d) * (M / 60d));
            double Mangle = 360 * (M / 60d);

            double angle_rad = Math.Abs(Hangle - Mangle) * Math.PI / 180d;

            double ans = Math.Sqrt(A * A + B * B - 2 * A * B * Math.Cos(angle_rad));

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 27856
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();

        int ans = 0;

        char[][] map = new char[H][W];
        for (
                int i = 0;
                i < H; i++) {
            map[i] = sc.next().toCharArray();
        }

        int[][] dpup = new int[H][W];
        int[][] dpdown = new int[H][W];
        int[][] dpleft = new int[H][W];
        int[][] dpright = new int[H][W];
        int[][] dpans = new int[H][W];


        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                if (h == 0 || map[h][w] == '#') {
                    dpup[h][w] = 0;
                    continue;
                }
                if (map[h - 1][w] == '#') {
                    dpup[h][w] = 0;
                } else {
                    dpup[h][w] = dpup[h - 1][w] + 1;
                }
            }
        }

        for (int h = H - 1; h >= 0; h--) {
            for (int w = 0; w < W; w++) {
                if (h == H - 1 || map[h][w] == '#') {
                    dpdown[h][w] = 0;
                    continue;
                }
                if (map[h + 1][w] == '#') {
                    dpdown[h][w] = 0;
                } else {
                    dpdown[h][w] = dpdown[h + 1][w] + 1;
                }
            }
        }

        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                if (w == 0 || map[h][w] == '#') {
                    dpleft[h][w] = 0;
                    continue;
                }
                if (map[h][w - 1] == '#') {
                    dpleft[h][w] = 0;
                } else {
                    dpleft[h][w] = dpleft[h][w - 1] + 1;
                }
            }
        }

        for (int h = 0; h < H; h++) {
            for (int w = W - 1; w >= 0; w--) {
                if (w == W - 1 || map[h][w] == '#') {
                    dpright[h][w] = 0;
                    continue;
                }
                if (map[h][w + 1] == '#') {
                    dpright[h][w] = 0;
                } else {
                    dpright[h][w] = dpright[h][w + 1] + 1;
                }
            }
        }


        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                dpans[h][w] = dpup[h][w] + dpdown[h][w] + dpleft[h][w] + dpright[h][w];
                if (map[h][w] == '.') dpans[h][w] += 1;
                ans = Math.max(ans, dpans[h][w]);
            }
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 143472
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,i,cnt4 = 0,cnt2 = 0;
  cin >> n;
  for(int k = 0;k < n;k++){
    cin >> i;
    if(i % 4 == 0)cnt4++;
    else if(i % 2 == 0)cnt2++;
  }
  if(n/2 >cnt4 && (cnt4 * 2 + cnt2) < n)cout << "No" << endl;
  else cout << "Yes" << endl;
}


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

typedef long long ll;

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

int main()
{
  bool judge = true;

  ll N;
  std::string S;
  std::cin >> N >> S;

  if (N % 2 != 0) judge = false;
  if (S.substr(0, N/2) != S.substr(N/2, N/2)) judge = false;

  if (judge) print("Yes");
  else print("No");

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w,k;cin>>h>>w>>k;
    vector<string> cs(h);
    rep(i,h){
        cin>>cs[i];
    }
    int fi = 0;
    rep(i,h){
        for(auto a : cs[i]){
            if(a == '#') fi++;
        }
    }
    int ans = 0;
    for(int bit = 0; bit<(1<<h); bit++){
        for(int bit2 = 0; bit2<(1<<w); bit2++){
            int cnt = 0;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    if((bit & (1<<i)) && (bit2 & (1<<j))){
                        if(cs[i][j] == '#') cnt++;
                    }
                }
            }
            if(cnt == k) ans++;
        }
    }
    cout<<ans<<endl;
    return 0;

}

Measured memory_bytes: 3640
import itertools

while 1:
    n , s = map(int,(input().split()))
    if n == 0 and s == 0:
        break
    l = [i for i in range(10)]
    k = list(itertools.combinations(l,n))
    c = 0
    for i in range(len(k)):
        if sum(k[i]) == s:
            c += 1

    print(c)



Measured memory_bytes: 5700
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNext()){
		    boolean flag[] = new boolean[10];
		    int in = s.nextInt();
		    int a = 1024;
		    int n = 0;
     		    for(int i=9 ; i>=0 ; i--){
			a /= 2;
			if(in>=a){
			    in -= a;
			    flag[i] = true;
			    n++;
			}
		    }
		    int b = 1;
		    for(int i=0 ; i<10 ; i++){
			if(flag[i]==true){
			    n--;
			    System.out.print(b);
			    if(n!=0)
				System.out.print(" ");
			}
			b *= 2;
		    }
		    System.out.println();
		}
	}
}

Measured memory_bytes: 0
package main

import "fmt"

// 2018-08-04T13:30:59+0800
// 2018-08-04T13:44:50+0800 # @see https://arc091.contest.atcoder.jp/submissions/2940605
// 2018-08-04T13:46:32+0800
func main() {
	var N, M int
	fmt.Scanf("%d%d", &N, &M)
	if N > M {
		N, M = M, N
	}
	if N == 1 {
		if M == 1 {
			fmt.Println(1)
		} else {
			fmt.Println(M - 2)
		}
	} else if N == 2 {
		fmt.Println(0)
	} else {
		fmt.Println((N - 2) * (M - 2))
	}
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

LL n, a, b, h[100000];

bool f(LL x) {
	LL c = 0;
	inc(i, n) {
		if(x * b < h[i]) { c += (h[i] - x * b + (a - b - 1)) / (a - b); }
	}
	return (c <= x);
}

int main() {
	cin >> n >> a >> b;
	inc(i, n) { cin >> h[i]; }
	
	sort(h, h + n);
	
	/*
	LL ans = 0, os = 0;
	dec(i, n) {
		LL add = (max(h[i] - os, 0LL) + (a - 1)) / a;
		ans += add;
		os += b * add;
	}
	*/
	
	LL L = 0, H = 1e9;
	while(H - L > 1) {
		LL M = (H + L) / 2;
		(f(M) ? H : L) = M;
	}
	
	cout << H << endl;
	
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
#include <cmath>

using namespace std;

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

    int n, k;
    cin >> n >> k;

    double ans = 0;

    for (int i = 1; i <= n; i++) {
        int omote = ceil(log2((double)k / i));
        if (omote < 0) omote = 0;
        ans += 1.0 / n * pow(0.5, omote);
    }

    printf("%.12f\n", ans);

    return 0;
}

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

int main(){
    int a,b,c,d; cin >> a >> b >> c >> d;
    int ans1=abs(a-b);
    int ans2=abs(c-b);
    int ans3=abs(c-a);
    if ((ans1<=d && ans2<=d)||(ans3<=d)) cout << "Yes";
    else cout << "No";    
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int L = sc.nextInt();
		int R = sc.nextInt();

		sc.close();

//		R = Math.min(L + 2019, R);

		if(R-L > 3000) {
			out.println(0);
			return;
		}
		
		int ans = Integer.MAX_VALUE;
		for(int x=L;x<R;x++) {
			for(int y=x+1;y<=R;y++) {
//				if(x==y)continue;
				
				int m = (int)(((long)x * y) % 2019);
				ans = Math.min(ans, m);
			}
		}
		out.println(ans);

	}

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


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

int main() {
	string s;
	cin >> s;
	int nextL=0,lastR=0,ans[200010]{0};
	for(int i=0;i<s.size();i++){
		while(s[nextL] != 'L' || nextL < i){
			nextL++;
		}
		if(s[i] == 'R'){
			lastR = i;
			if((nextL-i)%2 == 0){
				ans[nextL]++;
			}else{
				ans[nextL-1]++;
			}
		}else{
			if((i-lastR)%2 == 0){
				ans[lastR]++;
			}else{
				ans[lastR+1]++;
			}
		}
	}
	for(int i=0;i<s.size();i++){
		cout << ans[i] << ' ';
	}
	cout << '\n';
	return 0;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000010;
constexpr ll INF= 1000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

template<typename T>
T Pow(T a,T b) {
    T ret = 1;
    for(int i = 0;i < b;i++) {
        ret *= a;
    }
    return ret;
}

ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}

ll RS(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P < 0) {
        return 0;
    }
    if(P%2==0){
        ll t = RS(N, P/2, M);
        return t*t % M;
    }
    return N * RS(N, P-1, M) % M;
}

int H,W;
char vec[1010][1010];
ll dp[1010][1010];


int main() {
    cin >> H >> W;
    for(int i = 0;i < H;i++) {
        for(int j = 0;j < W;j++) {
            cin >> vec[i][j];
        }
    }
    dp[0][0] = 1;
    for(int i = 0;i < H;i++) {
        for(int j = 0;j < W;j++) {
            if(vec[i][j] == '#') {
                continue;
            }
            if(i == 0 && j == 0) {
                continue;
            }
            else if(i == 0) {
                dp[i][j] = dp[i][j - 1];
            }
            else if(j == 0) {
                dp[i][j] = dp[i - 1][j];
            }
            else {
                dp[i][j] = mod(dp[i - 1][j] + dp[i][j - 1]);
            }
        }
    }
    cout << dp[H - 1][W - 1] << endl;
}

Measured memory_bytes: 12436
#include <stdio.h>
#include <math.h>

int main(){
    double x1,y1,x2,y2;
    scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
    printf("%f\n",sqrt(pow(x1-x2,2)+pow(y1-y2,2)));
}


Measured memory_bytes: 2100
import java.util.*;
import java.io.*;

public class Main {
	
	public static void main(String[] args) {
		FastReader in = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		int a = in.nextInt();
		out.print(a+(a*a)+(a*a*a));
		
		
		out.close();
				
    }
	static int search(int[] time, int key, int low, int high) {
		while(low<=high) {
			int mid = (low+high)/2;
			if(time[mid]>key) high = mid-1;
			else if(time[mid]<key) low = mid+1;
			else return mid+1;
		}
		return low;
	}

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

Measured memory_bytes: 32752
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)

int main()
{
    int N, K;
    cin >> N >> K;
    vector<int> P(N);
    REP(i, N) cin >> P[i];

    // P[i:i+K] が元々昇順に並んでいるような i の個数を求める (ただし連結なものは 1 と数える)
    // あとで P[i:i+K], P[i+1:i+K+1] を考えた場合、連結成分一つに対し、最後必ず余分に一つカウントしてしまうため
    int length = 1, num = 0;
    REP(i, N-1){
        if(P[i] < P[i+1]){ 
            ++length;
            if(length == K) ++num;
        }else length = 1;
    }

    int ans = 1;
    set<int> s;
    REP(i, K) s.insert(P[i]);
    FOR(i, K, N){
        // P[i-K:i] と P[i-K+1:i+1] を比べた場合、(これだけ比べれば良い)
        // P[i] が P{i-K+1:i] の最大値より小さい、もしくは
        // P[i-K] が P{i-K+1:i] の最小値より大きければ、できる数列は確実に異なる
        s.erase(P[i-K]);
        if(P[i-K] > *s.begin() or P[i] < *s.rbegin()) ++ans;
        s.insert(P[i]);
    }
    cout << ans-max(0, num-1) << endl;

    return 0;
}

Measured memory_bytes: 10368
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define pf push_front
#define ulli unsigned long long int
#define what_is(x) cerr << #x << " is " << x << endl;
#define pi 2*acos(0.0)
#define F  first
#define S  second
//#define endl '\n'
#define all(x) x.begin(),x.end()
using namespace std;
const lli INF = 1e18L+5;
/*
lli power(lli x,lli y)
{
	lli res=1;
	while(y>0)
	{
		if(y%2==1)
			res=(res*x)%mod;
		x=(x*x)%mod;
		y=y/2;
	}
	return res;
}
*/
int main()
{
	//cout.precision(10);
	//cout.setf(ios::fixed,ios::floatfield);
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	lli T=1;
	//cin>>T;
	while(T--)
	{
		lli i,n,cunt=1;
		cin>>n;
		string s;
		cin>>s;
		for(i=1;i<n;i++)
		{
			if(s[i]!=s[i-1])
			cunt++;
		}
		cout<<cunt<<endl;
	}
}


Measured memory_bytes: 512
// Aizu Vol-5 0584: The Third Permutation
// 2017.8.31 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

int min[4];
int c[15], w;

int cmp(int *a, int *b) { return *a - *b; }

void combi(int a, int b)
{
	int k;
	for (k = 10; b >= k; k *= 10);
	c[w++] = a * k + b;
}

int main()
{
	int n, a, i, j, k;

	scanf("%d", &n);
	for (j = 0; j < 4; j++) min[j] = 10001;
	for (i = 0; i < n; i++) {
		scanf("%d", &a);
		for (j = 0; j < 4; j++) {
			if (a < min[j]) {
				for (k = 3; k > j; k--) min[k] = min[k-1];
				min[j] = a;
				break;
			}
		}
	}
	k = (n < 4) ? n : 4;
	for (w = 0, i = 0; i < k; i++) for (j = i + 1; j < k; j++)
		combi(min[i], min[j]), combi(min[j], min[i]);
	qsort(c, w, sizeof(int), cmp);
	printf("%d\n", c[2]);
	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const ll inf = 1e18;
const ll mod = 1e9+7;
const int N = 1e5+5;

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int n, x = 0, y = 0;
    string s, t;

    cin >> n >> s >> t;

    for (int i = 0; i < 2*n; i++) {

        if (i%2) cout << t[x++];
        else cout << s[y++];
    }

    return 0;
}


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

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

  int N;
  cin >> N;

  long long power = 1;
  for (int i = 1; i <= N; ++i) {
    power *= (long long)i;
    power %= 1000000007;
  }
  cout << power << endl;

  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main()
{
    int n;
    scanf("%d", &n);
    map<string, bool> dic;
    char query[6], value[12];
    for (int i = 0; i < n; i++)
    {
        scanf("%s %s", query, value);
        if (query[0] == 'i')
        {
            dic[value] = true;
        }
        else
        {
            printf(dic[value] ? "yes\n" : "no\n");
        }
    }
}


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

int main() {
	// your code goes here
	int N,L; cin>>N>>L;
	int sum[N+2], val[N+2];
	sum[0] = 0;
	for(int i=1;i<=N;i++) {
		val[i] = L+i-1;
		sum[i] = sum[i-1]+val[i];
	}
	int minDif = INT_MAX, ans;
	for(int i=1;i<=N;i++){
		int cost = sum[N]-val[i];
		int diff = abs(sum[N]-cost);
		if(diff < minDif){
			minDif = diff;
			ans = cost;
		}
		
	}
	printf("%d\n",ans);
	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(){
  int n;
  string s;
  cin >>n >>s;
  int ans = 0;
  for(int i = 1; i<n; i++){
    int cnt = 0;
    for(char c = 'a'; c<='z'; c++){
      bool left = false, right = false;
      rep(j,i){
        if(s[j]==c) left = true;
      }
      for(int j = i; j<n; j++){
        if(s[j]==c) right = true;
      }
      if(left&&right) cnt++;
    }
    if(cnt>ans) ans = cnt;
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int A, B, C, X;
  int k, count = 0;
  cin >> A >> B >> C >> X;
  
  for(int i=0; i<=A; ++i)
    for(int j=0; j<=B; ++j) {
      k = (X - 500*i - 100*j) / 50;
      if(k>=0 && k<=C) count++;
    }
  
  cout << count;
  return 0;
  
}

Measured memory_bytes: 256
def resolve():
    s = input()
    query = int(input())
    r = 0
    left = ''
    for i in range(query):
        q = input()
        if q[0]=='2':
            _,f,c = q.split()
            if (int(f)+r)%2 == 0:
                s += c
            else:
                left += c
        else:
            r = (r+1)%2
    print(left[::-1]+s if r==0 else s[::-1]+left)
resolve()

Measured memory_bytes: 10096
package main

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

func NewScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 1000005), 1000005)
	s.Split(bufio.ScanWords)
	return s
}

func NewWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func ScanString(s *bufio.Scanner) string {
	if !s.Scan() {
		panic("scan string failed")
	}
	return s.Text()
}

func ScanInt(s *bufio.Scanner) int {
	return int(ScanInt64(s))
}

func ScanInt64(s *bufio.Scanner) int64 {
	i, err := strconv.ParseInt(ScanString(s), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	s := NewScanner()
	w := NewWriter()
	defer w.Flush()

	aliceHand, bobHand := ScanInt(s), ScanInt(s)
	if aliceHand == bobHand {
		fmt.Fprintln(w, "Draw")
	} else if aliceHand == 1 {
		fmt.Fprintln(w, "Alice")
	} else if bobHand == 1 {
		fmt.Fprintln(w, "Bob")
	} else if aliceHand > bobHand {
		fmt.Fprintln(w, "Alice")
	} else {
		fmt.Fprintln(w, "Bob")
	}
}


Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int p = sc.nextInt();

        int k;

        k=a*3+p;
        int j = k/2;

        System.out.println(j);

        }

    }

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define DB(x) cerr << __LINE__ << ": " << #x << " = " << (x) << "\n"
using namespace std;
using ll = long long;

signed main() {
    IO;
    // int tests = 1;
    // cin >> tests;
    // for(int test = 1; test <= tests; ++test) {
        
    // }
    ll a;
    cin >> a;
    ll r = a + (a * a) + (a * a * a);
    cout << r;
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli x,y;
	cin>>x>>y;
	if(y-2*x<0||4*x-y<0)
	{
		cout<<"No";
	}
	else
	{
		if((y-2*x)%2!=0||(4*x-y)%2!=0)
		{
			cout<<"No";
		}
		else
		{
			cout<<"Yes";
		}
	}
	
	return 0;
}

Measured memory_bytes: 3636
#include<iostream>

using namespace std;

int main() {
     int a,b;
	 cin >> a >> b;
	 if (a == 1)a = 14;
	 if (b == 1)b = 14;
	 if (a<b)cout << "Bob" << endl;
	 else if (a == b)cout << "Draw" << endl;
	 else cout << "Alice" << endl;
	 return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)
using namespace std;

int main(){
  string a,b ;cin>>a>>b;
  int i=0;int count=0;
  REP(i,0,a.size()){
  	if(a[i]!=b[i])count++;
  }
  cout<<count;
 return 0; 
}

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

#define LL long long
const int mod = 1e9 + 7;
int n, m, l, r, x, dp[305][305][305];
vector<pair<int,int>> v[305];

int solve(int a, int b, int c) {
    if(dp[a][b][c] != -1) return dp[a][b][c];
    int mx = max(a, max(b, c));

    for(auto x : v[mx]) if((a >= x.first) + (b >= x.first) + (c >= x.first) != x.second) return dp[a][b][c] = 0;
    if(mx == n) return dp[a][b][c] = 1;
    return dp[a][b][c] = ((solve(mx + 1, b, c) + solve(a, mx + 1, c)) % mod + solve(a, b, mx + 1)) % mod;     
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0);
    
    cin >> n >> m;
    while(m--) {
        cin >> l >> r >> x;
        v[r].push_back({l, x});
    }        
    memset(dp, -1, sizeof dp);
    cout << solve(0, 0, 0);
}

Measured memory_bytes: 114484
#include <stdio.h>
int max(int a, int b){
	return a > b ? a: b;
}
int min(int a, int b){
	return a < b ? a: b;
}
int main(){
	int a, b, c, d, st, end, dois;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	st = max(a, c);
	end = min(b, d);
	if(end > st)//se quando o segundo apertou, o primero ainda nao soltou
		dois = end - st;
	else
		dois = 0;
	printf("%d\n", dois);
}


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

#define FOR(i, a, b) for(int(i)=(a);(i)<(b);(i)++)
#define REP(i, n) FOR((i), 0, (n))

#define RFOR(i, b, a) for(int(i)=(b); (i)>=(a); (i)--)
#define RREP(i, n) FOR((i), (n), 0)

#define pb push_back
#define mp make_pair 

using namespace std;

const int INF=INT_MAX/4;
const int MOD=1000000007;
const double EPS=1e-14;

const bool debug_flag=true;

void debug(string str){
	if(debug_flag){
		cout<<str<<endl;
	}
}

void debugs(string str){
	if(debug_flag){
		cout<<str;
	}
}

vector < int > p;
int k;

int parent(int a){
	if(p[a]<0)return a;
	return p[a]=parent(p[a]);
}

void myunion(int a, int b){
	a=parent(a);
	b=parent(b);
	if(a!=b){
		if(p[a] > p[b]){
			int tmp=a;
			a=b;
			b=tmp;
		}
		p[a]+=p[b];
		p[b]=a;
		k--;
	}
}

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout.precision(10);
	
	int n, m; 
  	int a, b, l;
	cin>>n>>m;
	p.resize(m);
	vector<bool> used(m);
	k=m;
	REP(i, m){
		p[i]=-1;
	}
	REP(i, m){
		used[i]=false;
	}

	REP(i, n){
		cin>>l;
		cin>>a;
		used[a-1]=true;
		FOR(j, 1, l){
			cin>>b;
			used[b-1]=true;
			myunion(a-1, b-1);
			a=b;
		}
	}

	int cnt=0;
	REP(i, m){
		if(!used[i]){
			cnt++;
		}
	}
	if(k==cnt+1){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}

	return 0;
}



Measured memory_bytes: 640
#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
    int N, K;
    cin >> N >> K;
    int* H = new int[N];
    for (int i = 0; i < N; i++)
    {
        cin >> H[i];
    }
    sort(H, H+N, greater<int>());
    long time = 0;
    for (int i = K; i < N; i++)
    {
        time += H[i];
    }
    cout << time << endl;
    return 0;
}


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

using namespace std;
typedef long long int lli;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef pair <lli,lli> pii;
#define all(vec) vec.begin(),vec.end()
#define ff first
#define ss second
#define inf 4e18
#define MOD 1000000007
#define pb push_back
#define for1(low,high,k) for(int i=low;i<high;i+=k)
#define for2(low,high,k) for(int j=low;j<high;j+=k)
#define rev(high,low,k) for(int i=high;i>=low;i-=k) 

void bfs(lli k,vector <pii> &dist,vector <vector <lli> > &graph){
	queue <lli> qu;
	qu.push(k);
	while (!qu.empty()){
		k=qu.front();
		qu.pop();
		for (int i=0;i<graph[k].size();i++){
			if (dist[graph[k][i]].ff==inf){
				dist[graph[k][i]].ff=dist[k].ff+1;
				dist[graph[k][i]].ss=k;
				qu.push(graph[k][i]);
			}
		}
	}
	return;
}

int main(){
	fast;
	lli n,m,x,y;
	cin>>n>>m;
	vector <vector <lli> > graph(n+1);
	for (int i=0;i<m;i++){
		cin>>x>>y;
		graph[x].pb(y);
		graph[y].pb(x);
	}
	vector <pii> dist(n+1);
	for (int i=0;i<n+1;i++) dist[i].ff=inf,dist[i].ss=-1;
	dist[1].ff=0;
	bfs(1,dist,graph);
	int i;
	for (i=1;i<n+1;i++){
		if (dist[i].ff==inf) break;
	}
	if (i==n+1){
		cout<<"Yes"<<endl;
		for (int i=2;i<n+1;i++) cout<<dist[i].ss<<endl;
	}
	else cout<<"No"<<endl;
}

Measured memory_bytes: 13744
<?php
function getArrayFromStdin() {
	$line = trim(fgets(STDIN));
	$line = str_replace(array("\r\n","\r","\n"), '', $line);
	$line = explode(" ", $line);
	return $line;
}

$n = trim(fgets(STDIN));
$numbers = getArrayFromStdin();

$count = 0;
while(true) {
  $flg = true;
  for ($i = 0; $i < $n; $i++) {
    if ($numbers[$i] % 2) {
      $flg = false;
      break;
    } else {
      $numbers[$i] /= 2; 
    }
  }
  
  if ($flg) {
    $count += 1;
  } else {
    break;
  }
}

echo $count;

Measured memory_bytes: 4856
# -*- coding: utf-8 -*-

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul, xor
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits
from datetime import date

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()

ans=0
for i in range(N):
    x,u=input().split()
    x=float(x)
    if u=='BTC':
        x*=380000
    ans+=x
print(ans)


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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vec;
typedef vector<P> pvec;
typedef vector<vector<int>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<int> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<int,vector<int>,greater<int>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> DX = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> DY = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const ll INF = (1LL << 60); // 1152921504606846976
const double PI = (3.141592653589794);
const double EPS = (0.0000000001); // 10^(-10)

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1) / b);}
template<class T> inline T round(T a, T b) {return T(a / b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template <class T> inline void out(T &a) { bool flag=true; for(auto&x:a){if(flag) {flag=false;} else{ cout << ' '; } cout<<x; } cout << endl; }



//----------------------------------------------------------------
int nmax=200000; // 2*(10^5)
vvec G(nmax);





void solve4ts()
{
  
  
  int cnt=0;
  string s,t;
  cin>>s>>t;
  rep(i,(ll)s.size()){
    if(s[i]!=t[i]) cnt++;
  }
  cout<<cnt<<endl;
  
  
}
//-----------------------------------------------------------------

signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15);
    int repeat = 1;
    // cin >> repeat;
    while(repeat--) solve4ts();
}

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

int main() {

    if(fopen("input_muntu.in", "r")) {
        freopen("input_muntu.in", "r", stdin);
        freopen("output_muntu.out", "w", stdout);
    }

    string s; cin >> s;
    int ans = 0, n = s.size();
    for(int i = 0; i < n / 2; i++) {
        if(s[i] != s[n - i - 1]) {
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

// compile and run : g++ wtf.cpp -o wtf -std=c++11 && wtf

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define pb push_back
#define stll stack<ll>
#define qll queue<ll>
#define pqll priority_queue<ll>
#define mpii map<int,int>
#define mpll map<ll,ll>
#define mpss map<string,string>
#define mpsi map<string,int>
#define mpis map<int,string>
#define mpsll map<string,ll>
#define mplls map<ll,string>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL)
#define mem(a,x) memset(a,x,sizeof(a))
#define inf 0x3f3f3f3f
const int mxn=2e5+9;
const int mod=1e9+7;
int main ()
{
    fast;
    ll A, B, C, K;
    cin>>A>>B>>C;
    cin>>K;
    vll v;
    ll sum = 0;
    v.pb(A), v.pb(B), v.pb(C);
   // ll mor = 2 * v[2];
    srt(v);
    ll mor = 2 * v[2];
    for(ll i = 0; i<K-1; i++)
    {
       mor = mor * 2;
    }
    cout<<mor + v[0] + v[1]<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
const ll mod=1e9+7;
ll mpow(ll x,ll n){
    ll res=1;
    for(ll i=n;i;i>>=1){
        if(i%2==1)res=res*x%mod;
        x=x*x%mod;
    }
    return res;
}
static ll f[(ll)1e6];
int main(void){
    ll n,m;
    cin>>n>>m;
    ll ans=0;
    f[0]=1;
    rep(1,i,1e6)f[i]=f[i-1]*i%mod;
    rep(0,k,n+1){
        ll tmp=(k%2)?(-1):(1);
        ll c=f[n]*mpow(f[k]*f[n-k]%mod,mod-2)%mod;
        ll p=f[m]*mpow(f[m-k],mod-2)%mod;
        //cout<<p<<endl;
        tmp=tmp*c%mod*p%mod;
        p=f[m-k]*mpow(f[m-n],mod-2)%mod;
        tmp=tmp*p%mod*p%mod;
        ans=(ans+tmp+mod)%mod;
    }
    cout<<ans;
}


Measured memory_bytes: 11460
"""
AtCoder :: Beginner Contest 176 :: C - Step 
https://atcoder.jp/contests/abc176/tasks/abc176_c
"""
import sys


def main():
    """Main program."""
    N = int(sys.stdin.readline())
    A = [int(i) for i in sys.stdin.readline().split()]
    max_a = A[0]
    stools_height = 0
    for a in A:
        # If the person is not as tall as the tallest in front of them
        # then they must stand on a stool to equal the height of the
        # tallest person in front of them.
        if a < max_a:
            stools_height += (max_a - a)
        # If the person is taller than anyone in front of them, they are
        # now the tallest person.
        elif a > max_a:
            max_a = a
    print(stools_height)


if __name__ == '__main__':
    main()


Measured memory_bytes: 31400
#include<iostream>
using namespace std;
int main(){
	int a;
	cin>>a;
	int b=0;
	for(int i=1;i<a+1;i++){
		if((9>=i)||(999>=i&&i>=100)||(99999>=i&&i>=10000))
			b++;
	}
	cout<<b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define NIL -1

 int p(int i){return i/2;}
 int l(int i){return i*2;}
 int r(int i){return i*2+1;}

 int main(){
        int n,i,key[251];
        scanf("%d",&n);
        for(i=1;i<=n;i++){scanf("%d",&key[i]);}

        for(i=1;i<=n;i++){
          printf("node %d: key = %d, ",i,key[i]);
          if(p(i)>=1){
               printf("parent key = %d, ",key[p(i)]);
               }
          if(l(i)<=n)printf("left key = %d, ",key[l(i)]);
          if(r(i)<=n)printf("right key = %d, ",key[r(i)]);
          printf("\n");
          }
        
        
        return 0;
        }


Measured memory_bytes: 2048
using CompLib.Util;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

public class Program
{
    int N;
    Robot[] r;
    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        r = new Robot[N];
        for (int i = 0; i < N; i++)
        {
            int x = sc.NextInt();
            int l = sc.NextInt();
            r[i] = new Robot(x, l);

        }


        Array.Sort(r, (a, b) => (a.X + a.L).CompareTo(b.X + b.L));

        int cnt = 1;
        int max = r[0].X + r[0].L;

        for (int i = 1; i < N; i++)
        {
            if (max <= r[i].X - r[i].L)
            {
                cnt++;
                max = r[i].X + r[i].L;
            }
        }

        Console.WriteLine(cnt);
    }



    public static void Main(string[] args) => new Program().Solve();
}

struct Robot
{
    public int X, L;
    public Robot(int x, int l)
    {
        X = x;
        L = l;
    }
}

namespace CompLib.Util
{
    using System;
    using System.Linq;
    class Scanner
    {
        private int _index;
        private string[] _line;
        const char separator = ' ';

        public Scanner()
        {
            _index = 0;
            _line = new string[0];
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(separator);
                _index = 0;
            }
            return _line[_index++];
        }
        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(separator);
            _index = _line.Length;
            return _line;
        }
        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
    }
}

Measured memory_bytes: 15940