akhauriyash/Code-Regression huggingface dataset:
#pragma region include
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <set>
#pragma endregion
using namespace std;

#pragma region 定数
#define INF_VAL (2147483647 - 1)
#define INF_VAL_MINUS -INFVAL
#pragma endregion

#pragma region マクロ
// 配列の長さを取得する(ただし関数内ではポインタサイズに注意)
#define SIZE_OF_ARRAY(array) sizeof(array) / sizeof(*array)

// for文
#define forn(i, size) for (long long(i) = 0; (i) < (size); (i)++)
#define for0(size) for (long(i) = 0; (i) < (size); (i)++)

// ソート
#define Sort(array, length) sort(array, array + length)
#define SortDESC(array, length, type_name) sort(array, array + length, std::greater<type_name>())

// 配列の最大値、最小値取得
#define MAX_OF_ARRAY(array, length) *max_element(array, array + length)
#define MIN_OF_ARRAY(array, length) *min_element(array, array + length)

// 結果出力系
#define YES                    \
    {                          \
        cout << "YES" << endl; \
        return 0;              \
    }
#define NO                    \
    {                         \
        cout << "NO" << endl; \
        return 0;             \
    }
#define Yes                    \
    {                          \
        cout << "Yes" << endl; \
        return 0;              \
    }
#define No                    \
    {                         \
        cout << "No" << endl; \
        return 0;             \
    }
#pragma endregion

#pragma region Utility
#pragma region 配列要素の合計値を取得
template <typename T>
T getSum(T array[], int length)
{
    T sum = 0;
    for (int i = 0; i < length; i++)
    {
        sum += array[i];
    }
    return sum;
}
#pragma endregion

#pragma region ToString(int)
string ToString(int i)
{
    char buffer[1000];
    sprintf(buffer, "%d", i);
    return string(buffer);
}
#pragma endregion

#pragma region 10進数からN進数(<= 10) へ変換
string convertToN(long n, int base)
{
    string ans = "";
    while (n != 0)
    {
        int temp = n % base; // 1桁取得
        ans = ToString(temp) + ans;
        n /= base;
    }
    return ans;
}
#pragma endregion
#pragma endregion

int main()
{
    // 標準入力から値を取得
    string n;
    cin >> n;

    if (n == "AAA")
    {
        No
    }

    if (n[0] == 'A')
    {
        Yes
    }
    if (n[1] == 'A')
    {
        Yes
    }
    if (n[2] == 'A')
    {
        Yes
    }
    No

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
 
#define MAXX 200010
 
#define PI   3.14159265358979323846264338327950
 
#define PB push_back 
#define F first
#define S second
 
#define ll 	long long  int 
 
#define mod  1000000007


int main()
{
	FAST;
	ll n;
	cin >> n ;
	ll a[n+4];
	for(ll i = 0; i < n; i ++){
		cin >> a[i];
	}
	sort(a, a + n);
	ll x = 0;
	for(ll i = 0; i < n-1; i ++){
		x += a[i];
	}
	x += (a[n-1] / 2);
	cout << x;
	return 0;
}

Measured memory_bytes: 3640
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		E = new List<int>[N];
		for(int i=0;i<N;i++){
			E[i] = new List<int>();
		}
		Mp = new int[N][];
		for(int i=0;i<N;i++){
			Mp[i] = new int[N];
			for(int j=0;j<N;j++){
				Mp[i][j] = -1;
			}
		}
		
		for(int i=0;i<M;i++){
			E[A[i]].Add(B[i]);
			Mp[A[i]][B[i]] = i;
		}
		
		compo = new int[N];
		for(int i=0;i<N;i++) compo[i] = -1;
		L = null;
		
		int cmp = 0;
		for(int i=0;i<N;i++){
			if(compo[i] != -1) continue;
			cmp++;
			var a = new List<int>();
			a.Add(i);
			var hs = new HashSet<int>();
			hs.Add(i);
			compo[i] = cmp;
			
			dfs(cmp, a, hs);
		}
		if(L == null){
			Console.WriteLine(-1);
			return;
		}
		
		List<int> l = new List<int>(L);
		while(true){
			
			var di = new Dictionary<int, int>();
			for(int i=0;i<l.Count;i++){
				di.Add(l[i], l[(i + 1) % l.Count]);
			}
			int edx = -1;
			
			for(int i=0;i<M;i++){
				if(di.ContainsKey(A[i]) && di.ContainsKey(B[i])){
					if(di[A[i]] != B[i]){
						edx = i;
						break;
					}
				}
			}
			if(edx == -1){
				Console.WriteLine(l.Count);
				Console.WriteLine(String.Join("\n",l.Select(n => n + 1)));
				return;
			}
			
			di[A[edx]] = B[edx];
			var nl = new List<int>();
			nl.Add(A[edx]);
			nl.Add(B[edx]);
			while(true){
				int nxt = di[nl[nl.Count - 1]];
				if(nxt == nl[0]) break;
				nl.Add(nxt);
			}
			
			l = nl;
		}
		
	}
	
	int[][] Mp;
	List<int>[] E;
	List<int> L;
	int[] compo;
	void dfs(int cmp, List<int> a, HashSet<int> hs){
		if(L != null) return;
		int now = a[a.Count - 1];
		foreach(var nxt in E[now]){
			if(compo[nxt] == -1){
				a.Add(nxt);
				hs.Add(nxt);
				compo[nxt] = cmp;
				dfs(cmp, a, hs);
				a.RemoveAt(a.Count -1);
				hs.Remove(nxt);
			} else if(compo[nxt] == cmp){
				if(hs.Contains(nxt)){
					L = new List<int>();
					int idx = a.Count - 1;
					while(true){
						if(a[idx] != nxt){
							L.Add(a[idx]);
							idx--;
							continue;
						} else {
							L.Add(a[idx]);
							break;
						}
					}
					L.Reverse();
				}
				return;
			} else {
				return;
			}
		}
	}
	
	int N, M;
	int[] A,B;
	public Sol(){
		var d = ria();
		N = d[0]; M = d[1];
		A = new int[M];
		B = new int[M];
		for(int i=0;i<M;i++){
			d = ria();
			A[i] = d[0] - 1;
			B[i] = d[1] - 1;
		}
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 24540
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }
        static void Solve()
        {
            (long A, long B) = Slice2<long>();
            if (A == 1) A += 13;
            if (B == 1) B += 13;
            if (B < A) WriteLine("Alice");
            else if (A < B) WriteLine("Bob");
            else WriteLine("Draw");
        }
        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 27492
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;

const int MAXN = 50000 + 100;
const int MOD = 1000000000 + 7;

int n, m, k;
int d[MAXN], f[MAXN];

int fpow(int x, int p)
{
	int ret = 1;
	for(; p; p >>= 1, x = (long long)x * x % MOD)
		if(p & 1)
			ret = (long long)ret * x % MOD;
	return ret;
}

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

	cin >> n >> k;
	m = 0;
	for(int i = 1; i * i <= n; i++)
		if(n % i == 0)
		{
			d[++m] = i;
			if(i != n / i)
				d[++m] = n / i;
		}
	sort(d + 1, d + m + 1);
	for(int i = 1; i <= m; i++)
	{
		f[i] = fpow(k, (d[i] + 1) / 2);
		for(int j = 1; j <= i - 1; j++)
			if(d[i] % d[j] == 0)
				f[i] = (f[i] - f[j] + MOD) % MOD;
		// cerr << d[i] << ' ' << f[i] << endl;
	}
	int ans = 0;
	for(int i = 1; i <= m; i++)
		ans = (ans + (long long)d[i] * f[i] / (d[i] & 1 ? 1 : 2)) % MOD;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <utility>
#include <numeric>

using namespace std;

int main(){

    int N;
    cin >> N;
    vector<int> L(N);

    int l;
    for(int i = 0; i < N; i++){
        cin >> L[i];
    }
    sort(L.begin(), L.end());

    long long ans = 0;
    for(int i = 0; i < N; i++){
        for(int j = i + 1; j < N; j++){
            int temp = L[i] + L[j];

            auto itr = upper_bound(L.begin() + j + 1, L.end(), temp - 1);
            int cnt = itr - (L.begin() + j + 1);

            ans += cnt;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        W: usize,
        s: [[usize;2];n],
    }

    let mut dp: Vec<Vec<usize>> = vec![vec![0; W + 1]; n + 1];

    for i in 0..n {
        let vi = s[i][0];
        let wi = s[i][1];

        for w in 0..W + 1 {
            if w >= wi {
                dp[i + 1][w] = std::cmp::max(dp[i][w - wi] + vi, dp[i][w]);
            } else {
                dp[i + 1][w] = dp[i][w];
            }
        }
    }

    println!("{}", dp[n][W]);
}


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

int main(){
  int a,b;
  cin >> a >> b;

  if(a==1 && b==2){
    cout << 3 << endl;
  }

  if(a==1 && b==3){
    cout << 2 << endl;
  }

  if(a==2 && b==1){
    cout << 3 << endl;
  }  

  if(a==2 && b==3){
    cout << 1 << endl;
  }

  if(a==3 && b==1){
    cout << 2 << endl;
  }

  if(a==3 && b==2){
    cout << 1 << endl;
  }
}

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

int main() {
  int n,l; cin >> n >> l;
  vector<string>v(n);
  for(int i = 0; i<n; i++){
    cin >> v[i];
  }
  sort(v.begin(),v.end());
  for(int i = 0; i<n; i++){
    cout << v[i];
  }
  return 0;
}




Measured memory_bytes: 256
n = int(input())
#n = 10 ** 5
stones = [0 if x == "." else 1 for x in list(input())]
#stones = [0] + [0 for _ in range(n)] + [1]

bf = 0
af = n - sum(stones)
min_num = bf + af

for i in range(n):
	bf += stones[i]
	af -= 1 - stones[i]
	min_num = min(min_num, bf + af)

print(min_num)

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

int main() {
  string S, f, b, ans;
  cin >> S;
  f = S.substr(0, 2);
  b = S.substr(2, 2);
  if (f == "00" || atoi(f.c_str()) > 12) {
    if (b == "00" || atoi(b.c_str()) > 12) {
      ans = "NA";
    } else {
      ans = "YYMM";
    }
  } else if (atoi(f.c_str()) > 0  && atoi(f.c_str()) < 13) {
    if (b == "00" || atoi(b.c_str()) > 12) {
      ans = "MMYY";
    } else {
      ans = "AMBIGUOUS";
    }
  }

   cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int dfs(int n)
{
	if(n<0) return 0;
	if(n%4==0)
	return 1;
	if(n%7==0)
	return 1;
	return dfs(n-4);
	return 0;
}
int main()
{
	int n,m;
	while(cin>>n)
	{
		if(dfs(n))
		cout<<"Yes\n";
		else cout<<"No\n";
	}
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    def factorize(n):
        if n < 4:
            return [n]
        res = []
        i = 2
        while i**2 <= n:
            while n%i == 0:
                res.append(i)
                n //= i
            i += 1
        if n != 1:
            res.append(n)
        res.sort()
        return res
    n = I()
    f = factorize(n)
    print(n,end =": ")
    print(*f)
    return

#Solve
if __name__ == "__main__":
    solve()



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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=606;
const double EPS=1e-10;
int n,m,ind[MAXN];
vector<int>G1[MAXN],G2[MAXN];
double E[MAXN],P[MAXN];
int main() {
	n=read();m=read();
	for(int i=1,u,v;i<=m;++i)u=read(),v=read(),G1[u].pb(v),G2[v].pb(u);
	queue<int>q;E[n]=0;
	for(int i=1;i<=n;++i){ind[i]=G1[i].size();if(!ind[i])q.push(i);}assert(ind[n]==0);
	while(!q.empty()){
		int u=q.front();q.pop();
		if(G1[u].size())E[u]=E[u]/(double)G1[u].size()+1;
		for(int i=0;i<(int)G2[u].size();++i){
			int v=G2[u][i];
			E[v]+=E[u];
			ind[v]--;
			if(!ind[v])q.push(v);
		}
	}
	P[1]=1;assert(q.empty());
	for(int i=1;i<=n;++i){ind[i]=G2[i].size();if(!ind[i])q.push(i);}assert(ind[1]==0);
	while(!q.empty()){
		int u=q.front();q.pop();
		for(int i=0;i<(int)G1[u].size();++i){
			int v=G1[u][i];
			P[v]+=P[u]/(double)G1[u].size();
			ind[v]--;
			if(!ind[v])q.push(v);
		}
	}
//	E[n]=0;
//	for(int i=n-1;i>=1;--i){
//		for(int j=0;j<(int)G1[i].size();++j)E[i]+=E[G1[i][j]];
//		E[i]=E[i]/(double)G1[i].size()+1;
//	}
//	P[1]=1;
//	for(int i=1;i<n;++i){
//		for(int j=0;j<(int)G1[i].size();++j)P[G1[i][j]]+=P[i]/(double)G1[i].size();
//	}
	double ans=E[1];
	for(int i=1;i<n;++i){
		if((int)G1[i].size()==1)continue;
		double sumE=(E[i]-1)*(double)G1[i].size();
		for(int j=0;j<(int)G1[i].size();++j){
			ans=min(ans,E[1]-P[i]*(E[i]-((sumE-E[G1[i][j]])/((double)G1[i].size()-1)+1)));
		}
	}
	cout<<setiosflags(ios::fixed)<<setprecision(10)<<ans<<endl;
	return 0;
}

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define MAX_N 300'000
#define N_DIGIT 60
#define MOD 1'000'000'007

i64 n_one[N_DIGIT + 1][MAX_N + 1];

int main() {
    i64 n; cin >> n;
    vector<i64> A(n);
    REP(i, n) cin >> A[i];

    REP(d, N_DIGIT + 1) {
        n_one[d][0] = 0;
        REP(i, n) {
            n_one[d][i + 1] = n_one[d][i] + ((A[i] >> d) & 1);
        }
    }

    i64 ans = 0;
    REP(i, n - 1) {
        REP(d, N_DIGIT + 1) {
            i64 s_one = n_one[d][n] - n_one[d][i + 1];
            s_one %= MOD;
            if ((A[i] >> d) & 1) {
                i64 z = (n - i - 1) % MOD - s_one;
                if (z < 0) z += MOD;
                ans += z * (((i64)1 << d) % MOD);
            } else { 
                ans += s_one * (((i64)1 << d) % MOD);
            }
            ans %= MOD;
        }
    }
    cout << ans << endl;

    return 0;
}

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

typedef long long ll;
typedef long double lld;
using namespace std;

#define endl "\n"
#define fi first
#define se second
#define MEMS(a,b) memset(a,b,sizeof(a))
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define all(c) c.begin(),c.end()
#define pii pair<int, int>

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r)
{
	uniform_int_distribution<int> uid(l, r);
	return uid(rng);
}

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
ll l=v.size();for(ll i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template <typename T>
ostream &operator<<(ostream &out, set<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T>
ostream &operator<<(ostream &out, multiset<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T, typename V>
ostream &operator<<(ostream &out, map<T, V> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << "\n" << (i->first) <<  ":"  << (i->second);
    return out;
}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

#define int ll

int solve() {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] != t[i]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

int32_t main(){ _
    int t;
    // cin >> t;
    t = 1;
    while (t--) solve();
    return EXIT_SUCCESS;	
}


Measured memory_bytes: 3840
#include<iostream>
#include<vector>
#define N 101
using namespace std;
int n;
vector<int> D(N,1<<30);
//bool visited[N];
vector<bool> visited(N,0);
vector<int> pre(N,0);
vector<vector<int>> M(N,vector<int>(N,0));
//int M[N][N];

void dijkstra(){
    D[0]=0;
    pre[0]=-1;

    while(1){
        int minD=1<<30;
        int u=-1;
        for(int i=0;i<n;i++){
            if(visited[i]) continue;
            if(D[i]<minD){
                u=i;
                minD=D[i];
            }
        }
        if(u==-1) break;

        visited[u]=1;
        for(int i=0;i<n;i++){
            if(visited[i]) continue;
            if(M[u][i]>0 && D[i]>D[u]+M[u][i]){
                D[i]=D[u]+M[u][i];
                pre[i]=u;
            }
        }

    }
}

void init(){
    cin>>n;
    int u,k,c,v;
    for(int i=0;i<n;i++){
        /*for(int j=0;j<n;j++){
            M[i][j]=0;
        }*/
        visited[i]=false;
        cin>>u>>k;
        for(int j=0;j<k;j++){
            cin>>v>>c;
            M[u][v]=c;
        }
    }
}

int main(){
    init();
    /*for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cout<<M[i][j]<<' ';
        }
        cout<<endl;
    }*/
    dijkstra();
    for(int i=0;i<n;i++){
        cout<<i<<' '<<D[i]<<endl;
    }
    return 0;
}

/*
5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
*/



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

int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if( max(a,b)-min(a,b) <= d and max(b,c)-min(b,c) <= d){
    cout << "Yes" << endl;
  }
  else if( max(a,c)-min(a,c) <= d){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
def solve(cur, A, B, C):
    if cur == n:
        if min(A, B, C) > 0:
            return abs(A - a) + abs(B - b) + abs(C - c) - 30
        else:
            return 10 ** 9 + 7


    use_for_a = solve(cur + 1, A + l[cur], B, C) + 10
    use_for_b = solve(cur + 1, A, B + l[cur], C) + 10
    use_for_c = solve(cur + 1, A, B, C + l[cur]) + 10
    not_use = solve(cur + 1, A, B, C)

    return min(use_for_a, use_for_b, use_for_c, not_use)


n, a, b, c = map(int, input().split())
l = [int(input()) for i in range(n)]
print(solve(0, 0, 0, 0))


Measured memory_bytes: 43996
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;

int main() {
	int n, m, x;
  cin >> n >> m >> x;
  int c[n], a[n][m];
  rep (i, n) {
    cin >> c[i];
    rep (j, m) cin >> a[i][j];
  }

  ll ans = 10000000000000000;
  for (int bit = 0; bit < (1<<n); ++bit) {
    vector<ll> rikai(m, 0);
    ll sum = 0;
    rep (i, n) {
      if (bit & (1<<i)) {
        sum += c[i];
        rep (j, m) rikai[j] += a[i][j];
      }
    }

    bool ok = true;
    rep (j, m) if (rikai[j] < x) ok = false;
    if (ok) chmin(ans, sum);
  }

  cout << (ans == 10000000000000000 ? -1 : ans) << endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  int a = 700;
  
  for (int i = 0; i < 3; i++){
    if (S.at(i) == 'o')
      a += 100;
  }
  
  cout << a << endl;


}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
    int a1,a2,a3,b1,b2,b3,c1,c2,c3;
    int num;
    int k,n;
    int i=0;
    int x,y;
    int a=0;
    int bin=0;

    scanf("%d%d%d%d%d%d%d%d%d",&a1,&a2,&a3,&b1,&b2,&b3,&c1,&c2,&c3);
    int bingo[3][3]={{a1,a2,a3},{b1,b2,b3},{c1,c2,c3}};
    scanf("%d", &num);
    n=num;
    while(i<n){
        n=num;
        i++;
        scanf("%d",&k);

        for(x=0;x<3;x++){
            for(y=0;y<3;y++){
                if(bingo[x][y] == k)
                    bingo[x][y] = 0;
            }

        }



    }
    for(a=0;a<3;a++){
        if(bingo[0][0] == 0 && bingo[1][1] == 0 && bingo[2][2] == 0)
            bin=1;
        if(bingo[a][0] == 0 && bingo[a][1] == 0 && bingo[a][2] == 0)
            bin=1;
        if(bingo[0][a] == 0 && bingo[1][a] == 0 && bingo[2][a] == 0)
            bin=1;
        if(bingo[0][2] == 0 && bingo[1][1] == 0 && bingo[2][0] == 0)
            bin=1;
    }
    if(bin == 1)
        printf("Yes");
    else
        printf("No");
    return 0;

}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
deque<int> dq;
 
void fun(ll x){
	if(x == 1) return;
	int now;
	if(x&1LL){
		fun(x-1);
		now = dq.size() + 1;
		dq.push_front(now);
	}
	else{
		fun(x>>1);
		now = dq.size() + 1;
		dq.push_back(now);
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll i,n,k,j;
	cin >> n;
	fun(n+1);
	cout << dq.size() * 2 << endl;
	for(int x: dq) 
		cout << x << " " ;
	int cnt = 1;
	while(cnt <= dq.size()) 
		cout << cnt++ << " " ;
	cout << endl;
 	return 0;
} 

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int d[]={1,0,-1,0,1};

void solve(int w,int h){
    string s[h];
    rep(i,h)cin>>s[i];
    int sx,sy;
    rep(i,h)rep(j,w)if(s[i][j]=='@')sx=i,sy=j;
    queue<pair<int,int>> que;
    que.emplace(sx,sy);
    vector<vector<int>> used(h,vector<int>(w));
    used[sx][sy]=1;
    int ans=1;
    while(que.size()){
        int x=que.front().first,y=que.front().second;
        que.pop();
        rep(i,4){
            int nx=x+d[i],ny=y+d[i+1];
            if(nx<0||nx>=h||ny<0||ny>=w)continue;
            if(used[nx][ny]||s[nx][ny]=='#')continue;
            ++ans;
            used[nx][ny]=1;
            que.emplace(nx,ny);
        }
    }
    cout<<ans<<endl;
}


int main(){
    int n,m;
    while(cin>>n>>m,n!=0)solve(n,m);
    return 0;
}


Measured memory_bytes: 3068
s = int(input())
l = [s]
#listにappend・同じ数字あるか探す
while True:
  if s%2 == 0:
    s = s//2
    l.append(s)
  else:
    s = 3*s+1
    l.append(s)
  if l.count(s) == 2:
    break
    
print(len(l))

Measured memory_bytes: 2940
#include<stdio.h>

int main(void){
  double x1,y1,x2,y2,xq,yq;
  double xm,ym;
  double a1,b1,a2,b2;

  while(scanf("%lf,%lf,%lf,%lf,%lf,%lf ",&x1,&y1,&x2,&y2,&xq,&yq)!=EOF){

    if(x1==x2){
      xm = x1;
      ym = yq;
    }
    else if(y1==y2){
      xm = xq;
      ym = y1;
    }
    else{
      a1 = (y1-y2)/(x1-x2);
      a2 = -1.0 / a1;
      b1 = y1 - a1 * x1;
      b2 = yq - a2 * xq;

      xm = (b2-b1)/(a1-a2);
      ym = a1 * xm + b1;
    }

    printf("%lf %lf\n",2.0*xm - xq,2.0*ym - yq);
  }

  return 0;
}

Measured memory_bytes: 0
# -*- coding: utf-8 -*-
"""
Created on Mon Apr  8 14:51:17 2019

@author: adachi-lab
"""

input_code = []
y = []
for i in range(5):
    x = int(input())
    input_code.append(x)
    
k = int(input())

for q in range(4):
    y.append(input_code[-1]-input_code[q])
    
for w in range(3):
    y.append(input_code[-2]-input_code[w])
    
for j in range(2):
    y.append(input_code[-3]-input_code[j])
    
y.append(input_code[1]-input_code[0])


if max(y) > k:
    print(':(')
    
else:
    print('Yay!')

Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain, accumulate
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N,K = mis()
    A = lmis()
    for _ in range(K):
        l = [0]*(N+1)
        for i in range(N):
            a = A[i]
            l[max(0, i-a)] += 1
            l[min(N, i+a+1)] -= 1
        A = list(accumulate(l))[:-1]
        if all(a==N for a in A):
            break
    print(*A)

main()



Measured memory_bytes: 205752
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    int n;cin>>n;
    vector<pair<ll,pair<int,int>>> p(n);
    rep(i,n){
        ll h,x,y;cin>>x>>y>>h;
        p[i]={h,{x,y}};
    }
    sort(p.rbegin(),p.rend());
    rep(cx,101)rep(cy,101){
        ll H=-1;
        bool jud=true;
        rep(i,n){
            ll h=p[i].first,x=p[i].second.first,y=p[i].second.second;
            if(H==-1) H=h+abs(x-cx)+abs(y-cy);
            else{
                ll nh=H-abs(x-cx)-abs(y-cy);
                chmax(nh,(ll)0);
                if(h!=nh){
                    jud=false;
                    break;
                }
            }
        }
        if(jud){
            cout<<cx<<" "<<cy<<" "<<H<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<pi>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SORT(a) sort((a).begin(), (a).end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
    { cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}


double memo[301][301][301];
double f(int i, int j, int k, int n) {
    if(i + j + k == 0) return 0.0;
    if(memo[i][j][k] != 0.0) return memo[i][j][k];
    double s = i + j + k;
    double ret = n - s;
    if(i) ret += (f(i - 1, j, k, n) + 1) * i;
    if(j) ret += (f(i + 1, j - 1, k, n) + 1) * j;
    if(k) ret += (f(i, j + 1, k - 1, n) + 1) * k;
    ret /= s;
    memo[i][j][k] = ret;
    return ret;
}



int main(){
    int n, r, a = 0, b = 0, c = 0;
    cin >> n;
    rep(i, n) {
        cin >> r;
        if (r == 1) a ++;
        else if (r == 2) b ++;
        else c ++;
    }
    cout << fixed << setprecision(15) << f(a, b, c, n) << endl;
}



Measured memory_bytes: 111152
s=int(input())
dp=[0]*2005
dp[0]=1

dp[3]=1
dp[4]=1
dp[5]=1
mod=1e9+7
for i in range(6,2004):
    dp[i]=dp[i-1]+dp[i-3]
    dp[i]%=mod

print(int(dp[s]))

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

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int INF = int (1e9) + int (1e5);
const ll INFL = ll(2e18) + ll(1e10);
const ui MOD = 1E9 + 7;
const double EPS = 1e-9;
#define FOR(i,n) for (int i=0;i<(n);++i)
#define ROF(i,x) for(int i = (x) ; i >= 0 ; --i)
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ODD(x) ( ((x)&1)==0?0:1 )
#define SIGN(x) ( ((x) > 0) - ((x) < 0)  )
#define dbg(x) cerr << #x"= " << x << endl

std::mt19937_64  generator(std::chrono::system_clock::now().time_since_epoch().count());

inline ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a, ll b) { return a ? gcd(b%a, a): b; }
ll lcm(ll a, ll b) { return a / gcd(a,b) * b; }


void READ(bool _local){
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifdef _DEBUG
    if (_local)
        freopen ("in.txt", "r", stdin);
#endif
}

int main() {
    READ(0);
    ull x;cin>>x;
    ull yy=100;
    int n=0;
    while (yy < x){
        yy += yy/100;
        ++n;
    }
    cout << n;


    return 0;
}



Measured memory_bytes: 3660
#include <iostream>
using namespace std;
#define ll long long
#define rep(i, end) for(ll i=0; i<(ll)(end); i++)

int main(){
  ll n, count=0, maxi=0, last;
  cin >> n;
  ll h[100001] = {};
  rep(i, n){
    cin >> h[i];
  }
  rep(i, n){
    if (i != 0){
      if (h[i] <= last) count++;
      else {
        maxi = max(maxi, count);
        count = 0;
      }
    }
    last = h[i];
  }
  maxi = max(maxi, count);
  cout << maxi << endl;
 
  return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner scan  = new Scanner(System.in);
    String param  = scan.nextLine();
    String[] info = param.split(" ");

    long nbTown      = Long.parseLong(info[0]);
    long walkFatigue = Long.parseLong(info[1]);
    long teleFatigue = Long.parseLong(info[2]);

    String townInfo = scan.nextLine();
    String[] town = townInfo.split(" ");

    long fatigue = 0;

    for (int i = 1; i < nbTown; i++){

      long v = Long.parseLong(town[i]) - Long.parseLong(town[i-1]);

      if (walkFatigue * v < teleFatigue){
        fatigue += walkFatigue * v;
      }
      else{
        fatigue += teleFatigue;
      }
    }

    System.out.println(fatigue);

  }
}


Measured memory_bytes: 34332
import java.util.*;
 
class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int max = sc.nextInt();
    int t = sc.nextInt();
    
    double num = (double)n / (double)max;
    num = Math.ceil(num);
    System.out.print((int)num * t);
  }
}

Measured memory_bytes: 35640
import java.util.*;
import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int k = sc.nextInt();
		
		// 計算
		long result = 0;
		int MOD = 1000000007;
		long[] list = new long[k+1];
		for(int i = 1; i < k+1; i++){
		    list[i] = pow(k/i, n, MOD);
		}
		for(int i = k; i >= 1; i--){
		    int cnt = 2;
		    while(i*cnt <= k){
		        list[i] = list[i] + MOD - list[i*cnt];
		        list[i] %= MOD;
		        cnt++;
		    }
		}
		for(int i = 1; i < k+1; i++){
		    result += list[i]*i%MOD;
		    result %= MOD;
		}
		
		// 出力
		System.out.println(result);
	}
	
	public static long pow(long a, long n, long MOD) {
		long res=1;
		while (n>0) {
			if ((n-n/2*2)==1) {
				res=(res*a)%MOD;
			}
			a=(a*a)%MOD;
			n>>=1;
		}
		return res%MOD;
	}
}


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

#define ran 101101

int n, k;
char s[ran];

int main() {
	scanf("%d%d", &n, &k);
	scanf("%s", s);
	
	int ans = 0, chg = 0;
	for(int i=1;i<n;i++)
		if(s[i]==s[i-1]) ans++;
		else chg++;
	
	printf("%d\n", ans + min(chg, k*2));
	
	return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <cctype>
using namespace std;


int main(){
    char ch;

    while(1){
        scanf("%c", &ch);
        if (isalpha(ch)){
            if(islower(ch)) printf("%c", toupper(ch));
            else printf("%c", tolower(ch));
        }
        else printf("%c", ch);
        if (ch == '\n') break; 
    }



}



Measured memory_bytes: 2600
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]
 
for i in range(n) :
  C = []  #i行目のlist
  for j in range(l) :
    c = 0
    for k in range(m) :
      c += A[i][k] * B[k][j]
     
    C.append(str(c))
  print(" ".join(C))


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

int main(void) {
	int N, K;
	long long ans;
	ans = 0;
	cin >> N >> K;
	if (N > K) {
		vector<long long>H(N);
		for (int i = 0; i < N; i++) {
			cin >> H[i];
		}
		sort(H.begin(), H.end());
		for (int i = 0; i < N - K; i++) {
			ans += H[i];
		}
	}
	cout << ans << endl;
	
	return 0;
}



Measured memory_bytes: 1792
N, C, K = map(int, raw_input().split())
T = sorted([int(raw_input()) for i in xrange(N)])

ans = 0
c = C
bus_kita = 0
for i in xrange(N):
    if c == C:
        ans += 1
        c -= 1
        bus_kita = T[i]
    elif c == 0:
        ans += 1
        c = C-1
        bus_kita = T[i]
    elif T[i] - bus_kita > K:
        ans += 1
        c = C-1
        bus_kita = T[i]
    else:
        c -= 1
print ans


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

using namespace std;

#define REP(i, n)   for(int i = 0; i < (n); i++)
#define REPS(i, n)  for(int i = 1; i <= (n); i++)
#define RREP(i, n)  for(int i = (n)-1; i >= 0; i--)
#define RREPS(i, n) for(int i = (n); i > 0; i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define mt make_tuple
#define pb push_back

using ll  = long long;
using pi  = pair<int, int>;
using pl  = pair<ll, ll>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vs  = vector<string>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvl = vector<vl>;

const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const ll  INFL = 1e18;
const double PI = 3.141592653589793;
const double EPS = 1e-9;

template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false; }

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    string O, E; cin >> O >> E;
    REP(i, (int)O.length())
    {
        cout << O[i];
        if(i < (int)E.length()) cout << E[i];
    }
    cout << endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
using namespace std;

long long n, q;
static long long score[200001];
static int parent[200001];
static vector<int> children[200001];
static int depth[200001];

static long long a[200001];
static long long b[200001];
static queue<vector<long long>> edges;

void merge(long long a[], long long b[], int left, int mid, int right) {
	int n1 = mid - left;
	int n2 = right - mid;
	static long long l[500001];
	static long long l2[500001];
	static long long r[500001];
	static long long r2[500001];

	for (int i = 0; i <= n1 - 1; i++) {
		l[i] = a[left + i];
		l2[i] = b[left + i];
	}
	for (int i = 0; i <= n2 - 1; i++) {
		r[i] = a[mid + i];
		r2[i] = b[mid + i];
	}

	l[n1] = 1000000001;
	r[n2] = 1000000001;

	int i = 0;
	int j = 0;

	for (int k = left; k < right; k++) {
		if (l[i] <= r[j]) {
			a[k] = l[i];
			b[k] = l2[i];
			i++;
		}
		else {
			a[k] = r[j];
			b[k] = r2[j];
			j++;
		}
	}
}

void mergesort(long long a[], long long b[], int left, int right) {
	if (left + 1 < right) {
		int mid = (left + right) / 2;
		mergesort(a, b, left, mid);
		mergesort(a, b, mid, right);
		merge(a, b, left, mid, right);
	}
}

void cal(int s) {
	for (int i = 0; i < children[s].size(); i++) {
		score[children[s][i]] += score[s];
		cal(children[s][i]);
	}
}

int main() {
	cin >> n >> q;

	for (int i = 1; i <= n; i++) {
		score[i] = 0;
		parent[i] = 0;
		depth[i] = 0;
	}

	depth[1] = 1;

	for (int i = 0; i < n - 1; i++) {
		cin >> a[i] >> b[i];
	}

	mergesort(a, b, 0, n - 1);
	

	for (int i = 0; i < n - 1; i++) {

		if (depth[a[i]] > 0) {
			depth[b[i]] = depth[a[i]] + 1;
			parent[b[i]] = a[i];
			children[a[i]].push_back(b[i]);
		}
		else if (depth[b[i]] > 0) {
			depth[a[i]] = depth[b[i]] + 1;
			parent[a[i]] = b[i];
			children[b[i]].push_back(a[i]);
		}
		else {
			edges.push({ a[i],b[i] });
		}
	}

	while (!edges.empty()) {
		vector<long long> k;
		int x, y;

		k = edges.front();
		x = k[0];
		y = k[1];
		edges.pop();

		if (depth[x] > 0) {
			depth[y] = depth[x] + 1;
			parent[y] = x;
			children[x].push_back(y);
		}
		else if (depth[y] > 0) {
			depth[x] = depth[y] + 1;
			parent[x] = y;
			children[y].push_back(x);
		}
		else {
			edges.push({ x,y });
		}
	}
	
	for (int i = 0; i < q; i++) {
		int p, q;
		cin >> p >> q;
		score[p] += q;
	}

	cal(1);

	for (int i = 1; i <= n; i++) {
		if (i != n) {
			cout << score[i] << " ";
		}
		else {
			cout << score[i] << endl;
		}
	}
	
}

Measured memory_bytes: 42496
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

using P = pair<int, int>;
int main() {
    vector<int> a(3);
    for (int i = 0; i < 3; i++) {
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    for (int i = 0; i < 3; i++) {
        if (a[i] % 2 == 1) {
            cout << 0 << endl;
            return 0;
        }
    }

    if (a[0] == a[1] && a[1] && a[2]) {
        cout << -1 << endl;
        return 0;
    }

    int cnt1 = 0;
    int cnt2 = 0;
    int n = a[1] - a[0];
    int m = a[2] - a[1];
    while (n % 2 == 0) {
        cnt1++;
        n /= 2;
        if (n == 0) {
            cnt1 = INF;
            break;
        }
    }
    while (m % 2 == 0) {
        cnt2++;
        m /= 2;
        if (m == 0) {
            cnt2 = INF;
            break;
        }
    }
    cout << min(cnt1, cnt2) << endl;
}


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

vector<string> str;

int main(){
    int n, l;
    string name;

    cin >> n >> l;
    for(int i=0; i<n; i++){
        cin >> name;
        str.push_back(name);
    }
    sort(str.begin(),str.end());

    for(int i=0; i<n; i++){
        cout << str[i];
    }
    cout << endl;

    return 0;
}







Measured memory_bytes: 256
#pragma gcc optimize("Ofast")

#include "bits/stdc++.h"
using namespace std;
typedef int64_t lld;
typedef pair<int,int> pii;
typedef pair<lld,lld> pll;
typedef pair<int,pll> pip;
typedef pair<pll,int> ppi;
typedef pair<lld,pll> plp;
typedef pair<pll,lld> ppl;
typedef pair<pll,pll> ppp;
template<typename T>
using maxHeap = priority_queue<T,vector<T>,less<T>>;
template<typename T>
using minHeap = priority_queue<T,vector<T>,greater<T>>;
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define endl '\n'
#define jizz cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
inline void input(int &_x) {
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
inline void output(int _x) {
    char _buff[20]; int _f = 0;
    if(_x == 0)putchar('0');
    while(_x > 0)
    {
        _buff[_f++] = _x%10+'0';
        _x /= 10;
    }
    for(_f-=1; _f >= 0; _f--)
        putchar(_buff[_f]);
    putchar('\n');
}
template<typename Iter>
ostream& _out(ostream &s, Iter b, Iter e) {
    s<<"[";
    for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
    s<<"]";
    return s;
}
template<class T1,class T2>
ostream& operator<<(ostream& out, pair<T1,T2> p) {
    return out << '(' << p.first << ", " << p.second << ')';
}
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) {
     return _out(s,c.begin(),c.end());
 }
#ifdef erd1
    #define pprint(x) cerr<<__PRETTY_FUNCTION__<<":"<<__LINE__<<" - "<<(#x)<<"="<<(x)<<endl
#else
    #define pprint(x)
#endif

// code starts here

signed main(){
    int H, W, h, w;
    cin >> H >> W >> h >> w;
    cout << (W%w || H%h?"Yes":"No") << endl;
    if(W%w)
        for(int i = 0; i < H; i++){
            for(int j = 0; j < W; j++)
                cout << ((j+1)%w?2*W:-2*W*(w-1)-1) << " ";
            cout << endl;
        }
    else if(H%h)
        for(int i = 0; i < H; i++){
            for(int j = 0; j < W; j++)
                cout << ((i+1)%h?2*H:-2*H*(h-1)-1) << " ";
            cout << endl;
        }
}


Measured memory_bytes: 1408