akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define INIT    \
    cin.tie(0); \
    ios::sync_with_stdio(false);

template <class T>
inline bool chmax(T& a, T b) {
    return a = (a < b) ? b : a;
}
template <class T>
inline bool chmin(T& a, T b) {
    return a = (a > b) ? b : a;
}

ll const INF = 1LL << 60;
ll const MOD = 1000000007;

int main() {
    INIT;
    ll N;
    string S;
    cin >> N >> S;

    ll ans = 0;
    rep(i, 1000) {
        string str = "";
        if (i < 10) {
            str = "00" + to_string(i);
        } else if (10 <= i && i < 100) {
            str = "0" + to_string(i);
        } else
            str = to_string(i);

        // cout << str << ":";

        bool flg = true;
        int pos = S.find_first_of(str[0]);
        // cout << str[0] << ", " << pos << " ";
        if (pos == string::npos) {
            flg = false;
        }

        reps(j, 1, 3) {
            // cout << "->" << str[j] << ", ";
            pos = S.find(str[j], pos + 1);
            // cout << pos << ",";
            if (pos == string::npos) {
                flg = false;
                break;
            }
        }
        // cout << endl;

        if (flg) {
            ans++;
            // cout << str << endl;
        } else {
            continue;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

int64_t dijkstra(const vector<vector<int64_t>>& links,
                 vector<vector<bool>>& visited, int64_t idx, int64_t s,
                 int64_t t) {}

main() {
    int64_t n, m;
    cin >> n >> m;

    vector<vector<int64_t>> links(n);
    for (auto _ : irange(0L, m)) {
        int64_t u, v;
        cin >> u >> v;
        --u;
        --v;
        links[u].push_back(v);
    }

    int64_t s, t;
    cin >> s >> t;
    --s;
    --t;

    auto kInfinity = numeric_limits<int32_t>::max();

    list<pair<int64_t, int64_t>> q;
    vector<vector<int64_t>> cost(3, vector<int64_t>(n, kInfinity));

    q.emplace_back(0L, s);
    cost[0][s] = 0;
    while (!q.empty()) {
        auto current = q.front();
        q.pop_front();

        auto next_cost = cost[current.first][current.second] + 1;
        auto next_idx = (current.first + 1) % 3;
        for (auto v : links[current.second]) {
            if (cost[next_idx][v] < kInfinity) {
                // already visited
                continue;
            }

            if (next_idx == 0 && v == t) {
                cout << next_cost / 3 << endl;
                return 0;
            }

            cost[next_idx][v] = next_cost;
            q.emplace_back(next_idx, v);
        }
    }

    cout << -1 << endl;
}

Measured memory_bytes: 8832
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second

typedef pair<int,int> P;

int h,w;
vector<int> v[100];
int d[100][100];

int main(){
	while(1) {
		cin >> w >> h;

		if(w == 0)
			break;

		REP(i,100) {
			v[i].clear();
		}


		REP(i,2 * h - 1) {
			if(i % 2 == 0) {
				REP(j,w - 1) {
					v[i].pb(-1);
					v[i].pb(-1);
					cin >> *(v[i].end() - 1);
				}
				v[i].pb(-1);
			}else {
				REP(j,w) {
					v[i].pb(-1);
					cin >> *(v[i].end() - 1);
					v[i].pb(-1);
				}
			}
		}

		REP(i,h) {
			REP(j,w) {
				d[i][j] = -1;
			}
		}

		queue< P >  que;

		que.push(P(0,0));
		d[0][0] = 1;

		while(d[h - 1][w - 1] == -1 && !que.empty()) {
			P masu = que.front();
			que.pop();

			REP(i,4) {
				int x = masu.fi * 2 + dx[i],y = masu.sc * 2 + dy[i];
				if(0 <= x && x < 2 * h - 1 && 0 <= y && 2 * w - 1 && v[x][y] == 0) {
					x += dx[i];y += dy[i];
					if(d[x / 2][y / 2] > -1) {
						continue;
					}
					d[x / 2][y / 2] = d[masu.fi][masu.sc] + 1;
					que.push(P(x / 2,y / 2));
				}
			}
		}
		if(d[h - 1][w - 1] > -1) {
			cout << d[h - 1][w - 1] << endl;
		}else {
			cout << 0 << endl;
		}
		
	}
	return 0;
}



Measured memory_bytes: 3184
#include "bits/stdc++.h"

using namespace std;
using ll = long long int;
using ullong = unsigned long long;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define int ll
int INF = 1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
typedef pair<int, int> Vec2;
const int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };


signed main() {
	ios::sync_with_stdio(false);
	int a, b;
	cin >> a >> b;
	if (a > 9 or b > 9) cout << -1 << endl;
	else cout << a * b << endl;
	return 0;
}


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

rn = [0]*(N+1)
gn = [0]*(N+1)
bn = [0]*(N+1)

for i in range(N):
    rn[i+1] = rn[i]
    gn[i+1] = gn[i]
    bn[i+1] = bn[i]
    if S[i]=="R":
        rn[i+1] = rn[i]+1
    if S[i]=="G":
        gn[i+1] = gn[i]+1
    if S[i]=="B":
        bn[i+1] = bn[i]+1
   
ans = 0
for i in range(N):
    a = S[i]
    rem = "RGB".replace(a,"")
    for j in range(N-i):
        if (S[j+i] == a):
            continue
        b = S[j+i]
        rem2 = rem.replace(b,"")
        if rem2 == "R":
            ans += rn[N]-rn[j+i+1]
        if rem2 == "G":
            ans += gn[N]-gn[j+i+1]
        if rem2 == "B":
            ans += bn[N]-bn[j+i+1]
        if 0 <= j*2+i <= N-1:
          if S[j*2+i] == rem2 :
              ans -=1
            
print(ans)
        

Measured memory_bytes: 69108
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std; typedef long long ll; int an=0; const ll INF = 1e18; const ll MOD = 1e9+7;
typedef pair<int,int> P; const int xx[4]={1,-1,0,0}, yy[4]={0,0,1,-1}; struct tp{int x,y; ll cs;}; const int wd=1000001;

struct unf {
  vector<int> v,s; unf(int n){v.resize(n); s.resize(n); for(int i=0;i<n;i++) v[i]=i, s[i]=1;}
  int root(int x) { if (v[x]==x) return x; return v[x]=root(v[x]);}
  void unite(int x,int y) {int p=root(x), q=root(y); if (p==q) return; v[p]=q, s[q]=s[p]+s[q];}
  bool same(int x, int y) {return root(x)==root(y);}
  int sz(int k) {return s[root(k)];}
  void print() {for(int x:v) cout<<x<<" "; cout<<endl;}
  void print2() {for(int x:s) cout<<x<<" "; cout<<endl;}
};

int main(){
  int n,m; cin>>n>>m;
  unf u(n); ll a[m],b[m],an[m];
  for(int i=0;i<m;i++) {cin>>a[i]>>b[i]; a[i]--, b[i]--;}
  for(int i=m-1; i>=0; i--) {
    if (u.same(a[i],b[i])) an[i]=0;
    else {
      //cout<<u.sz(a[i])<<" "<<u.sz(b[i])<<endl;
      an[i] = u.sz(a[i]) * u.sz(b[i]);
      u.unite(a[i], b[i]);
    }
    //u.print();
    //cout<<"a"; u.print2();
  }
  for(int i=1;i<m;i++) {
    an[i] += an[i-1];
  }
  for(int i=0;i<m;i++) {
    cout<<an[i]<<endl;
  }
}

Measured memory_bytes: 4480
//#pragma region ALL(include define etc)
#include <iostream>   // swap(a, b)
#include <string>
#include <cmath>      // abs(絶対値) sin cos tan(角度 / 180.0 * 3.141592)
#include <vector>     // vec.push_back(a) vec.pop_back()
#include <algorithm>  // max(a, b) min(a, b) reverse() sort()
#include <functional> // sort(a, a + N, greater<型>());
#include <math.h>
#define int long long
#define ll long long
using namespace std;
//#pragma endregion

signed main()
{
	//int x;

	//int n;
	//int m;
	//string s;
	//string t;
	//int m1, m2;
	int a, b, c, k;

	//int k, d;
	int all = 0;
	//int a, b;

	bool flag = true;

	//string str;

	cin >> a >> b >> c >> k;
	//cin >> x;

	//a = s.length();

	for (int i = 0; i < k; i++)
	{
		if (a > i)
		{
			all++;
		}
		else if(a+b>i)
		{

		}
		else
		{
			all--;
		}
	}



	cout << all << "\n";

	/*if (flag == true)
	{
		cout << "Yes\n";
	}
	else
	{
		cout << "No\n";
	}*/
}

Measured memory_bytes: 3516
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  ll x, y;
  cin >> x >> y;
  int ans = 0;
  while (x <= y) {
    ans++;
    x *= 2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3592
ans=0
t=[]
tmp=10
for i in range(5):
    t.append(int(input()))
    if t[i]%10!=0 and t[i]%10<tmp:
        tmp=t[i]%10
#print(tmp)
flg=0
for i in range(5):
    if (t[i]%10!=tmp or flg==1) and t[i]%10==0:
        ans+=t[i]
    elif (t[i]%10!=tmp or flg==1) and t[i]%10!=0:
        ans+=(t[i]//10+1)*10
    elif t[i]%10==tmp and flg==0:
        ans+=t[i]
        flg=1
print(ans)


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

typedef long long LL;
const int MAXN = 100000 + 10;
int n, a[MAXN];
LL ans;

int main()
{
	cin >> n;	
	for(int i = 1; i <= n; i++) cin >> a[i];
	
	for(int i = 1; i <= n; i++)
	{
		if(a[i] % 2 == 1) //奇数 
		{
			if(a[i+1]) 
			{
				ans++;
				a[i]--; a[i+1]--;
			}
		}
	}
	
	for(int i = 1; i <= n; i++)
	{
		ans += a[i] / 2;
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 640
use std::io::{BufRead, Read};

pub struct Scanner<R>
where
    R: BufRead,
{
    reader: R,
}

impl<R> Scanner<R>
where
    R: BufRead,
{
    pub fn new(reader: R) -> Self {
        Scanner { reader: reader }
    }

    pub fn next<T>(&mut self) -> T
    where
        T: ::std::str::FromStr,
        <T as ::std::str::FromStr>::Err: ::std::fmt::Debug,
    {
        self.reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .unwrap()
    }
}

use std::collections::HashMap;

fn main() {
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let mut sc = Scanner::new(stdin);

    let n: i32 = sc.next();
    let mut h = HashMap::new();
    for _ in 0..n {
        let mut cv: Vec<char> = sc.next::<String>().chars().collect();
        cv.sort();
        let s: String = cv.into_iter().collect();
        *h.entry(s).or_insert(0) += 1;
    }

    let mut anagram: i64 = 0;
    for (_, v) in h {
        anagram += v * (v - 1) / 2;
    }
    println!("{}", anagram);
}


Measured memory_bytes: 15420
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]

a, b = LI()
print(a * b)

Measured memory_bytes: 9536
#include<stdio.h>
int main(void){
	int x1,x2,a;
	scanf("%d %d",&x1,&x2);
	if(x1>x2) a=x1-x2;
	if(x1<x2) a=x2-x1;
	if(x1==x2) a=0;
	printf("%d\n",a);
	return 0;
}


Measured memory_bytes: 2120
def attack(x, count):
  
  if x > 1:
    count += 1  # 分裂した回数を＋１
    x = int(x / 2)  # 小数点以下を切り捨て（Mathモジュールを使わないでやる方法）
    count = attack(x, count)  # 再帰的に呼び出す
  return count

h = int(input())
count = attack(h, 0) + 1
print(pow(2, count) - 1)

Measured memory_bytes: 2940
n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
    hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
    #p i
    ans =  (i[1] * (i[1] - 1)) / 2
    hash_2[i[0]] = ans
    #p ans
    count += ans
end
#p hash_2
a.each do |j|
    point = hash_2[j]
   # p point
  # puts "UU"
  # p j
    sa_1 = (hash[j] * (hash[j] - 1)) / 2
    #p sa_1
    sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
    #p sa_2
    count = count - sa_1 + sa_2
    puts count
    count = count + (sa_1 - sa_2)
    #puts count
    #puts "KKK"
end

Measured memory_bytes: 43884
import java.util.*;
public class Main{
  public static void main(String[] args){
       Scanner sc = new Scanner(System. in);
       int n = sc.nextInt();
       int x = 800 * n;
       int  y =200*( n / 15);
       int ans = x - y;
      System.out.println(ans);
  }
}

Measured memory_bytes: 22608
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

A, B = list(map(int, sys.stdin.buffer.readline().split()))

if B % A == 0:
    print(A + B)
else:
    print( B - A)


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

string S, T;

int main() {
    cin >> S;

    for(int i = 0; i < S.size(); i++) {
        if(S[i] == 'x') continue;
        T.push_back(S[i]);
    }

    for(int i = 0; i < T.size(); i++) {
        if(T[i] != T[ (int)T.size() - 1 - i ]) {
            printf("-1");
            return 0;
        }
    }

    int pos1 = 0, pos2 = (int)S.size() - 1;
    int cnt1 = 0;
    int cnt2 = 0;
    int ans = 0;
    while(1) {
        while(pos1 < S.size() && S[pos1] == 'x') {
            cnt1++;
            pos1++;
        }
        while(pos2 >= 0 && S[pos2] == 'x') {
            cnt2++;
            pos2--;
        }
        if(pos1 == pos2) {
            ans += abs(cnt1 - cnt2);
            break;
        }
        if(pos1 > pos2) break;
        ans += abs(cnt1 - cnt2);
        pos1++;
        pos2--;
        cnt1 = cnt2 = 0;
    }

    cout << ans;
}


Measured memory_bytes: 512
n = int(input())
count = 0

def prime(n):
    if n == 2:
        return True
    else:
        i = 2
        while i ** 2 <= n:
            if n % i == 0:
                return False
            i += 1
        return True
i = n
while not prime(i):
    i += 1
print(i)

Measured memory_bytes: 9120
#include<iostream>
#include<cstring>

using namespace std;

int main(){
  int n, h[109];
  memset(h, 0 ,sizeof(h));
  cin >> n;
  for(int i=0;i<n;i++)cin >> h[i];
  int cnt=0;
  while(1){
    bool finish=true;
    bool zero=true;
    for(int i=0;i<=n;i++){
      if(h[i]==0 && !zero){
        cnt++;
        zero=true;
      }
      else if(h[i]!=0){
        h[i]--;
        zero=false;
        finish = false;
      }
    }
    if(finish)break;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
'use strict'
//デバッグのためお借りしています。
var GET=(function(){
  function f(s){return new g(s);}
  function g(s){
    this._s=s.trim().split("\n");
    this._y=0;
  }
  g.prototype.a=function(f){
    var s=this._s, y=this._y, r;
    if(typeof s[y]==="string")
      s[y]=s[y].split(" ").reverse();
    r=s[y].pop();
    if(!s[y].length)
      this._y++;
    return f?r:+r;
  };
  g.prototype.l=function(f){
    var s=this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  };
  g.prototype.r=function(n,f){
    var r=this._s.slice(this._y,this._y+=n);
    return f?r:r.map(a=>+a);
  };
  return f;
})();

var o=new GET(require('fs').readFileSync('/dev/stdin','utf8'));

function main(){
  var a = o.a();
  var b = o.a();
  var q = o.a();
  var s = [-9e15].concat(o.r(a));
  var t = [-9e15].concat(o.r(b));
  var x = o.r(q);
  var x2 = Array(q);
  var xs = 0, xt = 0;
  var ans = Array(q);
  for(var i = 0; i < q; i++){
    x2[i] = [x[i], i];
  }
  x2.sort((a,b)=>a[0]-b[0]);
  for(i = 0; i < q; i++){
    var z = x2[i][0];
    var u = 9e99, v;
    while(xs <= a && s[xs] < z)xs++;
    while(xt <= b && t[xt] < z)xt++;
    if(xs > 1 && xt > 1){
      v = z - Math.min(s[xs-1], t[xt-1]);
      if(v < u)u = v;
    }
    if(xt > 1 && xs !== a+1){
      v = Math.min(z + s[xs] - 2 * t[xt-1], 2 * s[xs] - z - t[xt-1]);
      if(v < u)u = v;
    }
    if(xs !== a+1 && xt !== b+1){
      v = Math.max(s[xs], t[xt]) - z;
      if(v < u)u = v;  
    }
    if(xs > 1 && xt !== b+1){
      v = Math.min(z + t[xt] - 2 * s[xs-1], 2 * t[xt] - z - s[xs-1]);
      if(v < u)u = v;  
    }
    ans[x2[i][1]] = u;
  }
  return ans.join("\n");
}
var hisAns=main();
  console.log(hisAns);

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


def main():
    A, B = [int(_) for _ in input().split()]

    product = A * B
    for divisor in range(min([A, B]) // 2, 2, -1):
        if A % divisor == 0 and B % divisor == 0:
            A = A // divisor
            B = B // divisor
            product = product // divisor

    print(product)


def correct_1():
    A, B = [int(_) for _ in input().split()]

    for i in range(1, B + 1):
        if A * i % B == 0:
            print(A * i)
            break


def correct_2():
    A, B = [int(_) for _ in input().split()]

    def gcd(a, b):
        while b != 0:
            a, b = b, a % b
        return a

    def lcm(a, b):
        return a * b // gcd(a, b)

    print(lcm(A, B))


if __name__ == "__main__":
    correct_2()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define MAX 100005
#define MOD 1e9
#define pb push_back
#define pairs pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vii vector<pairs>
#define lb lower_bound
#define ub upper_bound
#define ll long long
#define endl '\n'
using namespace std;
/* ----------------------------------------------------------------------------------- */

#define fastInput ios_base::sync_with_stdio(false), cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define scan(a) scanf("%d", &a)
#define scanll(a) scanf("%lld", &a)
#define scanD(a) scanf("%lf", &a)
#define print(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printD(a) printf("%lf\n", a)
#define printTwo(a) printf("%.2lf\n", a);
#define read(x) freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
#define rep(i, a, n) for (int i = a; i < n; i++)
#define REP(i, a, n) for (int i = a; i <= n; i++)
#define inputArray(a,n) rep(i, 0, n) cin >> a[i];
#define copyArray(a,temp,n) rep(i, 0, n) temp[i]=a[i];
#define printArray(a,n) rep(i, 0, n) cout << a[i] << " "; cout << endl;

/* ----------------------------------------------------------------------------------- */

#define Cases  cout << "Case " << ++Case << ": ";
#define __test int tt; int Case=0; cin >> tt; while(tt--)
#define showTime cerr << "time = " << (clock() / CLOCKS_PER_SEC) << " sec" << '\n';

#define dbgA2(A, n, m) {cout<<"--> "<<#A<<" = \n";rep(i, 0, n){rep(j, 0, n){cout<<A[i][j]<<" ";}cout<<"\n";}cout<<"\n";}
#define dbgA(A, n) {cout<<" --> "<<#A<<" = (";rep(i, 0, n)cout<<A[i]<<" ";cout<<")\n";}
#define dbg(args...) {string sss(#args);sss+=',';cout<<" --> ";debugger::call(all(sss), args);cout<<"\n";}

/* ----------------------------------------------------------------------------------- */

ll gcd(ll n, ll m) { return m ? gcd(m, n % m) : n; }
ll lcm(ll n, ll m) { return n / gcd(n, m) * m; }

struct debugger {
	typedef string::iterator si;
	static void call(si it, si ed) {}
	template<typename T, typename ... aT>
	static void call(si it, si ed, T a, aT... rest) {
		string b;
		for(; *it!=','; ++it)
			if(*it!=' ')
				b+=*it;
		cout << b << "=" << a << " ";
		call(++it, ed, rest...);
	}
};

/* ----------------------------------------------------------------------------------- */


void solve() {
	string a, b;
	int count = 0;
	cin >> a >> b;
	for (int i = 0; i < a.length(); i++) {
		if(a[i] != b[i]) {
			count++;
		}
	}
	print(count);
}

int main() {
#ifdef Niloy
	read("input.txt");
	write("output.txt");
#endif

	solve();

	// __test {
	// 	solve();
	// }

	showTime;
	return 0;
}




Measured memory_bytes: 3868
// aribon2-5-4_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;


template<typename T>
struct BellmanFord{
    struct edge {
        int u, v;
        T w;
        edge() {}
        edge(int u, int v, T w) : u(u), v(v), w(w) {}
        friend ostream& operator<<(ostream& os, const edge& e) {cout << "(" << e.u << "->" << e.v << "," << e.w << ")"; return os;}
    };

    int n;
    vector< vector<int> > G;
    vector<int> used;
    vector<edge> edges;
    vector<T> ds;
    T INF;

    explicit BellmanFord(int n) : n(n), G(n), used(n, 0) { INF = numeric_limits<T>::max(); }

    void add_edge(int u, int v, T c) {
        edges.emplace_back(u, v, c);
        G[u].emplace_back(v);
    }

    T get_shortest_path(int s, int t, bool &neg_loop){
        ds.assign(n, INF);
        ds[s] = 0;

        for (int j = 0; j < n; j++) {
            bool update = false;
            for (auto e:edges) {
                if (ds[e.u] == INF) continue;

                if (ds[e.u] + e.w < ds[e.v]) {
                    ds[e.v] = ds[e.u] + e.w;
                    update = true;
                }
            }

            if (!update) break;

            if (j == n - 1) {
                neg_loop = true;
                return INF;
            }
        }
        neg_loop = false;
        return ds[t];
    }
};


int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int N, M, S;
    cin >> N >> M >> S;

    BellmanFord<ll> g(N);
    REP(i, M){
        int s, t, d;
        cin >> s >> t >> d;
        g.add_edge(s, t, d);
    }

    bool negloop;
    g.get_shortest_path(S, N-1, negloop);

    if (negloop){
        print("NEGATIVE CYCLE");
    } else {
        REP(i, N){
            ll d = g.ds[i];
            if (d == g.INF) {
                print("INF");
            } else {
                print(d);
            }
        }
    }


    return 0;
}



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


int main() {
  int N, M;
  cin >> N >> M;

  if(N >= M) {
    cout << 0 << endl;
    return 0;
  }

  vector<int> target(M);
  vector<int> d(M-1);
  for(int i = 0; i < M; i++) {
    cin >> target.at(i);
  }

  sort(target.begin(), target.end());

  for(int i = 0; i < M-1; i++) {
    d.at(i) = target.at(i+1) - target.at(i);
  }

  sort(d.begin(), d.end(), greater<int>());

  int subSum = 0;
  for(int i = 0; i < N-1; i++) {
    subSum += d.at(i);
  }

  cout << target.at(M-1) - target.at(0) - subSum << endl;

}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;

string k;
int d;
ll dp[200000][110][2]={0};
vector<ll> t10;

int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}

void solve(){
    cin >> k >> d;
    int n=k.length();
    dp[0][0][1]=1;
    rep(i,n){
        rep(r,d){
            int m=ctoi(k[i]);
            //cout << i << "," << r << "," << 0 << " " << dp[i][r][0] << endl;
            //cout << i << "," << r << "," << 1 << " " << dp[i][r][1] << endl;
            rep(l,10){
                dp[i+1][(r+l)%d][0]+=dp[i][r][0];
            }
            rep(l,m){
                dp[i+1][(r+l)%d][0]+=dp[i][r][1];
            }
            dp[i+1][(r+m)%d][1]+=dp[i][r][1];
            dp[i+1][r][0]%=mod;
            dp[i+1][r][1]%=mod;
            
        }
    }

    // rep(r,d){
    //     cout << n << "," << r << "," << 0 << " " << dp[n][r][0] << endl;
    //     cout << n << "," << r << "," << 1 << " " << dp[n][r][1] << endl;
    // }
    cout << (dp[n][0][0]+dp[n][0][1]-1)%mod << endl;

}

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

Measured memory_bytes: 18816
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
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;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}

vector<ll> pw2(51,1);vector<ll> pw10(19,1);
int main(){
    {rep1(i,50) pw2[i]=2*pw2[i-1];}
    {rep1(i,18) pw10[i]=10*pw10[i-1];}
    
    ll N; cin>>N;
    ll ans=0;
    vector<ll> A(N,0);
    rep(i,N) cin>>A[i];
    sort(all(A),greater<ll>());
    ans+=A[0];
    ll tmp=(N-2)/2;
    ll anstmp=0;
    rep1(i,tmp){
        anstmp+=A[i];
    }
    ans+=anstmp*2;
    if((N-2)%2==1){
        ans+=A[tmp+1];
    }
    cout<<ans;
}



Measured memory_bytes: 4828
#include <bits/stdc++.h>
#define kyopro ios::sync_with_stdio(false);cin.tie(NULL)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> multi_vector(size_t a){return vector<T>(a);}template<class T, class... Ts>auto multi_vector(size_t a, Ts... ts){return vector<decltype(multi_vector<T>(ts...))>(a, multi_vector<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}/* 重み付きUnionFind */struct WUnionFind {vector<int> par;vector<int> rank;WUnionFind(int n = 1) {init(n);}void init(int n = 1) {par.resize(n); rank.resize(n);for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}int root(int x) {if (par[x] == x) {return x;}else {int r = root(par[x]);return par[x] = r;}}bool issame(int x, int y) {return root(x) == root(y);}bool merge(int x, int y) {x = root(x); y = root(y);if (x == y) return false;if (rank[x] < rank[y]) swap(x, y);if (rank[x] == rank[y]) ++rank[x];par[y] = x;return true;}};

/* ここからコード開始 */

int main(){
  kyopro;
  ll s;
  cin >> s;
  set<ll> exist;
  ll ans{};
  while(true){
    ans++;
    if(exist.find(s) != exist.end()) break;
    exist.insert(s);
    s = s%2 ? 3*s+1 : s/2;
  }
  cout << ans;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc108/tasks/arc102_a

#include <bits/stdc++.h>
#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++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;

ll N, K, a, b, cnt;
int main()
{
  cin >> N >> K;

  a = N / K;
  b = K % 2 ? 0 : (N + K / 2) / K;
  cnt = a * a * a + b * b * b;
  cout << cnt << '\n';

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int N,i;
	//char x;
	scanf("%d",&N);
	char number[N];
	int count=0;
	getchar();
	for(i=0;i<N;i++){
		scanf("%c",&number[i]);
		if(i==0 || number[i]!=number[i-1] ) {
			count++;
		}
	}
	printf("%d",count);
	return 0;
 }


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

long long int N, M, a, b, i, j, bit[524289];
vector<tuple<long long int, long long int, long long int> > s;

int main(){
    scanf("%lld%lld", &N, &M);
    for(; ++i <= N;){
        scanf("%lld%lld", &a, &b);
        s.push_back(make_tuple(b - a + 1, a, i));
    }
    sort(s.begin(), s.end(), greater<tuple<long long int, long long int, long long int> >());
    auto be = s.end(), it = s.end(), en = s.end();
    for(i = 1; i <= M; ++i, en = be, be = upper_bound(s.begin(), s.end(), make_tuple(i, 0, 0), greater<tuple<long long int, long long int, long long int> >()), it = be){
        for(; it != en; ++it){
            a = get<1>(*it);
            b = a + get<0>(*it);
            for(; b <= M + 1; b += (b & -b)){
                --bit[b];
            }
            for(; a <= M + 1; a += (a & -a)){
                ++bit[a];
            }
        }
        a = be - s.begin();
        for(j = i; j <= M; j += i){
            for(int k = j; k; k &= k - 1){
                a += bit[k];
            }
        }
        cout << a << endl;
    }
    return 0;
}


Measured memory_bytes: 12652
#include <stdio.h>
#include <iostream>
using namespace std;
// node最大量
#define MAX 100005
#define NIL -1

struct Node {
    int parent;
    int leaf;
    int root;
};

// 配列で保持する
Node gNode[MAX];
int n,gDepth[MAX];

void print(int node){
    cout << "node " << node << ": ";
    cout << "parent = " << gNode[node].parent << ", ";
    cout << "depth = " << gDepth[node] << ", ";
    
    if(gNode[node].parent == NIL) cout << "root, ";
    else if(gNode[node].leaf == NIL)cout << "leaf, ";
    else cout << "internal node, ";
    
    cout << "[";
    
    for(int i = 0,leaf = gNode[node].leaf;leaf != NIL;++i,leaf = gNode[leaf].root){
        if(i) cout << ", ";
        cout << leaf;
    }
    cout << "]" << endl;
}

// 再帰的に深さを求める
void rec(int node ,int parent){
    gDepth[node] = parent;
    if(gNode[node].root != NIL){
        // 右の兄弟に同じ深さを設定
        rec(gNode[node].root,parent);
    }
    if(gNode[node].leaf != NIL){
        // 最も左の子に自分の深さ+1を設定
        rec(gNode[node].leaf,parent + 1);
    }
}

int main(){
    int nodeNum,nodeIndex,node,l,root;
    cin >> n;
    // 初期化
    for(int i = 0;i < n;++i){
        gNode[i].parent = gNode[i].leaf = gNode[i].root = NIL;
    }
    
    for(int i = 0;i < n;++i){
        cin >> nodeIndex >> nodeNum;
        for(int j = 0;j < nodeNum;++j){
            cin >> node;
            if(j == 0){
                gNode[nodeIndex].leaf = node;
            }
            else{
                gNode[l].root = node;
            }
            l = node;
            gNode[node].parent = nodeIndex;
        }
    }
    
    // rootを探す
    for(int i = 0;i < n;++i){
        if(gNode[i].parent == NIL){
            root = i;
        }
    }
    
    rec(root,0);
    
    for(int i = 0;i < n;++i){
        print(i);
    }
    return 0;
}


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

void Main()
{
    long a, b, k;
    cin >> a >> b >> k;
    if (a >= k) {
        cout << a-k << " " << b << endl;
    } else {
        cout << "0 " << max(b - (k-a), 0L) << endl;
    }
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}


Measured memory_bytes: 3660
import math
import sys
import os
from operator import mul
import bisect

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

N = I()
S = list(_S())
ans = 0

r = []
g = []
b = []

for i,s in enumerate(S):
    if s == 'R':
        r.append(i)
    if s == 'G':
        g.append(i)
    if s == 'B':
        b.append(i)

# j = bisect.bisect_right(<list>,<value>)
# print(r)
# print(g)
# print(b)

# for i in r:
#     for j in g:
#         for k in b:
#             tmp = sorted([i,j,k])
#             if not tmp[1]-tmp[0]==tmp[2]-tmp[1]:
#                 ans += 1

ans = len(r)*len(g)*len(b)

for i in range(N):
    for j in range(i,N):
        k = j + (j-i)
        if k > N-1:
            break
        if S[i]==S[j]:
            continue
        if S[i]==S[k] or S[j]==S[k]:
            continue
        ans -= 1

print(ans)

# R G B
# R B G
# G B R
# G R B
# B G R
# B R G

# i   j   k
#  - != -

# RBRBGRBGGB
# 1122233333
# 0000111233
# 0112223334

# B*3
# G*4

# GB系: (2,4), (4,5)
# RB系: (1,3),

Measured memory_bytes: 73312
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void main()
{
    long a,b;
    scan(a,b);
    auto dice = new double[](a);
    foreach(i,ref e; dice)
    {
        e = pow(0.5, need_front(i + 1, b));
    }
    writefln("%.12s",(dice.sum() / a));
}

long need_front(long point, long last)
{
    long need;
    while(point < last)
    {
        point *= 2;
        need++;
    }
    return need;
}

Measured memory_bytes: 2556
#include<bits/stdc++.h>
using namespace std;
int main(){
string S,T;
  cin>>S>>T;
  int A,B;
  cin>>A>>B;
  string U;
  cin>>U;
  if(S==U) A--;
  if(T==U) B--;
  cout<<A<<" "<<B<<endl;
return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		double th[] = new double[1001];
		double r[] = new double[1001];
		r[1] = 1;
		th[1] = 0;
		for (int i = 1; i < 1000; i++) {
			r[i + 1] = Math.sqrt(r[i] * r[i] + 1);
			th[i + 1] = th[i] + Math.atan(1.0 / r[i]);
		}
		while (true) {
			int n = sc.nextInt();
			if (n == -1)
				break;
			System.out.printf("%.2f\n", r[n] * Math.cos(th[n]));
			System.out.printf("%.2f\n", r[n] * Math.sin(th[n]));
		}
	}
}

Measured memory_bytes: 11000
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		/*
		 * すぬけくん行きつけのレストランは何を食べても 1 食 800 円で、15 食食べる毎にその場で 200 円もらえます。

すぬけくんは今までで合計 N 食食べました。 今までに払った金額を x 円、レストランからもらった金額を y 円として、x−y を求めなさい。
		 */

		int y = n / 15 * 200;
		int x = n * 800;
		System.out.println(x - y);

	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define LL long long
using namespace std;

const int maxn = 105;
int l, k;
LL dp[maxn][2];

int main()
{
    scanf("%d%d", &l, &k);
    dp[0][1] = 1;

    for(int i = 1; i <= l; i ++) {
        dp[i][0] += dp[i - 1][1];
        if(i >= k)
            dp[i][0] += dp[i - k][1];

        dp[i][1] += dp[i - 1][0];
    }

    LL ans = 0;
    for(int i = 1; i <= l; i ++)
        ans += dp[i][0];
    printf("%lld\n", ans);
    return 0;
}



Measured memory_bytes: 3228
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
from operator import xor
from functools import reduce

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)
    A = list(it)
    x1 = reduce(xor, A)

    print(*map(lambda x: x ^ x1, A))


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 112908
#include<bits/stdc++.h>
#define int long long 
using namespace std;
const int MAXN = 1e5 + 10;
int n;
int a[1001][1001], b[1001][1001],c[1001][1001],vis[MAXN], prime[MAXN], tot;
void GetPhi() {
	vis[1] = 1;
	for(int i = 2; i; i++) {
		if(!vis[i]) prime[++tot] = i;
		if(tot == 1000) break; 
		for(int j = 1; j <= tot && (i * prime[j] <= 10000); j++) {
			vis[i * prime[j]] = 1;
			if(!(i % prime[j])) break;
		}
	}
}
int lcm(int x, int y) {
	if(x == 0 || y == 0) return x + y;
	return x / __gcd(x, y) * y;
}
main() {
	GetPhi();
	cin >> n;
	if(n == 2) {
		printf("4 7\n23 10");
		return 0;
	}
	for (int i=1;i<=n;i++)
	{
		if (i%2==1)
		{
			int x=1;int y=i;
			while (x<=n && y<=n)
			{
				b[x][y]=prime[i];
				x++;y++;
			}
			if (i==1) continue;
			x=i;y=1;
			while (x<=n && y<=n)
			{
				b[x][y]=prime[i-1];
				x++;y++;
			}
		}
	}
	for (int i=n;i>=1;i--)
	{
		if (i%2==1)
		{
			int x=1;int y=i;
			while (x<=n && y>=1)
			{
				c[x][y]=prime[n+n-i+1];
				x++;y--;
			}
			if (i==n) continue;
			if (n%2==0) x=n-i+1;
			else x=n-i+1;y=n;
			while (x<=n && y>=1)
			{
				c[x][y]=prime[n+n-i];
				x++;y--;
			}
		}
	}
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=n;j++)
		{
//			if(!((i + j) & 1)) ans[i][j] = zs[(i + j) / 2] * zs[n + (i - j) / 2 + (n + 1) / 2];
			if ((i+j)%2==0)
			{
				a[i][j]=b[i][j]*c[i][j];
			}
		}
	}
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
			if(!a[i][j]) 
				a[i][j] = lcm(lcm(a[i - 1][j], a[i][j - 1]), lcm(a[i][j + 1], a[i + 1][j])) + 1;
	for(int i = 1; i <= n; i++, puts(""))
		for(int j = 1; j <= n; j++)
			cout << a[i][j] << " ";
	return 0;
}

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

using namespace std;

using ll = long long int;

#define REP(i, N) for (int i = 0; i < (N); ++i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    constexpr int M = 55555;
    set<int> prime;
    vector<int> prime_v;
    {
        vector<char> flag(M, true);
        flag[1 - 1] = false;
        REP(i, M){
            if (flag[i]){
                const int p = i + 1;
                prime.emplace(p);
                prime_v.emplace_back(p);
                for (int n = p * 2; n <= M; n += p){
                    flag[n - 1] = false;
                }
            }
        }
    }

    // for (auto& p : prime_v){
    //     if (55555 < p) break;
    //     cout << p << " ";
    // }
    // cout << endl;

    scanInt(N);
    vector<int> result(N);
    {
        auto it = prime_v.begin();
        int i = 0;
        while (i < N){
            auto& p = *it;
            if (p % 5 != 1){
                ++it;
                continue;
            }
            result[i] = p;
            ++it;
            ++i;
        }
    }
    for (auto& p : result){
        cout << p << " ";
    }
    cout << endl;
}


Measured memory_bytes: 640
# クエリが複数回与えられて、毎回のクエリに対する回答をする必要がある
# という時点で累積和を意識するべきだった……

# 競技中に一瞬思いついたが、10万の配列を作ったときにメモリが足りるかを懸念して避けてしまった
# 10万くらいなら余裕で足りるよ

# printしてみた配列の大きさ：
# 提出時の表示： 実行時間とメモリ 878 ms	6104 KB https://atcoder.jp/contests/abc122/submissions/4758777

N,Q =  map(int, input().split())
S = input()

cumsum = [0] * N
# cumsum[i] := (0-indexで)0文字目からi文字目までに含まれる部分列"AC"の個数
# (0-indexで)l文字目からr文字目までに含まれる部分列"AC"の個数は、cumsum[r] -cumsum[l]である
# l-1文字目とl文字目が"AC"になるケースも除外したいので、cumsum[l]を引くこと

summ = 0
for i in range(1,N):
	if S[i-1] == "A" and S[i] == "C":
		summ +=1
	cumsum[i] = summ

for _ in range(Q):
	left, right = map(int, input().split())
	left -= 1 # 1-indexから0-indexに変更する
	right -= 1
	print(cumsum[right] - cumsum[left])



Measured memory_bytes: 6084
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int a = sc.nextInt();
        if(h % a != 0){
            System.out.println(h/a+1);
        }else{
            System.out.println(h/a);
        }
    }
}

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

using namespace std;

#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define fst first
#define snd second
#define SZ(u) ((int) (u).size())
#define ALL(u) (u).begin(), (u).end()

inline void proc_status()
{
	ifstream t("/proc/self/status");
	cerr << string(istreambuf_iterator<char>(t), istreambuf_iterator<char>()) << endl;
}

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline T read()
{
	register T sum(0), fg(1);
	register char ch(getchar());
	for(; !isdigit(ch); ch = getchar()) if(ch == '-') fg = -1;
	for(;  isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + (ch ^ '0');
	return sum * fg;
}

typedef long long LL;
typedef pair<int, int> pii;

const int MAXN = (int) 2e5;

// Template-Libs

// END

int h, w, n;

vector<int> mn[MAXN + 5];
unordered_set<int> a[MAXN + 5];

inline void input()
{
	h = read<int>(), w = read<int>(), n = read<int>();
	for(int i = 1; i <= w; ++i) mn[i].push_back(h + 1);
	while(n--)
	{
		int x = read<int>(), y = read<int>();
		mn[y].push_back(x);
		a[x].insert(y);
	}
}

inline void solve()
{
	int x = 1, y = 1, ans = h;
	while(x <= h && y <= w)
	{
		sort(ALL(mn[y]), greater<int>());
		while(mn[y].back() < x) mn[y].pop_back();
		chkmin(ans, mn[y].back() - 1 - x + x);
		if(x == h || a[x + 1].find(y) != a[x + 1].end()) break; else ++x;
		if(y < w && a[x].find(y + 1) == a[x].end()) ++y;
	}
	printf("%d\n", ans);
}

int main()
{
	input();
	solve();

	return 0;
}



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

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

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

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



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



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

LL ans = 0LL;

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

	VL lsum(100);
	VL lPsum(100);
	lsum[0] = 1;
	lPsum[0] = 1;
	FOR(i, 1, 51) {
		lsum[i] = 1 + lsum[i - 1] + 1 + lsum[i - 1] + 1;
		lPsum[i] = 0 + lPsum[i - 1] + 1 + lPsum[i - 1] + 0;
	}
	LL N, X; cin >> N >> X;
	function<LL(int, LL)> dfs = [&](int LV, LL leftX) {
		DD(de(LV));
		LL Pcnt = 0;
		if (leftX > 0) {// B
			leftX--;
		}
		if (leftX > 0) { // block
			if (leftX >= lsum[LV-1]) {
				Pcnt += lPsum[LV-1];
				DD(de(leftX));
				leftX -= lsum[LV-1];
				DD(de(leftX));
			}
			else {
				Pcnt += dfs(LV - 1, leftX);
				leftX = 0;
			}
		}
		if (leftX > 0) { // P
			Pcnt++;
			leftX--;
		}
		if (leftX > 0) { // block
			if (leftX >= lsum[LV-1]) {
				Pcnt += lPsum[LV-1];
				leftX -= lsum[LV-1];
			}
			else {
				Pcnt += dfs(LV - 1, leftX);
				leftX = 0;
			}
		}
		if (leftX > 0) {// B
			leftX--;
		}

		DD(de(LV, Pcnt));
		return Pcnt;
	};

	ans = dfs(N, X);
	cout << ans << "\n";

	return 0;
}


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

int main() {
	//input
	int N; cin >> N;
	vector<int> p(N);
	int sum = 0;

	for (int i = 0;i < N;i++) {
		cin >> p[i];
		sum += p[i];


	}
	sort(p.begin(), p.end());
	cout << sum - p[N - 1]/2 << endl;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  vector<int> a(130, 0);
  for(int i=0; i<s.size(); ++i) ++a[s[i]];
  for(int i=97; i<=122; ++i){
    if(!a[i]) { cout << char(i) << endl; return 0; }
  }
  cout << "None" << endl;
}

Measured memory_bytes: 3684
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>
#include<stack>

using namespace std;

int n;

int two_to_one(int a,int b)
{
	return a*n+b;
}

vector<vector<int> >  to;
vector<int> dim;

int main()
{
	cin >> n;
	to=vector<vector<int> >(n*n);
	dim=vector<int>(n*n);

	for(int i=0;i<n;i++)
	{
		vector<int> a(n-1);
		for(int j=0;j<n-1;j++)
		{
			cin >> a[j];
			a[j]--;
		}
		for(int j=1;j<n-1;j++)
		{
			to[two_to_one(i,a[j-1])].push_back(two_to_one(i,a[j]));
			to[two_to_one(a[j-1],i)].push_back(two_to_one(a[j],i));
			dim[two_to_one(i,a[j])]++;
			dim[two_to_one(a[j],i)]++;
		}
	}

	//入次数が0の頂点の集合
	stack<int> st;

	for(int i=0;i<n*n;i++)
		if(dim[i]==0)
			st.push(i);

	
	vector<int> ans; // sort後
	while(st.size())
	{
		int i=st.top();st.pop();
		ans.push_back(i);
		for(int j=0;j<to[i].size();j++)
		{
			dim[to[i][j]]--;
			if(dim[to[i][j]]==0)
				st.push(to[i][j]);
		}
	}

	if(ans.size()!=n*n)
	{
		cout << -1 << endl;
		return 0;
	}

	int dp[1000000];
	for(int i=0;i<n*n;i++)
	{
		dp[ans[i]]=1;
//		cout << ans[i] << endl;
	}
	
	for(int i=0;i<ans.size();i++)
	{
		for(int j=0;j<to[ans[i]].size();j++)
		{
			dp[to[ans[i]][j]]=max(dp[to[ans[i]][j]],dp[ans[i]]+1);
		}
//		cout << ans[i] << " : " << dp[ans[i]] << endl;
	}

	int mx=0;
	for(int i=0;i<ans.size();i++)
		mx=max(mx,dp[ans[i]]);
	cout << mx << endl;








}

Measured memory_bytes: 66800