akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
using namespace std; 
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define rep(i,a,b) for(ll i=(a);i<=(b);i++)
#define pb push_back
#define ll long long
const ll mod=1e9+7;
ll app(ll a,ll b)
{
	return ((a%mod)*(b%mod))%mod;
}
ll add(ll a,ll b)
{
	return (((a%mod)+(b%mod))%mod+mod)%mod;
}

ll ksm(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b%2==1)
		res=app(res,a);
		a=app(a,a);
		b/=2;
		
	}
	return res;
}
ll jc[200005];
int main(int argc, char** argv) {
	int n,a,b;
	cin>>n>>a>>b;
	jc[0]=1;
	rep(i,1,max(a,b))
	jc[i]=app(jc[i-1],i);
	ll aa=1,bb=1;
	rep(i,n-a+1,n)
	{
		aa=app(aa,i);
	}
	aa=app(ksm(jc[a],mod-2),aa);
	rep(i,n-b+1,n)
	{
		bb=app(bb,i);
	}
	bb=app(ksm(jc[b],mod-2),bb);
	cout<<add((ksm(2,n)-1),-add(bb,aa));

	return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>

bool a=true,b=false,c=false;
int main(){
	char x,y,t;
	
	while(~scanf(" %c%c%c",&x,&t,&y)){
		bool d;
		if((x=='A'&&y=='B')||(x=='B'&&y=='A')){
			d=a;
			a=b;
			b=d;
		}else if((x=='B'&&y=='C')||(x=='C'&&y=='B')){
			d=b;
			b=c;
			c=d;
		}else{
			d=c;
			c=a;
			a=d;
		}
	}
	if(a)printf("A\n");
	if(b)printf("B\n");
	if(c)printf("C\n");
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)
#define vec vector

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

int dp[55][55];
int c[55][55];

int check(int x, int y)
{
	if (dp[x][y]) return 0;
	if (c[x][y] == 0) return 0;
	dp[x][y] = 1;
	
	rep(i, 8) {
		int xx = x + dx[i];
		int yy = y + dy[i];
		int take = check(xx, yy);
	}
	return 1;
}

int main(void)
{
	while(1) {
		int w, h;
		cin >> w >> h;
		if (w == 0) break;
		rep(i, 55) rep(j, 55) c[i + 1][j + 1] = 0;
		rep(i, h) rep (j, w) cin >> c[i + 1][j + 1];
		rep(i, 55) rep(j, 55) dp[i][j] = 0;
		rep(i, 55) {
			dp[0][i] = 1;
			dp[i][0] = 1;
			dp[h + 1][i] = 1;
			dp[i][w + 1] = 1;
		}

		int ans = 0;
		rep(i, h) rep(j, w) if (c[i + 1][j + 1]) ans += check(i + 1, j + 1);
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1252
#include <iostream>
#include <queue>

using namespace std;

void solve()
{
	int s;
	while(cin >> s, s)
	{
		int t;
		cin >> t;
		deque<bool> flag(t + 1);
		int count1 = 0;
		if(s == 1)
		{
			++count1;
		}
		queue<int> hamming;
		hamming.push(1);
		while(!hamming.empty())
		{
			int n = hamming.front();
			hamming.pop();
			if(n * 2 <= t && !flag[n * 2])
			{
				flag[n * 2] = true;
				hamming.push(n * 2);
				++count1;
			}
			if(n * 3 <= t && !flag[n * 3])
			{
				flag[n * 3] = true;
				hamming.push(n * 3);
				++count1;
			}
			if(n * 5 <= t && !flag[n * 5])
			{
				flag[n * 5] = true;
				hamming.push(n * 5);
				++count1;
			}
		}

		deque<bool> flag2(s + 1);
		int count2 = 0;
		queue<int> hamming2;
		hamming2.push(1);
		while(!hamming2.empty())
		{
			int n = hamming2.front();
			hamming2.pop();
			if(n * 2 < s && !flag2[n * 2])
			{
				flag2[n * 2] = true;
				hamming2.push(n * 2);
				++count2;
			}
			if(n * 3 < s && !flag2[n * 3])
			{
				flag2[n * 3] = true;
				hamming2.push(n * 3);
				++count2;
			}
			if(n * 5 < s && !flag2[n * 5])
			{
				flag2[n * 5] = true;
				hamming2.push(n * 5);
				++count2;
			}
		}
		/*int count2 = 0;
		for(int i = 0; i < s; ++i)
		{
			if(flag[i])
			{
				++count2;
			}
		}*/
		cout << count1 - count2 << endl;		
	}
}

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

Measured memory_bytes: 2112
import sys

sys.setrecursionlimit(300000)
input = sys.stdin.readline

N, Q = map(int, input().split())
children = [[] for _ in range(N + 1)]
for i in range(N - 1):
    a, b = map(int, input().split())
    children[a].append(b)

Ps = [0] * (N + 1)
for i in range(Q):
    p, x = map(int, input().split())
    Ps[p] += x

Co = [0] * (N + 1)
import collections

q = collections.deque([(1, 0)])
while (len(q) > 0):
    now, pa = q.popleft()
    Co[now] = Ps[now] + Co[pa]
    for c in children[now]:
        q.append((c, now))

Co.pop(0)
print(" ".join(map(str, Co)))

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

int main() {
	/*int N;
	cin >> N;
	vector<int>h(N);
	int i;
	for (i = 0; i < N; i++) {
		cin >> h[i];
	}
	vector<int>c(N);
	c[0] = 0;
	c[1] = abs(h[1]-h[0]);
	for (i = 1; i < N - 1; i++) {
		c[i + 1] = min(c[i] + abs(h[i + 1] - h[i]), c[i - 1] + abs(h[i + 1] - h[i - 1]));
	}
	cout << c[N - 1] << endl;*/



	/*int N, K;
	cin >> N >> K;
	vector<int>h(N);
	int i, j;

	for (i = 0; i < N; i++) {
		cin >> h[i];
	}
	vector<int>c(N);
	c[0] = 0;
	c[1] = abs(h[1] - h[0]);
	for (i = 1; i < N - 1; i++) {
		c[i + 1] = c[i] + abs(h[i + 1] - h[i]);
		for (j = 1; j <= K && i + 1 - j >= 0; j++) {
			c[i + 1] = min(c[i + 1], c[i + 1 - j] + abs(h[i + 1] - h[i + 1 - j]));
		}
	}
	cout << c[N - 1] << endl;*/


	int N;
	cin >> N;
	vector<int>a(N), b(N), c(N);
	int i;
	for (i = 0; i < N; i++) {
		cin >> a[i] >> b[i] >> c[i];
	}
	vector<int>A(N), B(N), C(N);
	A[0] = a[0];
	B[0] = b[0];
	C[0] = c[0];
	for (i = 0; i < N - 1; i++) {
		A[i + 1] = a[i + 1] + max(B[i], C[i]);
		B[i + 1] = b[i + 1] + max(A[i], C[i]);
		C[i + 1] = c[i + 1] + max(A[i], B[i]);
	}
	cout << max({ A[N - 1], B[N - 1],C[N - 1] }) << endl;
}

Measured memory_bytes: 2560
n=int(input())
txy=[list(map(int,input().split())) for i in range(n)]

now=[0,0,0]
for i in range(n):
    kyori=abs(now[1]-txy[i][1])+abs(now[2]-txy[i][2])
    tsa=txy[i][0]-now[0]

    if kyori>tsa:
        print("No")
        break
    if kyori%2!=tsa%2:
        print("No")
        break
    now=txy[i]
else:
    print("Yes")

Measured memory_bytes: 61016
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll mod=1e9+7;

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll sum=0;
    rep(i,n){
        cin >> a[i];
        sum+=a[i];
    }
    sum/=2;
    vector<ll> ans(n);
    ll sum1=0;
    for(ll i=0;i<n;i+=2){
        sum1+=a[i];
    }
    ans[0]=sum1-sum;
    rep(i,n){
        if(i){
            ans[i]=a[i-1]-ans[i-1];
        }
    }
    rep(i,n){
        if(i) cout << " ";
        cout << 2*ans[i];
    }
    cout << endl;
    return 0;
} 


Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	int ans = 0;
	for(int i = 0; i < n; i ++) scanf("%d",&a[i]);
	sort(a.begin(),a.end());
	int minn = a[0];
	int maxn = a.back();
	if(minn == maxn){
		if(minn*2 <= n || minn == n-1) ans = 1;
	}
	if(maxn == minn +1 ){
		int cnt = 0;
		for(int i = 0; a[i] == minn; i++) cnt++;
		if(maxn > cnt && cnt + 2*(maxn-cnt) <= n) ans = 1;
	}
	printf("%s\n",ans?"Yes":"No");
	return 0;
}

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


Measured memory_bytes: 3668
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    S = Scanner.string()
    T = Scanner.string()
    N = len(S)
    M = set()
    for i in range(N - len(T) + 1):
        flag = True
        for j in range(len(T)):
            if not(S[i + j] == T[j] or S[i + j] == '?'):
                flag = False
        if flag:
            A = S[:i] + T + S[i + len(T):]
            A = ['a' if s == '?' else s for s in A]
            M.add(''.join(A))
    if len(M) > 0:
        print(sorted(list(M))[0])
    else:
        print('UNRESTORABLE')


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 63468
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n;
    int[] score;
    while (true) {
      n = sc.nextInt();
      if (n == 0)
        break;
      score = new int[n];
      int sum = 0;
      for (int i = 0; i < n; i++) {
        int s = sc.nextInt();
        score[i] = s;
        sum += s;
      }
      double tmp = 0;
      for (int i = 0; i < n; i++) {
        tmp += ((double)score[i] - (double)sum / n) * ((double)score[i] - (double)sum / n);
      }
      System.out.printf("%.8f\n", Math.sqrt(tmp / n));
    }
  }
}



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

public class Main {

	final static long MOD = 1000000007L;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static ArrayList<int[]> list = new ArrayList<>();
	public static void main(String[] args) throws Exception {


		String s = nextString();
		int[] alph = new int[]{0,0,0};

		for(int i=0;i<s.length();i++){
			alph['c'-s.charAt(i)]++;
		}
		int x=s.length()/3;
		String ans = "NO";
		Arrays.sort(alph);
		if(s.length()%3 ==0){
			if(alph[0]==x && alph[1]==x && alph[2]==x){
				ans="YES";
			}
		}else if(s.length()%3 == 1){
			if(alph[0]==x && alph[1]==x && alph[2]==x+1){
				ans="YES";
			}

		}else{
			if(alph[0]==x && alph[1]==x+1 && alph[2]==x+1){
				ans="YES";
			}
		}
		System.out.println(ans);
	}



	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static String concatStringArray(String[] s){
		StringBuffer sb = new StringBuffer();
		for(String x:s){
			sb.append(x);
		}
		return sb.toString();
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 24788
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let x: usize = read();
    let y: usize = read();
    let a: usize = read();
    let b: usize = read();
    let c: usize = read();
    let mut p: Vec<u64> = (0..a).map(|_| read()).collect();
    let mut q: Vec<u64> = (0..b).map(|_| read()).collect();
    let mut r: Vec<u64> = (0..c).map(|_| read()).collect();
    p.sort_by(|x, y| y.cmp(x));
    p.truncate(x);
    q.sort_by(|x, y| y.cmp(x));
    q.truncate(y); 
    p.append(&mut q);
    p.append(&mut r);
    p.sort_by(|x, y| y.cmp(x));
    p.truncate(x+y);
    let sum: u64 = p.iter().sum();
    println!("{:?}", sum);
}


Measured memory_bytes: 12692
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#define ML 1000005

using namespace std;

struct EDGE
{
	int u, v, w;
	EDGE (const int& nu = 0, const int& nv = 0, const int& nw = 0) : u(nu), v(nv), w(nw) {}
} E[66];
int N = 0, M = 0, L;

int main()
{
	int mxp = 0;
	scanf("%d", &L);
	if(L == 1)
	{
		printf("%d %d\n%d %d %d\n", 2, 1, 1, 2, 0);
		return 0;
	}
	for(int i=19; i>=0; i--)
		if(L>>i & 1)
		{
			mxp = i;
			break;
		}
	N = mxp + 1;
	for(int i=0; i<mxp; i++) E[++M] = EDGE(i+1, i+2, 1<<i), E[++M] = EDGE(i+1, i+2, 0);
	for(int i=0; i<mxp; i++)
		if(L>>i & 1)
			E[++M] = EDGE(i+1, N, ((L>>i)^1)<<i);
	//E[++M] = EDGE(1, N, L);
	printf("%d %d\n", N, M);
	for(int i=1; i<=M; i++) printf("%d %d %d\n", E[i].u, E[i].v, E[i].w);
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Linq;
using static System.Math;

class MainClass
{

    public static void Main(string[] args)
    {
       var K = LnInt();
        var que = new Queue<long> ();
        for (long i = 1; i <= 9; i++) que.Enqueue(i);
        var result = 0L;
        for(int i = 0; i <K; i++)
        {
           var old= que.Dequeue();
            result = old;
            if (old % 10 != 0)
            {
                que.Enqueue(10 * old + old % 10 - 1);
            }
            que.Enqueue(old * 10 + old % 10);
            if (old % 10 != 9)
            {
                que.Enqueue(10 * old + old % 10+1);
            }
        }
        Console.WriteLine(result);
    }

    static bool isLunLun(int i)
    {
        var vs = i.ToString().ToCharArray();
        var lastnum = int.Parse(vs[0].ToString());
        for (int n = 0; n < vs.Length; n++)
        {
            var cur = int.Parse(vs[n].ToString());
            if (Abs(lastnum - cur) > 1) { return false; }
            lastnum = cur;
        }
        return true;
    }


    public static long Gcd(long a, long b) { if (a > b) { var r = a % b; if (r == 0) return b; else return Gcd(b, r); } else { var r = b % a; if (r == 0) return a; else return Gcd(a, r); } }
    public static int Gcd(int a, int b){if (a > b){var r = a % b;if (r == 0) return b; else return Gcd(b, r);}else{ var r = b % a; if (r == 0) return a; else return Gcd(a, r); }}
public static int[] LnInts(){var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);var ins = new int[vs.Length];for (int i = 0; i < vs.Length; i++) ins[i] = int.Parse(vs[i]);return ins;}public static int LnInt(){var vs = Console.ReadLine().Trim();return int.Parse(vs);}public static long[] LnLngs(){var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);var ins = new long[vs.Length];for (int i = 0; i < vs.Length; i++) ins[i] = long.Parse(vs[i]);return ins;}public static long LnLng(){var vs = Console.ReadLine().Trim();return long.Parse(vs);}public static string[] LnStrs(){var vs = Console.ReadLine().Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);return vs;}public static string LnStr(){var vs = Console.ReadLine().Trim();return vs;}}




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

using namespace std;

int main()
{
  long long ans = 0;
  int N;
  
  scanf("%d", &N);
  ans = (long long)(N - 1) * N * (N + 1) / 6 + (long long)N * (N + 1) / 2;
  
  for (int i = 0; i < N - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    if (u > v) swap(u, v);
    ans -= (long long)u * (N - v + 1);
  }
  
  printf("%lld\n", ans);
  
  return 0;
}

Measured memory_bytes: 3792
#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
typedef long long int ll;
int main(){
int n;
cin >>n;
ll a[n];
for(int i=0;i<n;i++) {
  cin >>a[i];
  a[i]-=(i+1);
}
sort(a,a+n);
ll ans=0,m;
if(n%2==0) m=(a[n/2]+a[n/2-1])/2;
else m=a[n/2];
for(int i=0;i<n;i++){
 ans+=abs(a[i]-m);
}
cout <<ans<<endl;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


const int INF = 1001001001;
int dp[303][303][303];

int main2() {
  string s;
  cin >> s;
  int N = (int)s.size();
  int K; cin >> K;
  REP(i, N+1) REP(j, N+1) REP(k, N+1) dp[i][j][k] = -INF;
  REP(i, N) dp[i][i][0] = 0;
  REP(i, N) dp[i][i+1][0] = 1;
  for (int d = 2; d <= N; d++) {
    for (int i = 0; i + d <= N; i++) {
      for (int k = 0; k <= N; k++) {
        int j = i + d;
        chmax(dp[i][j][k], dp[i+1][j][k]);
        chmax(dp[i][j][k], dp[i][j-1][k]);
        if (s[i] == s[j-1]) {
          chmax(dp[i][j][k], dp[i+1][j-1][k] + 2);
        } else {
          chmax(dp[i][j][k+1], dp[i+1][j-1][k] + 2);
        }
      }
    }
  }
  int ans = 0;
  REP(i, N) for (int j = i + 1; j <= N; j++) REP(k, K+1) chmax(ans, dp[i][j][k]);
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 108800
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
vector<int> v;
int arr[210];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);

    int n, m;
    cin >> n >> m;

    for (int i = 1; i <= 2 * n; ++i)
        arr[i] = i;

    for (int i = 0; i < m; ++i)
    {
        int k;
        cin >> k;

        if (k == 0)
        {
            int arr1[210];
            int arr2[210];
            int idx1 = 0;
            int idx2 = 0;
            for (int j = 1; j <= n; ++j)
            {

                arr1[idx1] = arr[j];
                idx1++;

                arr2[idx2] = arr[j + n];
                idx2++;
            }

            idx1 = 0, idx2 = 0;
            for (int j = 1; j <= 2 * n; ++j)
            {
                if (j % 2 == 1)
                {
                    arr[j] = arr1[idx1];
                    idx1++;
                }
                else
                {
                    arr[j] = arr2[idx2];
                    idx2++;
                }
            }
        }
        else
        {
            int arr1[210];
            int arr2[210];
            for (int j = 1; j <= k; ++j)
            {
                arr1[j] = arr[j];
            }
            for (int j = k + 1; j <= 2 * n; ++j)
            {
                arr2[j - k] = arr[j];
            }

            for (int j = 1; j <= 2 * n - k; ++j)
            {
                arr[j] = arr2[j];
            }
            for (int j = 2 * n - k + 1; j <= 2 * n; ++j)
            {
                arr[j] = arr1[j - (2 * n - k + 1) + 1];
            }
        }
    }

    for (int i = 1; i <= 2 * n; ++i)
    {
        cout << arr[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3216
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,t,u;
    ll a,b;
    cin >> s >> t >> a >> b >> u;
    if(s == u){
        print(a-1,b);
    }else{
        print(a,b-1);
    }

    

}

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

void solve()
{
	string s;
	cin>>s;
	if(s.find('B')==-1)
		cout<<"ABC"<<endl;
	else
		cout<<"ARC"<<endl;
}

int main()
{
	ll t = 1;
	// cin>>t;
	while(t--)
	{
		solve();
	}
}

Measured memory_bytes: 3628
/// Thank you tanakh!!!
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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")
    };
}

use std::cmp;
use std::collections::{BTreeMap, BTreeSet};

fn main() {
    input!(n: usize, t: usize, a: [usize; n]);

    let mut value = 0;
    let mut min = a[0];
    let mut map = BTreeMap::new();

    for i in 0..n {
        let a = a[i];
        min = cmp::min(min, a);
        value = cmp::max(value, a - min);
        (*map.entry(a).or_insert(Vec::new())).push(i);
    }

    let mut candidates = BTreeSet::new();
    for &a in a.iter() {
        let next = a + value;
        if map.contains_key(&next) {
            candidates.insert((a, next));
        }
    }

    let mut ans = 0;
    for &(small, large) in candidates.iter() {
        let small: &Vec<usize> = map.get(&small).unwrap();
        let large: &Vec<usize> = map.get(&large).unwrap();

        let mut small_count = 0;
        let mut large_count = 0;
        let first_small = small[0];
        let last_large = large[large.len() - 1];
        for &small in small.iter() {
            if small < last_large {
                small_count += 1;
            }
        }

        for &large in large.iter() {
            if large > first_small {
                large_count += 1;
            }
        }

        ans += cmp::min(small_count, large_count);
    }

    println!("{}", ans);
}


Measured memory_bytes: 20732
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
	      Scanner sc = new Scanner(System.in);
	      double a = sc.nextInt();
	      double b = sc.nextInt();
          String ans = "No";
          if(b == 100) {
        	  a = a*1000 + b;
          }
          else if(b < 100 && b > 9) {
        	  a = a*100 + b;
          }
          else if(b < 10){
        	  a = a*10 + b;
          }
          for(int i = 1;i<=317;i++) {
        	  if (i == a/i) {
        		  ans = "Yes";
        	  }
          }
	      System.out.println(ans);
	}
}

Measured memory_bytes: 21844
import java.util.*;
import java.util.Map.Entry;
 
class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
//	 static int mod = 998244353;
	 public static void main(String[] args) {
	        Scanner sc = new Scanner(System.in);
	        int N = sc.nextInt();
	        long[] m = new long[N+1];
	        int[] a = new int[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Integer.parseInt(sc.next());
	            m[a[i]]++;
	        }
	        long sum=0;
	        for(int i=0;i<N+1;i++) {
	        	if(m[i]>1) {
	        		sum=sum+((m[i]*(m[i]-1))/2l);
	        	}
	        }
	        for(int i=0;i<N;i++) {
	        	if(m[a[i]]>1) {
	        		System.out.println((long)sum-m[a[i]]+1);
	        	} else {
	        		System.out.println(sum);
	        	}
	        }
	        
	 }
}


Measured memory_bytes: 93564
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int gcd(int a, int b)
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	return gcd(b, a%b);
}
int lcm(int a, int b)
{
	return a/gcd(a, b) * b;
}
int p[101], q[101], r[101], b[101];
int dfs(int s)
{
	if (s == 0)
		return 1;

	int red = dfs(r[s]), blue = dfs(b[s]);
	int t = lcm(red*p[s], blue*q[s]);
	return t/p[s] + t/q[s];
}
int main()
{
	int n;
	while (~scanf("%d", &n) && n)
	{
		bool root[101];
		fill(root, root+101, true);
		for (int i = 1; i <= n; ++i)
		{
			scanf("%d%d%d%d", p+i, q+i, r+i, b+i);
			root[r[i]] = root[b[i]] = false;
		}

		int res = 0;
		for (int i = 1; i <= n; ++i)
			if (root[i])
				res = dfs(i);
		printf("%d\n", res);
	}
}

Measured memory_bytes: 0
#include<iostream>
#include<math.h>
using namespace std;

int main(){
    long long a,b,c,d=0,e=0;
    cin>>a;
    for(a;a>0;){
        if(a%10==7){cout<<"Yes"; return 0;}
        a/=10;
    }
    cout<<"No";
    return 0;
}


Measured memory_bytes: 3540
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define inf 1000000000
#define md 1000000007
#define pb push_back
#define li 100005
#define int long long
using namespace std;
int n,a,b;
main(){
	scanf("%lld %lld",&a,&b);
	if((a+b)%2==1){
		printf("IMPOSSIBLE\n");
	}
	else printf("%lld\n",(a+b)/2);
	return 0;
}




Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    string s;
    long long int k;
    int now=0;
    cin>>s>>k;
    while(true){
        if(k==1){
            cout<<s[now]<<endl;
            return 0;
        }
        else if(s[now]=='1'){
            k--;
            now++;
        }
        else {
            cout<<s[now]<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
int N;
int a[1001];

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

  std::cin >> N;
  for (int i =0; i < N; i++) std::cin >> a[i];

  std::sort(a,a + N);
  std::cout << a[N-1] - a[0] << '\n';

}


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

int main(){
  int X, Y, A, B, C;
  cin >> X >> Y >> A >> B >> C;
  
  vector<int> va(A);
  vector<int> vb(B);
  vector<int> vc(C);
  
  for(int i = 0; i < A; i++){
    cin >> va[i];
  }
  for(int i = 0; i < B; i++){
    cin >> vb[i];
  }
  for(int i = 0; i < C; i++){
    cin >> vc[i];
  }
  
  sort(va.begin(), va.end());
  sort(vb.begin(), vb.end());
  sort(vc.begin(), vc.end());
  
  vector<int> v(X + Y + C);
  for(int i = 0; i < X; i++){
    v[i] = va[A - X + i];
  }
  for(int i = X; i < (X + Y); i++){
    v[i] = vb[B - X - Y + i];
  }
  for(int i = X + Y; i < (X + Y + C); i++){
    v[i] = vc[i - X - Y];
  }
  
  sort(v.begin(), v.end());
  long long sum = 0;
  for(int i = C; i < X + Y + C; i++){
    sum += v[i];
  }
  cout << sum << endl;
}
      

Measured memory_bytes: 2560
// ctrl+shift+b
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll R; cin >> R;
    string ans;
    if (R < 1200){ans = "ABC";}
    else if (R < 2800){ans = "ARC";}
    else {ans = "AGC";}
    cout << ans << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;

static const int MAX_NUM = 101;

void BFS(int matrix[][MAX_NUM], int num, int target, int result[])
{
    queue<int> Q;
    int  distance = 0;
    char state[MAX_NUM] = {0};

    Q.push(target);
    result[target] = distance;
    state[target] = 1;

    while (Q.empty() == false) {
        int index = Q.front();
        Q.pop();

        for (int i = 1; i < num + 1; i++) {
            if ((matrix[index][i] == 1) && (state[i] == 0)) {
                Q.push(i);
                state[i]  = 1;
                result[i] = result[index] + 1;
            }
        }
    }

    return;
}

int main(void)
{
    int num;
    int index, elemNum, tmp;
    int matrix[MAX_NUM][MAX_NUM] = {0};
    int result[MAX_NUM];

    scanf("%d", &num);
    for (int i = 1; i < num + 1; i++) {
        result[i] = -1;
        scanf("%d %d", &index, &elemNum);
        for (int j = 0; j < elemNum; j++) {
            scanf("%d", &tmp);
            matrix[index][tmp] = 1;
        }
    }

    BFS(matrix, num, 1, result);

    for (int i = 1; i < num + 1; i++) {
        printf("%d %d\n", i, result[i]);
    }

    return 0;
}

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


int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int D;
  cin>>D;
  if(D==22){
    cout<<"Christmas Eve Eve Eve";
  }
  if(D==23){
    cout<<"Christmas Eve Eve";
  }
  if(D==24){
      cout<<"Christmas Eve";
    }
  if(D==25){
      cout<<"Christmas";
    }

  return 0;
}

Measured memory_bytes: 256
// solution is at the bottom

import kotlin.math.*

@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

const val _BUFFER_SIZE = 1 shl 16
@JvmField val _buffer = ByteArray(_BUFFER_SIZE)
@JvmField var _bufferPt = 0
@JvmField var _bytesRead = 0

tailrec fun readChar(): Char {
    if(_bufferPt == _bytesRead) {
        _bufferPt = 0
        _bytesRead = INPUT.read(_buffer, 0, _BUFFER_SIZE)
    }
    return if(_bytesRead < 0) Char.MIN_VALUE
    else {
        val c = _buffer[_bufferPt++].toChar()
        if (c == '\r') readChar()
        else c
    }
}

fun readLine(): String? {
    var c = readChar()
    return if(c == Char.MIN_VALUE) null
    else buildString {
        while(true) {
            when(c) {
                '\n', Char.MIN_VALUE -> return@buildString
                else -> {
                    append(c)
                    c = readChar()
                }
            }
        }
    }
}
fun readLn() = readLine()!!

fun read() = buildString {
    var c = readChar()
    while(c <= ' ') {
        if(c == Char.MIN_VALUE) return@buildString
        c = readChar()
    }
    do {
        append(c)
        c = readChar()
    } while(c > ' ')
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }


fun main() {
    val (n, m, k) = readIntArray(3)
    val colCount = IntArray(m) {0}
    val rowCount = IntArray(n) {0}

    val points = mutableSetOf<Pair<Int, Int>>()
    for (kk in 1..k) {
        var (row, col) = readIntArray(2)
        row--
        col--

        colCount[col]++
        rowCount[row]++

        points.add(Pair(row, col))
    }

//    println(colCount.joinToString(" "))
//    println(rowCount.joinToString(" "))

    val colMax = colCount.max()!!
    val col = colCount.indexOf(colMax)

    var result = 0

    for (row in 0 until n) {
        var ths = colCount[col] + rowCount[row]
        if (Pair(row, col) in points) {
            ths--
        }

        result = max(result, ths)
    }

    val rowMax = rowCount.max()!!
    val row = rowCount.indexOf(rowMax)

    for (col in 0 until m) {
        var ths = colCount[col] + rowCount[row]
        if (Pair(row, col) in points) {
            ths--
        }

        result = max(result, ths)
    }

    println(result)
}


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
int n, t, l, r;
int p[N];
ll fac[N], inv[N];
ll ans;

ll power(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b & 1) {
            res = res * a % mod;
        }
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

void init() {
    memset(p, 255, sizeof p);
    fac[0] = 1;
    for (int i = 1; i < N; ++i) {
        fac[i] = fac[i - 1] * i % mod;
    }
    inv[N - 1] = power(fac[N - 1], mod - 2);
    for (int i = N - 2; i >= 0; --i) {
        inv[i] = inv[i + 1] * (i + 1) % mod;
    }
}

inline ll C(ll a, ll b) {
    return fac[a] * inv[b] % mod * inv[a - b] % mod;
}


int main() {
    init();
    cin >> n;
    for (int i = 0; i <= n; ++i) {
        cin >> t;
        if (p[t] == -1) {
            p[t] = i;
        } else {
            l = p[t];
            r = i;
        }
    }
    // left l mid r right
    int left = l;
    int right = n - r;
    int m = left + right;
    for (int k = 1; k <= n + 1; ++k) {
        ans = C(n + 1, k);
        if (k - 1 <= m) {
            ans = (ans - C(m, k - 1) + mod) % mod;
        }
        cout << ans << endl;
    }
    return 0;
}


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

using namespace std;

const int N = 50+1;

int n;
int p[N];

int main(){
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    cin >> n;
    int sum = 0;
    for(int i = 1; i <= n; ++i){
        cin >> p[i];
        if(p[i] - i)
            ++sum;
    }
    if(sum == 0 || sum == 2)
        cout << "YES\n";
    else cout << "NO\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
using ll = long long;
template <class T> using vec = vector<T>;
using vi   = vector<int>;
using vvi  = vector<vi>;
using vvvi = vector<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int N = in();
  cout << 180 * (N-2) << endl;;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>();
        int b = 0;
        if(n==0){
            System.out.println(n);
        }
        else{
            while(n!=0){
                a.add(mod2(n));
                n = div2(n);
                b++;
           }
           for(int i=0; i<b; i++){
                System.out.print(a.get(b-1-i));
           }
        }
    }
    public static int div2(int n){
        if((n%2)!=0){
            n = n-1;
        }
        return n / (-2);
    }
    public static int mod2(int n){
        if((n%2)!=0){
            return 1;
        }
        else{
            return 0;
        }
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
long long int mod = (long long int)1000000007;
using namespace std;

void solve()
{
    ll i,j,k,n;
    std::cout.precision(10);
    int yes=0;
	ll ans=0;
  	string s,t;
  cin>>s>>t;
  for(i=0;i<s.size();i++)
  {
   if(s[i]!=t[i])
      {
       	ans++; 
      }
  }
      cout<<ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
    int i,j,k;
    int t;
    std::cout.precision(10);
    t=1;
    while(t--)
    {
        solve();
        cout<<"\n";
    }
}


Measured memory_bytes: 3680
import java.util.*;

public class Main{
	double p,e,t;
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if((n|m) == 0) break;
			String [] data = new String[n];
			for(int i = 0; i < n; i++){
				data[i] = sc.next();
			}
			StringBuilder str = new StringBuilder();
			while(m-- > 0){
				String s = sc.next();
				str.append(s);
			}
			ArrayList<HashSet<Integer>> matchind = new ArrayList<HashSet<Integer>>();
			for(int i = 0; i < n; i++){
				matchind.add(new HashSet<Integer>());
			}
			int len = str.length();
			for(int i = 0; i < len; i++){
				for(int j = 0; j < n; j++){
					if(match(str, i, data[j])){
						matchind.get(j).add(i);
					}
				}
			}
			boolean [][] dp = new boolean[1 << n][len + 1];
			
			
			for(int i = 0; i < len; i++){
				for(int j = 0;j < n; j++){
					if(matchind.get(j).contains(i) == false) continue;
					dp[0][i] = true;
					for(int k = 0; k < (1 << n); k++){
						if(dp[k][i] == false) continue;
						if((k & (1 << j)) > 0) continue;
						int nextbit = (k | (1 << j));
						int nexti = i + data[j].length();
						//debug(nextbit, nexti, i,j,k);
						dp[nextbit][nexti] = true;
					}
				}
			}
			int count = 0;
			for(int i = 0; i <= len;i++){
				if(dp[(1 << n) - 1][i]){
					count++;
				}
			}
			System.out.println(count);
		}
	}

	private boolean match(StringBuilder str, int ind, String patt) {
		if(str.length() - ind < patt.length()){
			return false;
		}
		for(int i = 0; i < patt.length(); i++){
			if(str.charAt(i +  ind) != patt.charAt(i)){
				return false;
			}
		}
		return true;
	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

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

Measured memory_bytes: 131512
#include<iostream>
using namespace std;
int n, w[1006], c[1006], r[1006], dp[1006][1006];
int main() {
	cin >> n; for (int i = 1; i <= n; i++) { cin >> c[i] >> w[i]; r[i] = w[i]; }
	for (int i = 1; i <= n; i++)r[i] += r[i - 1];
	for (int i = 1; i <= n; i++) { dp[i][i] = 1; }
	for (int i = 0; i < n; i++) {
		for (int j = 1; j <= n; j++) {
			int L = j, R = j + i; if (R > n)continue;
			if (dp[L][R] == 0)continue;
			int WA = r[R] - r[L - 1];
			if (L >= 2 && c[L - 1] >= WA) { dp[L - 1][R] = 1; }
			if (R < n && c[R + 1] >= WA) { dp[L][R + 1] = 1; }
		}
	}
	int cnt = 0, p = 1, q = 1;
	while (p <= n) {
		while (dp[p][q] == 1) { q++; }
		cnt++; p = q;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 7036
#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
const int INF = 1000100100;
 
 
int main(){
    ll n,a[205],ans=0;
    cin>>n;
    rep(i,n-1){
        cin>>a[i];
        if(i==0){
            ans+=a[i];
        }else{
            if(a[i]<a[i-1]) ans+=a[i];
            else ans+=a[i-1];
        }
    }
  ans+=a[n-2];
    cout<<ans;
}

Measured memory_bytes: 3636
N, M = tuple(map(int, input().split(" ")))

bulbs = []
for _ in range(M):
    bulb = list(map(int, input().split(" ")))
    bulbs.append(bulb[1:])

P = list(map(int, input().split(" ")))
F = "{:0" + str(N) + "b}"
ans = 0

for i in range(2**N):
    switch = F.format(i)
    if all(sum([int(switch[b-1]) for b in bulb]) % 2 == P[m]
           for m, bulb in enumerate(bulbs)):
        ans += 1
print(ans)

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

template <
    typename TYPE,
    std::size_t SIZE>
std::size_t a_len(const TYPE (&array)[SIZE])
{
    return SIZE;
}

using namespace std;
using ll = long long int;
using vi = vector<ll>;

#define REPS(a, i, n) for (ll(i) = a; (i) < (n); ++(i))
#define REP(i, n) REPS(0, i, n)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 912345678;

int a, b, c, d;

int main()
{
    cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;
}

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

int main() {
  string s;
  cin >> s;
  int ans = 700;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s.at(i) == 'o') {
      ans += 100;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import sys

input = sys.stdin.readline

def main():
    ans = 'Yes'
    w = input().rstrip('\n')
    s = set(w)
    for i in s:
        if w.count(i)%2 != 0:
            ans = 'No'
            break
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 2940
#include<iostream>
#include<string>
#include <numeric>
#include <algorithm>
#include<queue>
#include<vector>
using namespace std;
typedef pair<int, int> P;
long long X, Y, cnt=1;

int main(){
  cin >> X >> Y;
  
  while(X<=Y){
    X = X*2;
    cnt++;
  }
  cout << cnt-1 << endl;
  return 0;
}

Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>


#define	ll_int	long long int


void Count(ll_int *box, int b, int e, ll_int k)
{
	int count = 0;
	int i;

	for(i = b; i < e; i++)
		if(box[i] == k)
			count++;

	printf("%d\n", count);
}


int main()
{
	int n, q;
	int b, e;
	ll_int k;
	ll_int *box;
	int i;

	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);

	for(i = 0; i < n; i++)
		scanf("%lld", &box[i]);


	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%d %d %lld", &b, &e, &k);
		Count(box, b, e, k);
	}

	return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define br cout << endl;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
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;}

// 0 false, 1 true 
// stringの数字をint型にしてアスキーコードになったら -48する
// 切り上げ　ceil(a)
// コンパイル　g++ -std=c++17 a.cpp

//(a / b) % MOD : a * modinv(b, MOD) % MOD
long long modinv(long long a, long long mod) {
    long long b = mod, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= mod;
    if (u < 0) u += mod;
    return u;
}

//a^n % mod
long long modpow(long long a, long long n, long long mod){
    ll res = 1;
    while(n > 0){
        if(n & 1){
            res = res * a % mod;
        }
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


ll modncr(ll n, ll r){
    ll bunshi = 1;
    ll bunbo = 1;
    for(ll i = 0; i < r; i++){
        bunshi = (bunshi * (n-i)) % MOD;
        bunbo = (bunbo * (i+1)) % MOD;
    }
    return (bunshi * modinv(bunbo, MOD)) % MOD;
}


int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    ll all = 0;
    all = modpow(2, n, MOD) - 1;
    
    
    all = all - modncr(n, a);
    if(all < 0) all += MOD;
    all = all - modncr(n, b);
    if(all < 0) all += MOD;

    if(n == 2){
        cout << 0 << endl;
    }else{
        cout << all << endl;
    }
    
}

Measured memory_bytes: 256