akhauriyash/Code-Regression huggingface dataset:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import deque

def bfs(grid: list):
    h = len(grid)
    w = len(grid[0])
    
    dhs = [0, 1, 0, -1]
    dws = [1, 0, -1, 0]
    
    que = deque([(1,(0,0))])
    grid[0][0] = "1"
    
    while que:
        cost, (hcur, wcur) = que.popleft()
    
        for dh, dw in zip(dhs, dws):
            if 0 <= hcur+dh < h and 0 <= wcur+dw < w and grid[hcur+dh][wcur+dw] == ".":
                nex_cost = cost + 1
                grid[hcur+dh][wcur+dw] = str(nex_cost)
                que.append((nex_cost, (hcur+dh, wcur+dw)))
    

h,w = li()

grid = []
for _ in range(h):
    grid.append(lc())

whites = 0
for row in grid:
    whites += row.count(".")

bfs(grid)

if grid[-1][-1] == "#" or grid[-1][-1] == ".":
    print(-1)

else:
    print(whites - int(grid[-1][-1]))

Measured memory_bytes: 3444
#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 sc(x) scanf("%d",&x);
int main(){
    int n; sc(n)
    int A[n], rate[8];
    fill(rate, rate + 8, 0);
    for (int i = 0; i < n; i++) sc(A[i])
    int minv = 0 ,maxv = 0;
    for (int i = 0; i < n; i++) A[i] /= 400;
    for (int i = 0; i < n; i++){
        if (A[i] >= 8) maxv += 1;
        else if (rate[A[i]] == 0){
            minv += 1;
            maxv += 1;
            rate[A[i]] = 1;
        }
    }
    if (minv == 0) minv = 1;
    cout << minv << " " << maxv << endl;
    return 0;
}

Measured memory_bytes: 384
s = str(input())
t = str(input())
ls = [[0] for i in range(26)]
lt = [[0] for i in range(26)]

for i in range(len(s)):
    ls[ord(s[i])-97].append(i)
    lt[ord(t[i])-97].append(i)
# print(ls)
# print(lt)
for i in ls:
    f = 0
    for j in lt:
        if i==j:
            f = 1
            break
    if f == 0:
        print("No")
        exit()
print("Yes")

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



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

    int a, b, c;
    cin >> a >> b >> c;

    int answer = 0;

    answer += min(a, c);

    a -= answer;
    c -= answer;

    if (b >= c) {
        answer += b + c;
    }
    else {
        answer += 2 * b + 1;
    }

    cout << answer << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb          push_back
#define m_p			make_pair
#define rep(i,a,b)	for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i =a, i>=b;i--)
#define sz(x)       (int)x.size()
#define F			first
#define S			second
#define debug(x)	for(int i=0;i<x;i++) cout<<"##########"<<endl
#define M			1000000007
#define ll			long long int
#define lMax		LLONG_MAX
#define pii 		pair<int ,int >
#define	all(a)		a.begin(), a.end()
#define vi 			vector<int> 
#define vii 		vector<pii>

// queue<int> , prefix_sum(a,a+n) , reverse(a,a+n) , priority_queue <int> max heap , priority_queue <int, vector<int>, greater<int> > min heap;
// == > != precedence gretaer then & , << precedence greater than <= == => , 
//int chk, cnt, fl, pos, in, src, tar, val, res. dummy;  fill (myvector.begin(),myvector.begin()+4,5), freq;

void solve()
{
	string s,t;
	cin>>s>>t;
	
	int n=sz(s),m=sz(t);
	
	int dp[n+1][m+1];
	memset(dp,0,sizeof(dp));
	
	rep(i,1,n+1)
	{
		rep(j,1,m+1)
		{
			if(s[i-1]==t[j-1]) dp[i][j]=dp[i-1][j-1]+1;
			else dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
		}
	}
	stack<char> st;
	
	int i=n,j=m;
	
	while(i>0&&j>0)
	{
		if(s[i-1]==t[j-1]) st.push(s[i-1]),i--,j--;
		
		else
		{
			if(dp[i-1][j]>dp[i][j-1]) i--;
			else j--;
		}
	}
	while(!st.empty())
	{
		cout<<st.top();
		st.pop();
	}
	
}


signed main()
{
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
		int t=1;
		while(t--)
		{
			solve();
		}
}

Measured memory_bytes: 35456
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <climits>
#include <tuple>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#define rep(i, n) for(Int (i) = 0; (i) < (n); (i)++)
#define debug(var) cout << #var << ": " << var << endl
using namespace std;
using Int = int64_t;
using Uint = uint64_t;
constexpr Uint mod = 1e9 + 7;
constexpr Int Int_max = LLONG_MAX;
constexpr Int Int_min = LLONG_MIN;
using Container = vector<Int>;
using Grid = vector<vector<char>>; // [y][x]
template<typename T, typename U>
using Umap = unordered_map<T, U>;
template<typename T>
using Uset = unordered_set<T>;
template<typename T>
using P = pair<T, T>;


int main() {

	Int N, K; cin >> N >> K;
	Container h(N + 2);
	rep(i, N)cin >> h[i];

	Container dp(N, Int_max);
	dp[0] = 0;
	
	rep(i, N) {
		rep(j, K) {
			if (i + j + 1 < N)dp[i + j + 1] = min(dp[i + j + 1], dp[i] + abs(h[i + j + 1] - h[i]));
		}
	}

	cout << dp[N - 1];

}

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

using namespace std;

const int mxn = 1e5;
int p[mxn + 11];

int main(){
   // freopen("input.txt", "r", stdin);
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 0; i < n; i++){
        scanf("%d", p + i);
    }
    sort(p, p + n);
    int ans = INT_MAX;
    for (int i = 0; i <= n - k; i++){
        ans = min(ans, p[i + k - 1] - p[i]);
    }
    printf("%d\n", ans);
    return 0;
}


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

int main() { /* ここに書く */
  string A;
  int a,i;
  cin>>A;
  a=A.size();
  i=0;
  
  while(i<a){
  cout<<"x";
  i++;}
  
  cout<<endl;
  }

Measured memory_bytes: 256
#include<iostream>
	#include<vector>
	#include<algorithm>
	#include<string>
	#include<cmath>
	#include<map>
	#include<cstdio>
	#include<stack>
	#include<queue>
	#include<fstream>
	#include<cstdio>
	#include<deque>
	#include<iomanip>
	#include <numeric>
	//#include<bits/stdc++.h>

	using namespace std;
	#define ok1 printf("ok1\n");
	#define ok2 printf("ok2\n");
	#define M 1000000000000000000LL
	#define rep(i,n) for(int i=0;i<n;i++)
	#define REP(i,s,n) for(int i=(s);i<(n);i++)
	#define repr(i,n) for(int i=n-1;i>=0;i--)
	#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
	#define all(a) (a).begin(),(a).end()
	#define reall(a) (a).rbegin(),(a).rend()
	#define pb push_back
	#define pf push_front
	#define MIN(a,b) a=min((a),(b))
	#define MAX(a,b) a=max((a),(b))
	#define SIZE(v) (int)v.size()
	const double pi = acos(-1.0);

	typedef vector<int> vi;
	typedef vector<string> vs;
	typedef long long ll;
	typedef vector<ll> vll;
	typedef vector<vi> vvi;
	typedef vector<vll> vvll;
	typedef deque<ll> dll;
	typedef pair<ll, ll> P;
	const ll mod = 1e9 + 7;
	ll dx[4] = {1,0,-1,0};
	ll dy[4] = {0,1,0,-1};


	int main() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		
		ll a;
		cin >> a;
		ll ans = 0;
		REP(i, 1, a + 1) ans += i;
		cout << ans << endl;
		return 0;
	}	
	

Measured memory_bytes: 384
import math
import collections
import sys

#input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n,i=MI()
ans=n+1-i
print(ans)



Measured memory_bytes: 3316
// https://atcoder.jp/contests/abc080/tasks/abc080_b
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b = 0;
    cin >> n;
    a = n;
    while (a > 0) {
        b += a % 10;
        a /= 10;
    }
    if (n % b == 0) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }

    return 0;
}


Measured memory_bytes: 256
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <regex>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
using ll = long long;
using VL=vector<ll>;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
const long long INF =  999999999;

//n以下の素数のvector配列をprimeに格納する。
//エラトステネスの篩
void eratos(vector<ll>& prime,int n){
  bool used[n+10];
  fill(used,used+n+2,false);
  for(int i=2;i<=n;i++){
    if(!used[i]){
      prime.push_back(i);
      int j=i;
      while(j<=n){
        used[j]=true;
        j+=i;
      }
    }
  }
}


int main(){
  ll X,ans;
  vector<ll> prime;
  cin>>X;
  eratos(prime,X+10000);
  REP(i,prime.size()){
    if(prime[i]>=X){
      ans=prime[i];
      break;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;
using vec=vector<ll>;
using mat=vector<vec>;
int mod=1e9+7;
mat mul(mat &a,mat &b)
{
  mat res(a.size(),vec(b[0].size(),0));
  int ha=a.size(),h=b.size(),w=b[0].size();
  for(int i=0;i<ha;i++)
  {
    for(int k=0;k<h;k++)
    {
      for(int j=0;j<w;j++)
      {
        res[i][j]+=a[i][k]*b[k][j];
        res[i][j]%=mod;
      }
    }
  }
  return res;
}

mat pow(mat &a,ll n)
{
  mat b(a.size(),vec(a.size(),0));
  for(int i=0;i<a.size();i++)
  {
    b[i][i]=1;
  }
  while(n>0)
  {
    if(n&1)b=mul(b,a);
    a=mul(a,a);
    n>>=1;
  }
  return b;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k;
  cin>>n>>k;
  mat p(n,vector<ll>(n,0));
  rep(i,n)rep(j,n)cin>>p[i][j];
  mat x(n,vector<ll>(1,1));
  auto q=pow(p,k);
  mul(q,x);
  int res=0;
  rep(i,n)rep(j,n){res+=q[i][j];res%=mod;}
  cout<<res<<endl;




  return 0;

}


Measured memory_bytes: 384
from itertools import groupby

R = lambda: map(int, input().split())
n, k = R()
a = list(R())
w = [0] * n

def merge(b, e):
    m = b + (e - b) // 2
    i, j = b, m
    r = k = 0
    while i < m and j < e:
        if a[i] <= a[j]:
            w[k] = a[i]
            i += 1
        else:
            r += m - i
            w[k] = a[j]
            j += 1
        k += 1
    a[e - m + i: e] = a[i: m]
    a[b: b + k] = w[:k]
    return r        
    
def mergesort(b, e):
    if e - b < 2:
        return 0
    m = b + (e - b) // 2
    return mergesort(b, m) + mergesort(m, e) + merge(b, e)


r = k * mergesort(0, n)
c = n * (n - 1) // 2
for v, g in groupby(a):
    x = sum(g) // v
    c -= x * (x - 1) // 2
print((r + c * k * (k - 1) // 2) % (10**9 + 7))


Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define ll                  long long
#define dl                 long double
#define pb                push_back
#define F                  first
#define S                  second
#define endl              "\n"
#define rep(i,a,b)       for(i=a;i<b;i++)
#define all(v)             v.begin(),v.end()
#define allr(v)            v.rbegin(),v.rend()
#define mod              1000000007LL
#define CIN(V,s,n)      for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n)   {for(int i=s;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);      for(ll i=0;i<V.size();i++) V[i] = 0;
#define N                  101LL
#define tmod             998244353LL
using namespace std;

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

ll Powb(ll b,ll n,ll m);
ll BS(vector<pair< ll ,ll > > &PS,ll s,ll e,ll ser);
ll MI(ll a, ll m);
ll P[N+1];
void Sieve(int n=N);

int main()
{
fast;
ll q=1,t;
//cin >> q; t = q;
while(q--)
{
    ll i,j,n,m,k,l=0,r=0,a=1,b=0,c=0,d=0,e,g=1,p,u,v,w,x,y,flag=1;
    //n=m=k=i=j=l=r=a=b=c=d=u=v=w=p=x=y=0;
    cin >> r ;
    cout << r*r;
}
    return 0;
}

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

ll Powb(ll b,ll n,ll m)
{
    if(n==0) return 1LL;
    if(n==1) return b;
    ll temp = Powb(b,n/2,m);
    if(n%2==0){return (temp*temp)%m;}
    else{return (b*((temp*temp)%m))%m;}
}

ll BS(vector<pair<ll,ll> > &PS,ll s,ll e,ll ser)
{
    if(s>e)
        return s;
    ll mid = (s+e)/2;
    if(PS[mid].F==ser)
    {
        return mid;
    }
    else if(PS[mid].F > ser)
    {
        return BS(PS,s,mid-1,ser);
    }
    else
        return BS(PS,mid+1,e,ser);
}
ll MI(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;
    if (m == 1)
      return 0;
    while (a > 1)
    {
        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;
    return x;
}

void Sieve(int n)
{
    //memset(P,true,sizeof(P));
    //P[0] = false;
    //P[1]= false;
    for(int i=1;i<=n;i++) P[i] = i;
    for(ll i=2;i*i<=n;i++)
    {
        if(P[i]==i)
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                if(P[j]==j)
                    P[j]=i;
            }
        }
    }

}



Measured memory_bytes: 3656
N, M, X, Y = gets.chomp.split(" ").map(&:to_i)
x, y = readlines.map{|a| a.split(" ").map(&:to_i)}
max_x_coord = x.max
min_y_coord = y.min
puts max_x_coord < min_y_coord && X < min_y_coord && max_x_coord < Y ? "No War" : "War"

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

int main(){
  int N, M, X;
  cin >> N >> M >> X;
  int A[M];
  for(int i = 1; i <= M; i++) cin >> A[i];
  int b = 0;
  int sum1 = 0;
  int sum2 = 0;
  for(int i = 1; i <= M; i++){
    if(A[i] > X){
      b = i;
      break;
    }
    sum1++;
  }
  sum2 = M - b + 1;
  if(sum1 < sum2) cout << sum1 << endl;
  else cout << sum2 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less 
using namespace __gnu_pbds; 
#define mod 1000000007
#define int long long
#define pb push_back
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define inp(n) for(i=0;i<n;i++) cin>>A[i];
#define inz(A) memset(A,0,sizeof(A))
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin(),v.end()
#define T 1000000
#define F first
#define S second
#define pi pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define vp vector<pair< int,int> >
#define mpi map<pair<int,int> ,int>
#define mip map<int, pair<int,int> >
#define inf INT_MAX
#define inf1 LONGLONG_MAX
#define sz(v) v.size()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<#x<<"is "<<x<<endl;
#define lower(s) transform(all(s),s.begin(),::tolower)
#define endl "\n"
typedef tree<int, null_type, less<int>, rb_tree_tag, 
         tree_order_statistics_node_update> pbds;
   
/* brownsands :Arpit */			

void solve()
{  int ans=0,a,b,n,x,y,i,c;vi v; vi v1;vi v2;vi v3;
   cin >> a >> b >> n >>x >> y;
   for(i=1;i<=n;i++)
   {
      cin>>c;v.pb(c);
   }
   for(i=1;i<=x;i++)
   {
      cin>>c;v1.pb(c);
   }
   for(i=1;i<=y;i++)
   {
      cin >> c;v2.pb(c);
   }
   sort(all(v1));sort(all(v));sort(all(v2));
   reverse(all(v));reverse(all(v1));reverse(all(v2));
   for(i=0;i<min(a,n);i++)v3.pb(v[i]);
   for(i=0;i<min(b,x);i++)v3.pb(v1[i]);
   for(i=0;i<y;i++)v3.pb(v2[i]);
   sort(all(v3));
   reverse(all(v3));
   for(i=0;i<a+b;i++)ans+=v3[i];
   cout<<ans;
}
signed main()
{
   boost
        int test=0,t;
		//cin>>t;
		t=1;
		while(test++ <t){
            //cout<<"Case "<<test<<": ";
            solve();
            //cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
               }		
} 
               
			
 

				
		
		




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

#define FAST {ios::sync(false);}
#define pb push_back
#define fi first
#define se second
#define f(i,a,b) for(int i=a;i<b;i++)

int main(){

    // FAST

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

    vector<int> arr(n);
    f(i,0,n){
        cin>>arr[i];
    }

    vector<int> ans(n,INT_MAX);
    ans[0]=0;
    for(int i=0;i<n-1;i++){
    	int itr=0,j=i+1;
    	for(;itr < k && j<n;j++,itr++){
        	ans[j] = min(ans[j],ans[i]+abs(arr[i] - arr[j]));
    	}
    }
    cout<<ans[n-1]<<endl;
    return 0;
}


Measured memory_bytes: 4032
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=1; i<(int)(n); i++)
int D, c[27], s[366][27];

int sco(vector<int> &t, int k, int x){
int S=0, L[27]={};
REP(i, D){
  if(i==k){ S+=s[i][x]; L[x]=i; }else{ S+=s[i][t[i]]; L[t[i]]=i; }
  REP(j, 27){ S-=c[j]*(i-L[j]); }
}
return S;
}

int saga(int d, vector<int> &L){
  int S=0;
  REP(i, 27){ S+=c[i]*(d-L[i]); }
  return S;
}

int main(){
  cin >> D; D++;
  REP(i, 27){ cin >> c[i]; }
  REP(i, D){ REP(j, 27){ cin >> s[i][j]; } }
  vector<int> t(D), last(27, 0);

  REP(i, D){
    int a=1, S=-1000000, u=0, m=0;
    REP(j, 27){
      u=s[i][j]; u-=saga(i, last); u+=c[j]*(i-last[j]);
      if(S<u){ a=j; S=u; }
    }
    t[i]=a; last[a]=i;
  }
  int S=sco(t, 0, 0), T=0, n=0;
  REP(i, D){ 
   REP(j, 27){ T=sco(t, i, j); if(S<T){ t[i]=j; S=T; if(n<=100){i=1; n++; break;} } }
  }
  
  REP(i, D){ cout << t[i] << "\n"; }
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;


int main() {
int X;
cin >> X;
int maxi = -1;
if (X == 1) {
    cout << 1 << endl;
    return 0;
} else {
int maxi = -1;
for (int i = X;i > 0;i--) {
    for (int j = 2;j < i;j++) {
        int a = i;
        while (a % j == 0) {
            a /= j;
        }
        if (a == 1) {
            maxi = i;
            break;
        }
    }
    if (maxi > 0) break;
}
cout << maxi << endl;
}
return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static String Y = "Yes";
	public static String N = "No";
	public static long MOD = (long) (Math.pow(10, 9) + 7);
	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {

		int n = ni();

		if (n == 7 || n == 5 || n == 3) {
			out("YES");
		} else {
			out("NO");
		}

	}

	/*
	 * 以下メソッド集
	 */

	public static long[] kousokusoinnsuubunkaihairetsu(long n2) {
		long[] d = new long[(int) n2];
		for (int i = 0; i < n2; i++) {
			d[i] = i;
		}
		for (int i = 2; i * i < n2; i++) {
			for (int j = i * i; j < n2; j += i) {
				if (d[j] == j)
					d[j] = i;
			}

		}

		return d;
	}

	public static void permutation(String q, String ans) {
		// Base Case
		if (q.length() <= 1) {
			System.out.println(ans + q);
		}
		// General Case
		else {
			for (int i = 0; i < q.length(); i++) {
				permutation(q.substring(0, i) + q.substring(i + 1),
						ans + q.charAt(i));
			}
		}
	}

	static char[][] same(char[][] c, int h, int w) {

		char[][] a = new char[h][w];
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				a[i][j] = c[i][j];
			}
		}
		return a;

	}

	static int countkuro(char[][] c) {

		int count = 0;
		for (char[] cc : c) {
			for (char ccc : cc) {
				if ('#' == ccc) {
					count++;
				}
			}
		}
		return count;
	}

	static void debug() {

		out("---");
	}

	static void debug(Object a) {

		out("-------");
		out(a);
		out("-------");
	}

	static int ketasuu(int n) {

		String str = "" + n;
		return str.length();
	}

	static int account(String str) {

		String target = "2";
		int count = 0;
		int len = str.length();
		for (int i = 0; i < len; i++) {
			if (target.equals(str.substring(i, i + target.length()))) {
				count++;
			}
		}
		return count;
	}

	static int ni() {

		return sc.nextInt();
	}

	static long nl() {

		return sc.nextLong();
	}

	static double nd() {

		return sc.nextDouble();
	}

	static String n() {

		return sc.next();
	}

	static char[] nc() {

		return sc.next().toCharArray();
	}

	static int kaijo(int n) {

		if (n == 0 || n == 1) {
			return 1;
		} else {
			return n * kaijo(n - 1);
		}
	}

	static long kaijo(long n) {

		debug(n);

		if (n == 0l || n == 1l) {
			return 1l;
		} else {
			return n * kaijo(n - 1l);
		}
	}

	static int fib(int n) {

		return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);
	}

	static long lcm(long m, long n) {

		return m * n / gcd(m, n);
	}

	static int lcm(int m, int n) {

		return m * n / gcd(m, n);
	}

	static long gcd(long a, long b) {

		return (b == 0) ? a : gcd(b, a % b);
	}

	static int gcd(int a, int b) {

		return (b == 0) ? a : gcd(b, a % b);
	}

	static void out(Object obj) {
		System.out.println(obj);
	}

	static void outn(Object obj) {
		System.out.print(obj);
	}

	static double max(double d, double e) {

		return Math.max(d, e);
	}

	static long max(long a, long b) {

		return Math.max(a, b);
	}

	static long min(long d, long e) {

		return Math.min(d, e);
	}

	static int min(int a, int b) {

		return Math.min(a, b);
	}
}

class XY {

	int h;
	int w;
	int d;

	XY(int h, int w, int d) {
		this.h = h;
		this.w = w;
		this.d = d;
	}
}


Measured memory_bytes: 35600
def get_min(a,b):
    a = int(a)
    b = int(b)
    if(a < b):
        return a
    else:
        return b

N = int(input())
hn = [int(x) for x in input().split()]

dp = [float('inf')] * N

#一番最初の足場にいるときはコスト0
dp[0] = 0
dp[1] = dp[0] + abs(hn[1]-hn[0])

#dp[i]が足場iにいくのにかかるコスト
for i in range(2, N):
    double_step = dp[i-2] + abs(hn[i] - hn[i-2])
    single_step = dp[i-1] + abs(hn[i] - hn[i-1])
    dp[i] = get_min(single_step, double_step)

print(dp[N-1])

Measured memory_bytes: 14052
N, M, X, Y = (int(i) for i in input().split())

xx = [int(i) for i in input().split()]
yy = [int(i) for i in input().split()]

mx = max(xx)
my = min(yy)

flag = 1

for i in range(201):
   Z = i - 100
   if (X < Z) and (Z <= Y) and (mx < Z) and (Z <= my):
       flag = 0

if flag == 1 :
    print("War")
else:
    print("No War")


Measured memory_bytes: 3064
import sys
input=sys.stdin.readline

n,k,c=map(int,input().split())
S=input()
A=[]
for i in range(n):
    if S[i]=="o":
        A.append(i)

B=[]
C=[]
now=-1
for a in A:
    if now==-1:
        C.append(a)
        now=a
    else:
        if now+c>=a:
            C.append(a)
        else:
            B.append(C)
            C=[]
            C.append(a)
            now=a
if C:
    B.append(C)
    
b=len(B)

if b==k:
    Ans=[]
    for i in range(b):
        T=B[-1-i]
        l=len(T)
        if l==1:
            chk=T[0]
            Ans.append(T[0])
            continue
        if i==0:
            chk=T[-1]
            continue
        cnt=0 #勤務可能が1日しかないかチェック
        for t in T:
            if t+c<chk: #後ろの勤務可能最終日と比較
                now=t
                cnt+=1
            else:
                break
        chk=now
        if cnt==1:
            Ans.append(T[0])

    Ans.sort()
    for ans in Ans:
        print(ans+1)

Measured memory_bytes: 79180
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define all(a) a.begin(),a.end()
#define pb push_back
#define mp make_pair
const int N = 1000002;
const int M = 1e9 + 7;
const int oo = INT_MAX;

int n,a[N];
int spf[N], primes[N];

int gcd(int a, int b){
    if(b == 0)
        return a;
    return gcd(b, a % b);
}

void sieve(){
    spf[1] = 1;
    for(int i = 2; i < N; i++){
        if(spf[i] == 0){
            for(int j = i; j < N; j += i)
                spf[j] = i;
        }
    }
}

void factorize(int a){
    while(a != 1){
        int p = spf[a];
        primes[p]++;
        while(a % p == 0){
            a /= p;
        }
    }
}

bool check(int a){
    while(a != 1){
        int p = spf[a];
        if(primes[p]>1)
            return false;
        while(a % p == 0){
            a /= p;
        }
    }
    return true;
}

int main(){
    cin>>n;
    for(int i = 0; i < n; i++)
        scanf("%d", a + i);
    
    int d = a[0];
    for(int i = 1; i < n; i++)
        d = gcd(d, a[i]);
    
    sieve();

    if(d == 1){
        for(int i = 0; i < n; i++)
            factorize(a[i]);

        bool f = true;
        for(int i = 0; i < n; i++)
            f &= check(a[i]);

        puts(f?"pairwise coprime":"setwise coprime");
    }
    else
        puts("not coprime");

}


Measured memory_bytes: 14824
#include<bits/stdc++.h>
using namespace std;
vector<char>v;
int main()
{
	int g[3];
	int n;
	cin>>n>>g[0]>>g[1]>>g[2];
	char c1,c2,c3,c4;
	cin>>c1>>c2;
	for(int i=0;i<n-1;i++)
	{
		cin>>c3>>c4;
		if(g[c1-'A']>g[c2-'A'])
			g[c1-'A']--,g[c2-'A']++,v.push_back(c2);
		else if(g[c1-'A']<g[c2-'A'])
			g[c1-'A']++,g[c2-'A']--,v.push_back(c1);
		else
		{
			if(c1==c3&&c2!=c4||c1==c4&&c2!=c3)
				g[c1-'A']++,g[c2-'A']--,v.push_back(c1);
			else
				g[c1-'A']--,g[c2-'A']++,v.push_back(c2);
		}
		if(g[c1-'A']<0||g[c2-'A']<0)
		{
			cout<<"No";
			return 0;
		}
		c1=c3;c2=c4;
	}
	if(g[c1-'A']>g[c2-'A'])
			g[c1-'A']--,g[c2-'A']++,v.push_back(c2);
		else 
			g[c1-'A']++,g[c2-'A']--,v.push_back(c1);
	if(g[c1-'A']<0||g[c2-'A']<0)
		{
			cout<<"No";
			return 0;
		}
//	cout<<g[0]<<g[1]<<g[2];
	cout<<"Yes"<<endl;
	for(int i=0;i<v.size();i++)
		cout<<v[i]<<endl;
	return 0;
}

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

int main()
{
	char a[101];
	int len;
	int flag = 0;

	cin >> a;
	len = strlen(a);

	for (int i = 0; i < len; i++) {
		if (i % 2 == 0) {
			if (a[i] == 'L') flag = flag + 1;
		}
		else {
			if (a[i] == 'R') flag = flag + 1;
		}
	}

	if (flag > 0) {
		cout << "No";
	}
	else {
		cout << "Yes";
	}
}

Measured memory_bytes: 256
L,R=map(int,input().split())
MOD=2019
l,r=L%MOD,R%MOD
if R>=L+2018:print(0)
elif l>=r:print(0)
else:
    ans=MOD
    for i in range(l,r):
        for j in range(i+1,r+1):ans=min(ans,((i*j)%MOD))
    print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int mod=1000000007;
int power(int x, int y, int p) 
{ 
    int res = 1;      
  
    x = x % p;  
  
    while (y > 0) 
    {         if (y & 1) 
            res = (res*x) % p; 
          y = y>>1; 
        x = (x*x) % p; 
    } 
    return res; 
} 
 int modInverse(int n, int p) 
{ 
    return power(n, p-2, p); 
} 
int nCrModPFermat(int n, int r, int p) 
{ 
   if (r==0) 
      return 1; 
    int 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 distancesum(int arr[], int n) 
{ 
    sort(arr, arr + n); 
    int res = 0, sum = 0; 
    for (int i = 0; i < n; i++) 
    { 
        res += ((arr[i] * i - sum)%mod+mod)%mod; 
        sum += arr[i]; 
        sum%=mod;
    } 
    return res; 
} 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n,m,t;
	cin>>n>>m>>t;
	int x[n*m],y[n*m];
	int k=0;
	for(int i=1;i<=n;i++)
	{
		 for(int j=1;j<=m;j++)
		 {
		 	 x[k]=i;
		 	 y[k]=j;
		 	 k++;
		 }
	}
    int res=distancesum(x,n*m)+distancesum(y,n*m);
    res%=mod;
    res*=nCrModPFermat(n*m-2,t-2,mod);
    res%=mod;
    cout<<res<<endl;
}


Measured memory_bytes: 4992
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <stack>
#include <regex>

#define mod 1000000007
#define INF2 9999999999
#define INF (1<<30)
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define P pair<int, int>

using namespace std;
using ll = int64_t;

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

void solve(){
    ll n;
    cin >> n;
    if(n%2 == 0){
        cout << n << endl;
    }else{
        cout << n*2 << endl;
    }
}

int main(){
    solve();
    return 0;
}

Measured memory_bytes: 256
n,c = map(int,input().split())

D_list = [[int(i) for i in input().split()] for _ in range(c)]
c_list = [[int(i) for i in input().split()] for _ in range(n)]

c_num=[[0 for _ in range(3)] for __ in range(c)]

for a in range(n):
    for b in range(n):
        c_num[c_list[b][a]-1][(a+b+2)%3] += 1


ans = 10 ** 10
for i in range(1,c**3):
    x=i%c
    y=(i%c**2)//c
    z=i//c**2
    if x==y or y==z or z==x:
        continue
    else:
        color=[x,y,z]
        count = 0
        for s in range(3):
            for t in range(c):
                count += c_num[t][s] *D_list[t][color[s]]

        if count < ans:
            ans = count

print(ans)


Measured memory_bytes: 11392
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(),(v).end()
#define out(a) cout << (a) << endl
using namespace std;
using ll = long long;
int main(){
    int n, m, sum=0;
    cin >> n;

    int T[n];
    rep(i, n) {
        int t;
        cin >> t;
        T[i] = t;
        sum += t;
    }


    cin >> m;
    vector<int> ans(m);
    
    rep(i, m) {
        int p, x;
        cin >> p >> x;
        ans[i] = sum - T[p-1] + x;
    }

    rep(i, m) out(ans[i]);
    
}

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

struct RollingHash {
    vector<unsigned long long> hash, power;
    const unsigned long long seed = 10007, mod  = 1e9 + 7;

    RollingHash(const string &s) {
        int n = (int)s.size();
        hash.assign( n + 1, 0);
        power.assign(n + 1, 1);
        for(int i = 0; i < n; ++i) power[i+1] = power[i] * seed % mod;

        for(int i = 0; i < n; ++i) {
            hash[i+1]  = (hash[i] * seed + s[i]) % mod;
            power[i+1] = power[i] * seed % mod;
        }
    }

    // [l, r)
    unsigned long long get_hash(int l, int r) {
        unsigned long long ret = (hash[r] - hash[l] * power[r-l] % mod + mod) % mod;
        return ret;
    }
};

struct UnionFind {
    vector<int> par, weight;
    UnionFind(int n) : par(n,-1), weight(n) {}
    bool unite(int x, int y, int w = 0) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y), w = -w;
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    bool same(int x, int y) { return root(x) == root(y); }
    int root(int x) {
        if(par[x] < 0) return x;
        int r = root(par[x]);
        return par[x] = r;
    }
    int sizeOf(int x) { return -par[root(x)]; }
};

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    string s,t; cin >> s >> t;
    int n = s.size();
    s = s + s + s;
    while(t.size()*2 > s.size()) s += s;

    int N = s.size();
    int m = t.size();
    vector<bool> match(N);

    RollingHash rh1(s), rh2(t);
    unsigned long long thash= rh2.get_hash(0, m);
    
    for(int i=0; i < N - m; ++i) {
        if(rh1.get_hash(i, i + m) == thash) match[i] = true;
    }

    // loop check & count
    UnionFind uf(N);
    for(int i = 0; i < n; ++i) {
        if(match[i] && match[(i + m) % n]) {
            if(!uf.unite(i, (i + m) % n)) {
                cout << -1 << endl;
                return 0;
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < N; ++i) if(match[i]) ans = max(ans, uf.sizeOf(i));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 47892
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll a,b;
	cin>>a>>b;
	for(ll i=1;i<=100000;i++){
		if(ll(i*0.08)==a&&ll(i*0.1)==b){
			cout << i;
			return 0;
		}
	}
	cout << -1;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll         = long long;
constexpr ll MOD = 1000000007;
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REP2(i, x, n) for (ll i = x; i < (n); i++)
const long long INF = numeric_limits<long long>::max();
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;
}
vector<ll> getNums(ll N) {
    vector<ll> num(N);
    REP(i, N) {
        cin >> num[i];
    }
    return num;
}
unordered_map<ll, ll> countMap;

void func(ll n) {
    for (ll i = 2; i <= n; ++i) {
        ll count = 0;
        while ((n % i) == 0) {
            count++;
            n /= i;
        }
        if (count > 0) {
            countMap[i] += count;
        }
    }
    if (n != 1) {
        countMap[n]++;
    }
}
int main() {
    ll N;
    cin >> N;

    countMap.clear();

    for (ll i = 1; i <= N; ++i) {
        func(i);
    }

#ifdef SOURCE_TEST
    for (auto m : countMap) {
        cout << m.first << ":" << m.second << endl;
    }
#endif

    ll ans = 1;
    for (const auto& m : countMap) {
        ans *= m.second + 1;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <chrono>
#include <iomanip>
#include <cstring>
 
using namespace std;
 
int main() {
    string s, t;
    cin >> s >> t;
    int n = s.length(), m = t.length();
    int l[n+1][m+1];
    for (int i = 0 ; i<=n ; i++) l[i][0] = 0;
    for (int i = 0 ; i<=m ; i++) l[0][i] = 0;
    int k[n][m];
    memset(k, 0, sizeof k);
    for (int i = 1 ; i<=n ; i++) {
        for (int j = 1 ; j<=m ; j++) {
            if (s[i-1]==t[j-1]) {
                l[i][j] = l[i-1][j-1] + 1;
                k[i-1][j-1] = 0;
            }
            else if (l[i][j-1]>l[i-1][j]) {
                l[i][j] = l[i][j-1];
                k[i-1][j-1] = 1;
            }
            else {
                l[i][j] = l[i-1][j];
                k[i-1][j-1] = -1;
            }
        }
    }
 
    int x = l[n][m] - 1;
    string ans(x + 1, ' ');
    for (int i = n-1, j = m-1 ; ; ) {
        if (k[i][j]==0) {
            ans[x--] = s[i];
            i--; j--;
        }
        else if (k[i][j]==1) {
            j--;
        }
        else i--;
        if (i<0 || j<0) break;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 70656
import java.util.InputMismatchException;
import java.util.Scanner;

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

		try {
			int n = sc.nextInt();

			int[] a = new int[n];

			for(int i = 0; i < a.length; i++) {
				a[i] = sc.nextInt();
			}

			disp(a);
			insertionSort(a);
		} catch(InputMismatchException ex) {
			ex.printStackTrace();
		} finally {
			sc.close();
		}
	}

	private static void insertionSort(int[] a) {
		for(int i = 1; i < a.length; i++) {
			int v = a[i];
			int j = i - 1;

			while(j >= 0 && a[j] > v) {
				a[j + 1] = a[j];

				j--;
			}

			a[j + 1] = v;

			disp(a);
		}
	}

	private static void disp(int[] a) {
		for(int i = 0; i < a.length - 1; i++) {
			System.out.print(a[i] + " ");
		}

		System.out.println(a[a.length - 1]);
	}
}



Measured memory_bytes: 32232
#include<stdio.h>

void QSort(long x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

  /* 配列の要素を交換する */
void Swap(long x[ ], int i, int j)
{
    int temp;

    temp = x[i];
    x[i] = x[j];
    x[j] = temp;
}

int main(){
  int n,i,cnt=0,flag=0,j;
  long a[100000];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%ld",&a[i]);
  QSort(a, 0, n - 1);
  for(i=0;i<n;i++){
    flag=1;
    for(j=1+i;j<n;j++){
      if(a[i]==a[j])
        flag=(1+flag)%2;
      else break;
    }
    cnt+=flag;
    i=j-1;
  }
  printf("%d\n",cnt);
}

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 'A';
  int z = 'Z';
  int m = s.size();
  for (char &c : s) {
    int d = c;
    d += n;
    if (d <= z) {
      c = d;
    }
    else {
      c = d - z + a - 1;
    }
  }
  cout << s << endl;
}


Measured memory_bytes: 256
/**
 * @author torith
 * @date 2019-02-05
 */

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int factor_count[100] = {};
int N;

ll count_fact(int a){
    ll rtn = 0;
    for (int i = 0; i < N; ++i) {
        if(a - 1 <= factor_count[i]) rtn++;
    }
    return rtn;
}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N;

    for (int i = 2; i < N + 1; ++i) {
        int base = i;
        for (int j = 2; j < i+1; ++j) {
            while(base % j == 0){
                factor_count[j] += 1;
                base /= j;
            }
        }
    }

    ll ans = count_fact(75) + count_fact(25) * (count_fact(3) - 1) +  count_fact(15) * (count_fact(5) - 1) + count_fact(5) * (count_fact(5) - 1) * (count_fact(3) - 2) / 2;
    cout << ans << "\n";

    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
   int x,y,i,temp=0;
   scanf("%d %d",&x,&y);
   for(i=0;i<=x*2;i=i+2){
       if((float)y/(2*x)*i==(float)((int)((float)y/(2*x)*i))){temp++;}
   }
   printf("%d\n",x+y+2-temp);
   return 0;
}



Measured memory_bytes: 2104
/*****************************************************
 				*	Logged in : HABIBUR RAHMAN						 *
				*	Dept	  : COMPUTER SCIENCE AND ENGINEERING	 *
				*													 *
				*	KHULNA UNIVERSITY OF ENGINEERING AND TECHNOLOGY  *
				******************************************************/


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<string> vs;
typedef pair<ll,ll> pll;
#define fast_io 			ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(v) 				v.begin(),v.end()
#define allr(v) 			v.rbegin(),v.rend()
#define rep(i,a,b) 			for(ll i=a;i<=b;i++)
#define rep0(i,n)			for(ll i=0;i<n;i++)
#define rrep0(i, n) 		for(ll i=(ll)(n);i>0;--i)
#define rrep(i, a, b) 		for(ll i=(ll)(a);i>=(ll)(b);--i)
#define pb(z) 				push_back(z)
#define ff					first
#define ss 					second
#define caset 				int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define sz(X) 				((ll)(X).size())
#define scan(X) 			scanf("%s", (X))
#define ms(v,val)			memset((v),(val),sizeof((v)))
#define ms0(X) 				memset((X), 0, sizeof((X)))
#define ms1(X) 				memset((X), -1, sizeof((X)))
#define m_p(a,b)            make_pair(a,b)
#define get_pos(c,x) 		(lower_bound(c.begin(),c.end(),x)-c.begin())
#define lcm(a,b)            (a*b)/__gcd(a,b)
#define INF9                1000000010
#define INF18               4000000000000000010
#define bpll(a)             __builtin_popcountll(a)
#define sqr(a)              ((a)*(a))
#define nl					"\n"
#define mod					1e9+7;
#define mx_el(v)			*max_element(all(v));
#define mn_el(v)			*min_element(all(v));
#define pcase(z,x)    		cout<<"Case "<<z<<": "<<x<<"\n"
const double pi = 2*acos(0) ;
#define display(v)			vi :: iterator it;for(it=(v).begin();it!=(v).end();it++){cout << *it << " " ;}cout << endl;
#define taking(n,v) 		for(ll i=0;i<(n);i++){ll inp;cin>>inp;(v).push_back(inp);}

void start(){
      #ifndef ONLINE_JUDGE 
      freopen("input.txt" , "r" , stdin) ;
      freopen("output.txt" , "w" , stdout) ;
      #endif
}
int lis(string &v){
	int n=sz(v),cnt=0;
	vector<int>dp(n,1);
	for(int i=0;i<n;i++){
		for(int j=0;j<i;j++){
			if(v[i]>v[j])dp[i]=max(dp[i],dp[j]+1);
		}
	}
	for(int i=0;i<n;i++){
		cnt=max(dp[i],cnt);
	}
	return cnt;
}
void solve()
{
 string s,t;cin>>s>>t;
 ll cnt=0;
 rep0(i,sz(s)){
 	if(s[i]!=t[i])cnt++;
 }
 cout << cnt << nl;
}

int main() {
	fast_io
	//start();
    //caset{
    	//cout << "Case " << tt << ": ";

		  solve();
	//}
	
	return 0;
}


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

typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ii, ii> iiii;
typedef pair <ll, iiii> lli4;

const ll lim = 10000000000000;
const int Maxn = 205;

ll ways[Maxn][Maxn];
ll C[Maxn][Maxn];
vector <lli4> seq;
vector <int> res;

ll Mult(ll x, ll y)
{
    if (x == 0 || y == 0) return 0;
    if (x <= lim / y) return x * y;
    return lim;
}

ll F(int n)
{
    ll res = 0;
    for (int i = 2; i <= n; i += 2)
        res = min(lim, res + C[n][i]);
    return res;
}

int main()
{
    for (int i = 0; i < Maxn; i++) {
        C[i][0] = C[i][i] = 1;
        for (int j = 1; j < i; j++)
            C[i][j] = min(lim, C[i - 1][j - 1] + C[i - 1][j]);
    }
    for (int i = 0; i < Maxn; i++)
        for (int j = 0; j < Maxn; j++)
            for (int k = 1; k <= i && k <= j; k++)
                ways[i][j] = min(lim, ways[i][j] + Mult(C[i][k], C[j][k]));
    ll sum = 0;
    for (int a1 = 1; a1 <= 25; a1++)
        for (int b1 = 1; b1 <= 25; b1++)
            for (int a2 = 1; a2 <= 25; a2++)
                for (int b2 = 1; b2 <= 25; b2++) {
                    ll my = min(lim, F(a1 + a2) + F(b1 + b2));
                    my = min(lim, my + Mult(ways[a1][a2], ways[b1][b2]));
                    if (my < lim)
                        seq.push_back(lli4(my, iiii(ii(a1, b1), ii(a2, b2))));
                }
    sort(seq.begin(), seq.end());
    ll n; scanf("%lld", &n);
    int pnt = 1;
    while (n > 0) {
        int ind = lower_bound(seq.begin(), seq.end(), lli4(n + 1, iiii(ii(0, 0), ii(0, 0)))) - seq.begin() - 1;
        if (ind >= 0) {
            int a1 = seq[ind].second.first.first, b1 = seq[ind].second.first.second;
            int a2 = seq[ind].second.second.first, b2 = seq[ind].second.second.second;
            for (int i = 0; i < a1; i++)
                res.push_back(pnt);
            for (int i = 0; i < b1; i++)
                res.push_back(pnt + 1);
            for (int i = 0; i < a2; i++)
                res.push_back(pnt);
            for (int i = 0; i < b2; i++)
                res.push_back(pnt + 1);
            pnt += 2;
            n -= seq[ind].first;
        } else break;
    }
    vector <ll> V;
    for (int i = 1; i <= 60; i++)
        V.push_back(F(i));
    while (n > 0) {
        int ind = upper_bound(V.begin(), V.end(), n) - V.begin() - 1;
        for (int i = 0; i <= ind; i++)
            res.push_back(pnt);
        n -= V[ind];
        pnt++;
    }
    //assert(res.size() <= 200);
    printf("%d\n", int(res.size()));
    for (int i = 0; i < res.size(); i++)
        printf("%d%c", res[i], i + 1 < res.size()? ' ': '\n');
    return 0;
}


Measured memory_bytes: 9072
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    int dp[n];
    dp[0]=0;
    dp[1]=abs(a[1]-a[0]);
    for(int i=2;i<n;i++){
        int x=dp[i-1]+abs(a[i]-a[i-1]);
        int y=dp[i-2]+abs(a[i]-a[i-2]);
        dp[i]=min(x,y);
    }
    cout<<dp[n-1];
}


Measured memory_bytes: 4372
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
struct wz
{
	int xh,rs;
} ;
wz a[N];
bool cmp(wz a,wz b)
{
	return a.rs<b.rs ;
}
int main()
{
	int n;
	while (cin>>n)
	{
		
		int t;
		for (int i=1;i<=n;i++)
		{
			cin>>t;
			a[i].xh=i;
			a[i].rs=t;
		}
		sort(a+1,a+n+1,cmp);
		for (int i=1;i<=n;i++)
		{
			if (i==1)
				cout<<a[i].xh ;
			else
				cout<<" "<<a[i].xh ;
		}	
		cout<<endl;
		
	}
    return 0;
}


Measured memory_bytes: 1536
#include <iostream>
#include <bits/stdc++.h>
#define lli long long int
const int mod=1e9+7;
using namespace std;

int main() 
{
//     int t;
//     cin>>t;
//     while(t--)
//     {
        int n,k;
        cin>>n>>k;
        lli A[n];
        for(int i=0;i<n;i++) cin>>A[i];
        sort(A,A+n);
        lli result=1;
        int initial=0;
        int end=n-1;
        if(A[n-1]<0&&k%2==1)
        {
            for(int i=0;i<k;i++) result=(result*A[n-1-i])%mod;
        }
        else
        {
            while(k)
            {
                if(k>1)
                {
                    if(A[initial]*A[initial+1]>A[end]*A[end-1])
                    {
                        result=(result*((A[initial]*A[initial+1])%mod))%mod;
                        k=k-2;
                        initial=initial+2;
                    }
                    else
                    {
                        result=(result*A[end])%mod;
                        k--;
                        end--;
                    }
                }
                else
                {
                    result=(result*A[end])%mod;
                    k--;
                    end--;
                }
            }
        }
        
        
        result = (result+mod)%mod;
      	cout << result <<"\n";
        
//    }
	return 0;
}


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

int main(){
    int N;
    cin >> N;
    double x = 0;
    double a[100];
    for (int n = 0; n < N; n++){
        cin >> a[n];
        x = x + (double) 1 / a[n];
    }
    cout << (double) 1 / x << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<memory.h>
using namespace std;
int a,b,c,n,i,j,p1,p2,po1,po2,col[100009],d1,d2,vi[100009];
vector<int>m[100009];
int count(int x){
	if(vi[x]==1){
		return 0;
	}
	int num=1;
	vi[x]=1;
	for(int i=0;i<m[x].size();i++){
		num+=count(m[x][i]);
	}
	return num;
	
}
int dfs(int x,int y,int parent){
	if(x==n){
//		cout<<y<<endl;
		if(y%2){
			return y/2;
		}else{
			return (y+1)/2;
		}
	}
	for(int i=0;i<m[x].size();i++){
		if(m[x][i]!=parent){
			int t=dfs(m[x][i],y+1,x);
			if(t>=0){
				if(t==y){
					d1=m[x][i];
					d2=x;
				}
				return t;
			}
		}
	}
	return -1;
}
int main(){
	cin>>n;
	for(i=1;i<n;i++){
		scanf("%d%d",&p1,&p2);
		m[p1].push_back(p2);
		m[p2].push_back(p1);
	}
	memset(col,-1,sizeof(col));
	col[1]=1;
	col[n]=0;
	dfs(1,0,1);
//	cout<<d1<<' '<<d2;
    for(i=0;i<m[d1].size();i++){
    	if(m[d1][i]==d2){
    		m[d1][i]=0;
    	}
    }
    for(i=0;i<m[d2].size();i++){
    	if(m[d2][i]==d1){
    		m[d2][i]=0;
    	}
    }
    memset(vi,0,sizeof(vi));
    vi[0]=1;
    
    if(count(1)>count(n)){
    	cout<<"Fennec"<<endl;                                   
    }else{
    	cout<<"Snuke"<<endl;
    }
    return 0;
}

Measured memory_bytes: 14336
//Only the Creator has given me strength!
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#include<bitset>
typedef long long ll;
#define pi 3.1415926535897931159979635
#define pb push_back
#define vctr vector < int >
#define vvtr vector < vctr >

using namespace std;
void fastio() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int main() {
    fastio();
    int t;
    cin>>t;
    if(t>=30) cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}

Measured memory_bytes: 3136